PSCF v1.1
Public Member Functions | List of all members
Util::DMatrix< Data > Class Template Reference

Dynamically allocated Matrix. More...

#include <DMatrix.h>

Inheritance diagram for Util::DMatrix< Data >:
Util::Matrix< Data >

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...
 
- Public Member Functions inherited from Util::Matrix< Data >
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

- Protected Member Functions inherited from Util::Matrix< Data >
 Matrix ()
 Default constructor. More...
 
- Protected Attributes inherited from Util::Matrix< Data >
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...
 

Detailed Description

template<typename Data>
class Util::DMatrix< Data >

Dynamically allocated Matrix.

Definition at line 24 of file DMatrix.h.

Constructor & Destructor Documentation

◆ DMatrix() [1/2]

template<typename Data >
Util::DMatrix< Data >::DMatrix

Constructor.

Definition at line 94 of file DMatrix.h.

◆ DMatrix() [2/2]

template<typename Data >
Util::DMatrix< Data >::DMatrix ( DMatrix< Data > const &  other)

◆ ~DMatrix()

template<typename Data >
Util::DMatrix< Data >::~DMatrix

Destructor.

Delete dynamically allocated C array.

Definition at line 156 of file DMatrix.h.

Member Function Documentation

◆ operator=()

template<typename Data >
DMatrix< Data > & Util::DMatrix< Data >::operator= ( DMatrix< Data > const &  other)

Assignment.

Exceptions
Exceptionif 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.

◆ allocate()

template<typename Data >
void Util::DMatrix< Data >::allocate ( int  capacity1,
int  capacity2 
)

Allocate memory for a matrix.

Parameters
capacity1number of rows (range of first index)
capacity2number 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().

◆ deallocate()

template<class Data >
void Util::DMatrix< Data >::deallocate

Deallocate the underlying memory block.

Exceptions
Exceptionif the DMatrix is not allocated.

Definition at line 188 of file DMatrix.h.

References UTIL_THROW.

◆ isAllocated()

template<class Data >
bool Util::DMatrix< Data >::isAllocated
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().

◆ serialize()

template<class Data >
template<class Archive >
void Util::DMatrix< Data >::serialize ( Archive &  ar,
const unsigned int  version 
)

Serialize a DMatrix to/from an Archive.

Parameters
ararchive
versionarchive version id

Definition at line 210 of file DMatrix.h.

References UTIL_THROW.


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