Simpatico  v1.10
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
Util::Matrix< Data > Class Template Reference

Detailed Description

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

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.

Definition at line 30 of file Matrix.h.

#include <Matrix.h>

Inheritance diagram for Util::Matrix< Data >:
Util::FMatrix< Util::GPArray< DdMd::Atom >, Dimension, 2 > Util::DMatrix< Data > Util::FMatrix< Data, M, N >

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

Constructor & Destructor Documentation

template<typename Data >
Util::Matrix< Data >::~Matrix ( )
virtual

Destructor.

Definition at line 118 of file Matrix.h.

template<typename Data >
Util::Matrix< Data >::Matrix ( )
inlineprotected

Default constructor.

Constructor (protected).

Protected to prevent direct instantiation.

Definition at line 108 of file Matrix.h.

Member Function Documentation

template<typename Data >
int Util::Matrix< Data >::capacity1 ( ) const
inline
template<typename Data >
int Util::Matrix< Data >::capacity2 ( ) const
inline
template<typename Data >
const Data & Util::Matrix< Data >::operator() ( int  i,
int  j 
) const
inline

Return element (i,j) of matrix by const reference.

Parameters
irow index.
jcolumn index.

Definition at line 139 of file Matrix.h.

References Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2_, and Util::Matrix< Data >::data_.

template<typename Data >
Data & Util::Matrix< Data >::operator() ( int  i,
int  j 
)
inline

Return element (i,j) of matrix by reference.

Parameters
irow index.
jcolumn index.

Definition at line 153 of file Matrix.h.

References Util::Matrix< Data >::capacity1_, Util::Matrix< Data >::capacity2_, and Util::Matrix< Data >::data_.

Member Data Documentation

template<typename Data>
Data* Util::Matrix< Data >::data_
protected
template<typename Data>
int Util::Matrix< Data >::capacity1_
protected
template<typename Data>
int Util::Matrix< Data >::capacity2_
protected

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