|
PSCF v1.3.3
|
Two-dimensional array container template (abstract). More...
#include <Matrix.h>
Public Member Functions | |
| virtual | ~Matrix () |
| Destructor. | |
| int | capacity1 () const |
| Get number of rows (range of the first array index). | |
| int | capacity2 () const |
| Get number of columns (range of the second array index). | |
| Data const & | operator() (int i, int j) const |
| Return element (i,j) of matrix by const reference. | |
| Data & | operator() (int i, int j) |
| Return element (i,j) of matrix by reference. | |
| Data * | cArray () |
| Return pointer to underlying one-dimensional C array. | |
| Data const * | cArray () const |
| Return pointer to const to underlying one-dimensional C array. | |
Protected Member Functions | |
| Matrix () | |
| Default constructor. | |
Protected Attributes | |
| Data * | data_ |
| Pointer to 1D C array of all elements. | |
| int | capacity1_ |
| Number of rows (range of first index). | |
| int | capacity2_ |
| Number of columns (range of first index). | |
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 in column j of row i.
The memory for a Matrix is stored in a single one-dimensional C array, in which each row is stored as a consecutive block.
Class Matrix is an abstract class because it cannot allocate memory. Concrete subclasses include DMatrix and FMatrix.
|
virtual |
|
inlineprotected |
Default constructor.
Constructor (protected).
Protected to prevent direct instantiation.
Definition at line 119 of file Matrix.h.
References capacity1_, capacity2_, and data_.
Referenced by Util::DMatrix< Data >::DMatrix(), Util::DMatrix< Data >::DMatrix(), Util::FMatrix< Data, M, N >::FMatrix(), and Util::FMatrix< Data, M, N >::FMatrix().
|
inline |
Get number of rows (range of the first array index).
Definition at line 136 of file Matrix.h.
References capacity1_.
Referenced by Util::DMatrix< Data >::allocate(), Pscf::LuSolver::computeLU(), Pscf::Prdc::FieldIoTmpl< D, RFT, KFT, FFT >::estimateWBasis(), Pscf::Prdc::FieldIoTmpl< D, RFT, KFT, FFT >::estimateWBasis(), Util::DMatrix< Data >::serialize(), and Pscf::Prdc::Cpu::FieldBasisConverter< D >::setBasis().
|
inline |
Get number of columns (range of the second array index).
Definition at line 143 of file Matrix.h.
References capacity2_.
Referenced by Util::DMatrix< Data >::allocate(), Pscf::LuSolver::computeLU(), Pscf::Prdc::FieldIoTmpl< D, RFT, KFT, FFT >::estimateWBasis(), Pscf::Prdc::FieldIoTmpl< D, RFT, KFT, FFT >::estimateWBasis(), Util::DMatrix< Data >::serialize(), and Pscf::Prdc::Cpu::FieldBasisConverter< D >::setBasis().
|
inline |
Return element (i,j) of matrix by const reference.
| i | row index. |
| j | column index. |
Definition at line 150 of file Matrix.h.
References capacity1_, capacity2_, and data_.
|
inline |
Return element (i,j) of matrix by reference.
| i | row index. |
| j | column index. |
Definition at line 164 of file Matrix.h.
References capacity1_, capacity2_, and data_.
|
inline |
Return pointer to underlying one-dimensional C array.
Definition at line 178 of file Matrix.h.
References data_.
Referenced by Pscf::LuSolver::inverse().
|
inline |
|
protected |
Pointer to 1D C array of all elements.
Definition at line 84 of file Matrix.h.
Referenced by Util::DMatrix< Data >::allocate(), cArray(), cArray(), Util::DMatrix< Data >::deallocate(), Util::DMatrix< Data >::DMatrix(), Util::FMatrix< Data, M, N >::FMatrix(), Util::FMatrix< Data, M, N >::FMatrix(), Util::DMatrix< Data >::isAllocated(), Matrix(), operator()(), 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 87 of file Matrix.h.
Referenced by Util::DMatrix< Data >::allocate(), capacity1(), Util::DMatrix< Data >::deallocate(), Util::DMatrix< Data >::DMatrix(), Util::FMatrix< Data, M, N >::FMatrix(), Util::FMatrix< Data, M, N >::FMatrix(), Matrix(), operator()(), 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 90 of file Matrix.h.
Referenced by Util::DMatrix< Data >::allocate(), capacity2(), Util::DMatrix< Data >::deallocate(), Util::DMatrix< Data >::DMatrix(), Util::FMatrix< Data, M, N >::FMatrix(), Util::FMatrix< Data, M, N >::FMatrix(), Matrix(), operator()(), operator()(), Util::DMatrix< Data >::operator=(), Util::DMatrix< Data >::serialize(), and Util::DMatrix< Data >::~DMatrix().