|
PSCF v1.3.3
|
Dynamically allocated Matrix. More...
#include <DMatrix.h>
Public Member Functions | |
| DMatrix () | |
| Constructor. | |
| DMatrix (DMatrix< Data > const &other) | |
| Copy constructor. | |
| DMatrix< Data > & | operator= (DMatrix< Data > const &other) |
| Assignment. | |
| ~DMatrix () | |
| Destructor. | |
| void | allocate (int capacity1, int capacity2) |
| Allocate memory for a matrix. | |
| void | deallocate () |
| Deallocate the underlying memory block. | |
| bool | isAllocated () const |
| Return true if the DMatrix has been allocated, false otherwise. | |
| template<class Archive> | |
| void | serialize (Archive &ar, const unsigned int version) |
| Serialize a DMatrix to/from an Archive. | |
| Public Member Functions inherited from Util::Matrix< Data > | |
| 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. | |
Additional Inherited Members | |
| Protected Member Functions inherited from Util::Matrix< Data > | |
| Matrix () | |
| Default constructor. | |
| Protected Attributes inherited from Util::Matrix< Data > | |
| 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). | |
Dynamically allocated Matrix.
| Util::DMatrix< Data >::DMatrix | ( | ) |
Constructor.
Definition at line 94 of file DMatrix.h.
References Util::Matrix< Data >::Matrix().
Referenced by DMatrix(), and operator=().
| Util::DMatrix< Data >::DMatrix | ( | DMatrix< Data > const & | other | ) |
Copy constructor.
Definition at line 102 of file DMatrix.h.
References allocate(), Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2_, Util::Matrix< Data >::data_, DMatrix(), and Util::Matrix< Data >::Matrix().
| Util::DMatrix< Data >::~DMatrix | ( | ) |
Destructor.
Delete dynamically allocated C array.
Definition at line 156 of file DMatrix.h.
References Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2_, Util::Matrix< Data >::data_, and Util::Memory::deallocate().
| DMatrix< Data > & Util::DMatrix< Data >::operator= | ( | DMatrix< Data > const & | other | ) |
Assignment.
| Exception | if LHS and RHS dimensions do not match. |
Definition at line 121 of file DMatrix.h.
References allocate(), Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2_, Util::Matrix< Data >::data_, DMatrix(), and UTIL_THROW.
| void Util::DMatrix< Data >::allocate | ( | int | capacity1, |
| int | capacity2 ) |
Allocate memory for a matrix.
| capacity1 | number of rows (range of first index) |
| capacity2 | number of columns (range of second index) |
Definition at line 170 of file DMatrix.h.
References Util::Memory::allocate(), Util::Matrix< Data >::capacity1(), Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2(), Util::Matrix< Data >::capacity2_, Util::Matrix< Data >::data_, and UTIL_THROW.
Referenced by Pscf::Rpc::Simulator< D >::analyzeChi(), Pscf::Rpg::Simulator< D >::analyzeChi(), DMatrix(), Pscf::PolymerSpecies::makePlan(), operator=(), Util::DSymmMatrixParam< Type >::readValue(), and serialize().
| void Util::DMatrix< Data >::deallocate | ( | ) |
Deallocate the underlying memory block.
Definition at line 188 of file DMatrix.h.
References Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2_, Util::Matrix< Data >::data_, Util::Memory::deallocate(), isAllocated(), and UTIL_THROW.
|
inline |
Return true if the DMatrix has been allocated, false otherwise.
Definition at line 202 of file DMatrix.h.
References Util::Matrix< Data >::data_.
Referenced by deallocate(), serialize(), and Pscf::Prdc::Cpu::FieldBasisConverter< D >::setBasis().
| void Util::DMatrix< Data >::serialize | ( | Archive & | ar, |
| const unsigned int | version ) |
Serialize a DMatrix to/from an Archive.
| ar | archive |
| version | archive version id |
Definition at line 210 of file DMatrix.h.
References allocate(), Util::Matrix< Data >::capacity1(), Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2(), Util::Matrix< Data >::capacity2_, Util::Matrix< Data >::data_, isAllocated(), and UTIL_THROW.