PSCF v1.1
|
Dynamically allocated Matrix. More...
#include <DMatrix.h>
Public Member Functions | |
DMatrix () | |
Constructor. More... | |
DMatrix (DMatrix< Data > const &other) | |
Copy constructor. More... | |
DMatrix< Data > & | operator= (DMatrix< Data > const &other) |
Assignment. More... | |
~DMatrix () | |
Destructor. More... | |
void | allocate (int capacity1, int capacity2) |
Allocate memory for a matrix. More... | |
void | deallocate () |
Deallocate the underlying memory block. More... | |
bool | isAllocated () const |
Return true if the DMatrix has been allocated, false otherwise. More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize a DMatrix to/from an Archive. More... | |
![]() | |
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... | |
Data const & | 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... | |
Data * | cArray () |
Return pointer to underlying one-dimensional C array. More... | |
Data const * | cArray () const |
Return pointer to const to underlying one-dimensional C array. More... | |
Additional Inherited Members | |
![]() | |
Matrix () | |
Default constructor. More... | |
![]() | |
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... | |
Dynamically allocated Matrix.
Util::DMatrix< Data >::DMatrix |
Util::DMatrix< Data >::DMatrix | ( | DMatrix< Data > const & | other | ) |
Copy constructor.
Definition at line 102 of file DMatrix.h.
References Util::DMatrix< Data >::allocate(), Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2_, Util::Matrix< Data >::data_, and UTIL_THROW.
Util::DMatrix< Data >::~DMatrix |
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 Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2_, Util::Matrix< Data >::data_, 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_THROW.
Referenced by Pscf::Homogeneous::Mixture::computePhi(), Util::DMatrix< Data >::DMatrix(), Pscf::PolymerTmpl< Block >::makePlan(), Util::DSymmMatrixParam< Type >::readValue(), Pscf::Interaction::setNMonomer(), and Pscf::AmbdInteraction::setNMonomer().
void Util::DMatrix< Data >::deallocate |
Deallocate the underlying memory block.
Definition at line 188 of file DMatrix.h.
References UTIL_THROW.
|
inline |
Return true if the DMatrix has been allocated, false otherwise.
Definition at line 202 of file DMatrix.h.
Referenced by Util::bcast(), Util::recv(), and Util::send().
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 UTIL_THROW.