SimpleMatrix< T > Class Template Reference

A simple matrix class. More...

#include <CommonDefs.h>

List of all members.

Public Member Functions

 SimpleMatrix (unsigned int nRows, unsigned int nCols, T elements=T())
 Constructor.
std::vector< T > & operator[] (int i)
 Standard accessor.
unsigned int GetNRows ()
 Returns the number of rows.
unsigned int GetNCols ()
 Returns the number of columns.


Detailed Description

template<class T>
class SimpleMatrix< T >

A simple matrix class.

This class defines a matrix built by STL vectors. It is basically a variable-dimension vector of vectors; the dimension is defined at construction and cannot be changed in current implementation. It is intended as a container and not for algebraic manipulations. The class provides a standard access operator [].


Constructor & Destructor Documentation

template<class T>
SimpleMatrix< T >::SimpleMatrix ( unsigned int  nRows,
unsigned int  nCols,
elements = T() 
) [inline]

Constructor.

The constructor will build an nRows x nCols matrix, initialized with a default value. If T is a class with no default constructor, a default value for T must be provided, which will be replicated in every matrix element.

Parameters:
nRows The number of rows.
nCols The number of columns
elements The initialization value for the matrix elements.


Member Function Documentation

template<class T>
unsigned int SimpleMatrix< T >::GetNCols (  )  [inline]

Returns the number of columns.

Returns:
The number of columns.

template<class T>
unsigned int SimpleMatrix< T >::GetNRows (  )  [inline]

Returns the number of rows.

Returns:
The number of rows.

template<class T>
std::vector<T>& SimpleMatrix< T >::operator[] ( int  i  )  [inline]

Standard accessor.

Parameters:
i The desired row.
Returns:
The i-th row (a vector).


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

Generated on Fri Jun 5 15:09:04 2009 for PamCut by  doxygen 1.5.9