OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | List of all members
Matrix< T > Class Template Reference

Matrix. More...

#include <Matrix.h>

Inheritance diagram for Matrix< T >:
Inheritance graph
[legend]
Collaboration diagram for Matrix< T >:
Collaboration graph
[legend]

Public Member Functions

 Matrix ()
 Default constructor. More...
 
 Matrix (const Array2D< T > &)
 Conversion. More...
 
 Matrix (int rows, int cols)
 Constructor. More...
 
 Matrix (int rows, int cols, const T &t)
 Constructor. More...
 
 Matrix (const Matrix &)
 
 ~Matrix ()
 
Matrix< T > & operator= (const Matrix< T > &)
 
Matrix< T > & operator= (const Array2D< T > &)
 Convert and assign. More...
 
Matrix< T > & operator*= (const T &)
 Multiply by scalar and assign. More...
 
Matrix< T > & operator/= (const T &)
 Divide by scalar and assign. More...
 
Matrix< T > & operator+= (const Matrix< T > &)
 Add matrix and assign.. More...
 
Matrix< T > & operator-= (const Matrix< T > &)
 Subtract matrix and assign. More...
 
Matrix< T > & operator+= (const T &)
 Add scalar. More...
 
Matrix< T > & operator-= (const T &)
 Subtract scalar. More...
 
Matrix< T > & operator*= (const Matrix< T > &)
 Multiply by matrix and assign. More...
 
Matrix< Ttranspose () const
 Matrix transpose. More...
 
Matrix< Tdotm (const Matrix< T > &) const
 Matrix product. More...
 
Vector< Tdotcv (const Vector< T > &) const
 Matrix times column vector. More...
 
Vector< Tdotrv (const Vector< T > &) const
 Row vector times matrix. More...
 
- Public Member Functions inherited from Array2D< T >
 Array2D ()
 Default constructor. More...
 
 Array2D (int rows, int cols)
 Constructor. More...
 
 Array2D (int rows, int cols, const T &t)
 Constructor. More...
 
 Array2D (const Array2D &)
 
 ~Array2D ()
 
Array2D< T > & operator= (const Array2D< T > &)
 
Toperator() (int r, int c)
 Get element reference. More...
 
const Toperator() (int r, int c) const
 Get element value. More...
 
int nrows () const
 Get number of rows. More...
 
int ncols () const
 Get number of columns. More...
 
int size () const
 Get total size (rows times columns). More...
 
iterator begin ()
 Get pointer to beginning of data. More...
 
iterator end ()
 Get pointer past end of data. More...
 
const_iterator begin () const
 Get pointer to beginning of data. More...
 
const_iterator end () const
 Get pointer past end of data. More...
 
row_iterator row_begin (int r)
 Get row iterator. More...
 
row_iterator row_end (int r)
 Get row iterator. More...
 
const_row_iterator row_begin (int r) const
 Get row iterator. More...
 
const_row_iterator row_end (int r) const
 Get row iterator. More...
 
row_iterator operator[] (int r)
 Get row iterator. More...
 
const_row_iterator operator[] (int r) const
 Get row iterator. More...
 
col_iterator col_begin (int c)
 Get column iterator. More...
 
col_iterator col_end (int c)
 Get column iterator. More...
 
const_col_iterator col_begin (int c) const
 Get column iterator. More...
 
const_col_iterator col_end (int c) const
 Get column iterator. More...
 
void getColumn (Array1D< T > &toArray, int c) const
 Fetch column. More...
 
void getRow (Array1D< T > &toArray, int r) const
 Fetch row. More...
 
void putColumn (const Array1D< T > &fromArray, int c)
 Store column. More...
 
void putRow (const Array1D< T > &fromArray, int r)
 Store row. More...
 
void swapColumns (int c1, int c2)
 Exchange columns. More...
 
void swapRows (int row1, int row2)
 Exchange rows. More...
 

Additional Inherited Members

- Public Types inherited from Array2D< T >
typedef T value_type
 The value type of the array. More...
 
typedef Titerator
 The iterator type for sequential access to all elements. More...
 
typedef const Tconst_iterator
 The iterator type for sequential access to all elements. More...
 
typedef Trow_iterator
 The iterator type for access by rows. More...
 
typedef const Tconst_row_iterator
 The iterator type for access by rows for a constant array. More...
 
typedef SliceIterator< Tcol_iterator
 The iterator type for access by columns. More...
 
typedef ConstSliceIterator< Tconst_col_iterator
 The iterator type for access by columns for a constant array. More...
 
