copasi API  0.1
Public Types | Public Member Functions | Protected Attributes | Friends
CMatrix< CType > Class Template Reference

#include <CMatrix.h>

List of all members.

Public Types

typedef CType elementType

Public Member Functions

 CMatrix (unsigned C_INT32 rows=0, unsigned C_INT32 cols=0)
 CMatrix (const CMatrix< CType > &src)
virtual ~CMatrix ()
virtual unsigned C_INT32 size () const
virtual unsigned C_INT32 numRows () const
virtual unsigned C_INT32 numCols () const
virtual void resize (unsigned C_INT32 rows, unsigned C_INT32 cols)
virtual CMatrix< CType > & operator= (const CMatrix< CType > &rhs)
virtual CMatrix< CType > & operator= (const CType &value)
virtual CType * operator[] (unsigned C_INT32 row)
virtual const CType * operator[] (unsigned C_INT32 row) const
virtual elementTypeoperator() (const unsigned C_INT32 &row, const unsigned C_INT32 &col)
virtual const elementTypeoperator() (const unsigned C_INT32 &row, const unsigned C_INT32 &col) const
virtual CType * array ()
virtual const CType * array () const
bool applyPivot (const CVector< unsigned C_INT32 > &pivot)

Protected Attributes

unsigned C_INT32 mRows
unsigned C_INT32 mCols
CType * mArray

Friends

std::ostream & operator<< (std::ostream &os, const CMatrix< CType > &A)

Detailed Description

template<class CType>
class CMatrix< CType >

Template class CMatrix < class CType > This template class is a simple matrix class allowing standard C-style and fortran style access to the elements. It also supplies an ostream operator.


Member Typedef Documentation

template<class CType>
typedef CType CMatrix< CType >::elementType

Constructor & Destructor Documentation

template<class CType>
CMatrix< CType >::CMatrix ( unsigned C_INT32  rows = 0,
unsigned C_INT32  cols = 0 
) [inline]

Default constructor

Parameters:
unsignedC_INT32 rows (default = 0)
unsignedC_INT32 cols (default = 0)
template<class CType>
CMatrix< CType >::CMatrix ( const CMatrix< CType > &  src) [inline]

Copy constructor

Parameters:
constCMatrix <CType> & src
template<class CType>
virtual CMatrix< CType >::~CMatrix ( ) [inline, virtual]

Destructor.


Member Function Documentation

template<class CType>
bool CMatrix< CType >::applyPivot ( const CVector< unsigned C_INT32 > &  pivot) [inline]

Reorder the rows according to the provided pivots

Parameters:
constCVector<unsigned C_INT32> & pivot
Returns:
bool success
template<class CType>
virtual CType* CMatrix< CType >::array ( ) [inline, virtual]

Retrieve the array of the matrix elements. This is suitable for interfacing with clapack routines.

Returns:
CType * array
template<class CType>
virtual const CType* CMatrix< CType >::array ( ) const [inline, virtual]

Retrieve the array of the matrix elements. This is suitable for interfacing with clapack routines.

Returns:
const CType * array
template<class CType>
virtual unsigned C_INT32 CMatrix< CType >::numCols ( ) const [inline, virtual]

The number of columns of the matrix

Returns:
unsigned C_INT32 cols
template<class CType>
virtual unsigned C_INT32 CMatrix< CType >::numRows ( ) const [inline, virtual]

The number of rows of the matrix.

Returns:
unsigned C_INT32 rows
template<class CType>
virtual elementType& CMatrix< CType >::operator() ( const unsigned C_INT32 &  row,
const unsigned C_INT32 &  col 
) [inline, virtual]

Retrieve a matrix element using c-style indexing.

Parameters:
constunsigned C_INT32 & row
constunsigned C_INT32 & col
Returns:
const elementType & element
template<class CType>
virtual const elementType& CMatrix< CType >::operator() ( const unsigned C_INT32 &  row,
const unsigned C_INT32 &  col 
) const [inline, virtual]

Retrieve a matrix element using c-style indexing.

Parameters:
constunsigned C_INT32 & row
constunsigned C_INT32 & col
Returns:
const elementType & element
template<class CType>
virtual CMatrix<CType>& CMatrix< CType >::operator= ( const CMatrix< CType > &  rhs) [inline, virtual]

Assignement operator

Parameters:
constCMatrix <CType> & rhs
Returns:
CMatrix <CType> & lhs
template<class CType>
virtual CMatrix<CType>& CMatrix< CType >::operator= ( const CType &  value) [inline, virtual]

Assignement operator

Parameters:
constCType & value
Returns:
CMatrix <CType> & lhs
template<class CType>
virtual CType* CMatrix< CType >::operator[] ( unsigned C_INT32  row) [inline, virtual]

Retrieve a row of the matrix using c-style indexing

Parameters:
unsignedC_INT32 row
Returns:
CType * row
template<class CType>
virtual const CType* CMatrix< CType >::operator[] ( unsigned C_INT32  row) const [inline, virtual]

Retrieve a row of the matrix using c-style indexing

Parameters:
unsignedC_INT32 row
Returns:
const CType * row
template<class CType>
virtual void CMatrix< CType >::resize ( unsigned C_INT32  rows,
unsigned C_INT32  cols 
) [inline, virtual]

Resize the matrix. The previous content is lost

Parameters:
unsignedC_INT32 rows
unsignedC_INT32 cols
template<class CType>
virtual unsigned C_INT32 CMatrix< CType >::size ( ) const [inline, virtual]

The number of elements stored in the matrix.

Returns:
unsigned C_INT32 size

Friends And Related Function Documentation

template<class CType>
std::ostream& operator<< ( std::ostream &  os,
const CMatrix< CType > &  A 
) [friend]

Output stream operator

Parameters:
ostream& os
constCMatrix< CType > & A
Returns:
ostream & os

Member Data Documentation

template<class CType>
CType* CMatrix< CType >::mArray [protected]

The array storing the matrix elements

template<class CType>
unsigned C_INT32 CMatrix< CType >::mCols [protected]

Number of columns in the matrix

template<class CType>
unsigned C_INT32 CMatrix< CType >::mRows [protected]

Number of rows in the matrix.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines