Simpatico
v1.10
|
Two-dimensional array container template (abstract).
An Matrix object A is a two-dimensional array in which the operator A(i,j) returns a reference to element j of row i.
The memory for a Matrix is stored in a single one-dimensional C array.
Matrix is an abstract class because it cannot allocate memory. Concrete subclasses: DMatrix and FMatrix.
#include <Matrix.h>
Public Member Functions | |
virtual | ~Matrix () |
Destructor. More... | |
int | capacity1 () const |
Get number of rows (range of the first array index). More... | |
int | capacity2 () const |
Get number of columns (range of the second array index). More... | |
const Data & | operator() (int i, int j) const |
Return element (i,j) of matrix by const reference. More... | |
Data & | operator() (int i, int j) |
Return element (i,j) of matrix by reference. More... | |
Protected Member Functions | |
Matrix () | |
Default constructor. More... | |
Protected Attributes | |
Data * | data_ |
Pointer to 1D C array of all elements. More... | |
int | capacity1_ |
Number of rows (range of first index). More... | |
int | capacity2_ |
Number of columns (range of first index). More... | |
|
virtual |
|
inlineprotected |
|
inline |
Get number of rows (range of the first array index).
Definition at line 125 of file Matrix.h.
References Util::Matrix< Data >::capacity1_.
Referenced by Util::DMatrix< Data >::allocate(), Util::bcast(), Util::DSymmMatrixParam< Type >::bcastValue(), Util::DMatrixParam< Type >::bcastValue(), Util::DSymmMatrixParam< Type >::loadValue(), Util::DMatrixParam< Type >::loadValue(), Util::DSymmMatrixParam< Type >::readValue(), Util::DMatrixParam< Type >::readValue(), Util::recv(), Util::DMatrixParam< Type >::saveValue(), Util::DSymmMatrixParam< Type >::saveValue(), Util::send(), Util::DMatrix< Data >::serialize(), Util::DMatrixParam< Type >::writeParam(), and Util::DSymmMatrixParam< Type >::writeParam().
|
inline |
Get number of columns (range of the second array index).
Definition at line 132 of file Matrix.h.
References Util::Matrix< Data >::capacity2_.
Referenced by Util::DMatrix< Data >::allocate(), Util::bcast(), Util::DSymmMatrixParam< Type >::bcastValue(), Util::DMatrixParam< Type >::bcastValue(), Util::DSymmMatrixParam< Type >::loadValue(), Util::DMatrixParam< Type >::loadValue(), Util::DSymmMatrixParam< Type >::readValue(), Util::DMatrixParam< Type >::readValue(), Util::recv(), Util::DMatrixParam< Type >::saveValue(), Util::DSymmMatrixParam< Type >::saveValue(), Util::send(), Util::DMatrix< Data >::serialize(), Util::DMatrixParam< Type >::writeParam(), and Util::DSymmMatrixParam< Type >::writeParam().
|
inline |
Return element (i,j) of matrix by const reference.
i | row index. |
j | column index. |
Definition at line 139 of file Matrix.h.
References Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2_, and Util::Matrix< Data >::data_.
|
inline |
Return element (i,j) of matrix by reference.
i | row index. |
j | column index. |
Definition at line 153 of file Matrix.h.
References Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2_, and Util::Matrix< Data >::data_.
|
protected |
Pointer to 1D C array of all elements.
Definition at line 73 of file Matrix.h.
Referenced by Util::DMatrix< Data >::allocate(), Util::DMatrix< Data >::deallocate(), Util::DMatrix< Data >::DMatrix(), Util::FMatrix< Data, M, N >::FMatrix(), Util::DMatrix< Data >::isAllocated(), Util::Matrix< Data >::operator()(), Util::DMatrix< Data >::operator=(), Util::DMatrix< Data >::serialize(), and Util::DMatrix< Data >::~DMatrix().
|
protected |
Number of rows (range of first index).
Definition at line 76 of file Matrix.h.
Referenced by Util::DMatrix< Data >::allocate(), Util::Matrix< Data >::capacity1(), Util::DMatrix< Data >::deallocate(), Util::DMatrix< Data >::DMatrix(), Util::FMatrix< Data, M, N >::FMatrix(), Util::Matrix< Data >::operator()(), Util::DMatrix< Data >::operator=(), Util::DMatrix< Data >::serialize(), and Util::DMatrix< Data >::~DMatrix().
|
protected |
Number of columns (range of first index).
Definition at line 79 of file Matrix.h.
Referenced by Util::DMatrix< Data >::allocate(), Util::Matrix< Data >::capacity2(), Util::DMatrix< Data >::deallocate(), Util::DMatrix< Data >::DMatrix(), Util::FMatrix< Data, M, N >::FMatrix(), Util::Matrix< Data >::operator()(), Util::DMatrix< Data >::operator=(), Util::DMatrix< Data >::serialize(), and Util::DMatrix< Data >::~DMatrix().