- Protected Attributes inherited from Array2D< T >
int rows
 
int cols
 
int len
 
Tdata
 

Detailed Description

template<class T>
class Matrix< T >

Matrix.

Definition at line 38 of file Matrix.h.

Constructor & Destructor Documentation

template<class T >
Matrix< T >::Matrix ( )

Default constructor.

Definition at line 139 of file Matrix.h.

template<class T>
Matrix< T >::Matrix ( const Array2D< T > &  rhs)

Conversion.

Definition at line 151 of file Matrix.h.

template<class T>
Matrix< T >::Matrix ( int  rows,
int  cols 
)

Constructor.

Definition at line 157 of file Matrix.h.

template<class T>
Matrix< T >::Matrix ( int  rows,
int  cols,
const T t 
)

Constructor.

Definition at line 163 of file Matrix.h.

References Array2D< T >::data, min(), and T.

Here is the call graph for this function:

template<class T>
Matrix< T >::Matrix ( const Matrix< T > &  rhs)

Definition at line 145 of file Matrix.h.

template<class T >
Matrix< T >::~Matrix ( )

Definition at line 172 of file Matrix.h.

Member Function Documentation

template<class T>
Vector< T > Matrix< T >::dotcv ( const Vector< T > &  B) const

Matrix times column vector.

Definition at line 361 of file Matrix.h.

References Array1D< T >::begin(), nr, Attrib::Distribution::R, Array1D< T >::size(), and T.

Referenced by operator*().

Here is the call graph for this function:

template<class T>
Matrix< T > Matrix< T >::dotm ( const Matrix< T > &  B) const

Matrix product.

Definition at line 339 of file Matrix.h.

References Array2D< T >::col_begin(), Array2D< T >::ncols(), Array2D< T >::nrows(), Attrib::Distribution::R, and T.

Referenced by operator*().

Here is the call graph for this function:

template<class T>
Vector< T > Matrix< T >::dotrv ( const Vector< T > &  B) const

Row vector times matrix.

Definition at line 378 of file Matrix.h.

References Array1D< T >::begin(), Array1D< T >::end(), Attrib::Distribution::R, Array1D< T >::size(), and T.

Referenced by operator*().

Here is the call graph for this function:

template<class T>
Matrix< T > & Matrix< T >::operator*= ( const T val)

Multiply by scalar and assign.

Definition at line 191 of file Matrix.h.

template<class T>
Matrix< T > & Matrix< T >::operator*= ( const Matrix< T > &  array)

Multiply by matrix and assign.

Definition at line 251 of file Matrix.h.

template<class T>
Matrix< T > & Matrix< T >::operator+= ( const Matrix< T > &  array)

Add matrix and assign..

Definition at line 207 of file Matrix.h.

References Array2D< T >::begin(), Array2D< T >::ncols(), and Array2D< T >::nrows().

Here is the call graph for this function:

template<class T>
Matrix< T > & Matrix< T >::operator+= ( const T val)

Add scalar.

Definition at line 229 of file Matrix.h.

References min(), and Hypervolume::n.

Here is the call graph for this function:

template<class T>
Matrix< T > & Matrix< T >::operator-= ( const Matrix< T > &  array)

Subtract matrix and assign.

Definition at line 218 of file Matrix.h.

References Array2D< T >::begin(), Array2D< T >::ncols(), and Array2D< T >::nrows().

Here is the call graph for this function:

template<class T>
Matrix< T > & Matrix< T >::operator-= ( const T val)

Subtract scalar.

Definition at line 240 of file Matrix.h.

References min(), and Hypervolume::n.

Here is the call graph for this function:

template<class T>
Matrix< T > & Matrix< T >::operator/= ( const T val)

Divide by scalar and assign.

Definition at line 199 of file Matrix.h.

template<class T>
Matrix< T > & Matrix< T >::operator= ( const Matrix< T > &  rhs)

Definition at line 177 of file Matrix.h.

References Array2D< T >::operator=().

Here is the call graph for this function:

template<class T>
Matrix< T > & Matrix< T >::operator= ( const Array2D< T > &  rhs)

Convert and assign.

Definition at line 184 of file Matrix.h.

References Array2D< T >::operator=().

Here is the call graph for this function:

template<class T >
Matrix< T > Matrix< T >::transpose ( ) const

Matrix transpose.

Definition at line 258 of file Matrix.h.

References Array2D< T >::col_begin(), nr, and Attrib::Distribution::R.

Here is the call graph for this function:


The documentation for this class was generated from the following file: