COPASI API  4.16.103
Public Member Functions | Private Attributes | List of all members
CCopasiMatrixInterface< CMatrixType > Class Template Reference

#include <CFitProblem.h>

Inheritance diagram for CCopasiMatrixInterface< CMatrixType >:
Inheritance graph
[legend]
Collaboration diagram for CCopasiMatrixInterface< CMatrixType >:
Collaboration graph
[legend]

Public Member Functions

 CCopasiMatrixInterface (MatrixType *matrix)
 
size_t dimensionality () const
 
data_typeoperator[] (const index_type &index)
 
const data_typeoperator[] (const index_type &index) const
 
const index_typesize () const
 
virtual ~CCopasiMatrixInterface ()
 
- Public Member Functions inherited from CCopasiAbstractArray
virtual ~CCopasiAbstractArray ()
 

Private Attributes

MatrixType * mMatrix
 
std::vector< size_t > mSizes
 

Additional Inherited Members

- Public Types inherited from CCopasiAbstractArray
typedef C_FLOAT64 data_type
 
typedef std::vector< size_t > index_type
 

Detailed Description

template<class CMatrixType>
class CCopasiMatrixInterface< CMatrixType >

this class provides an interface to a CMatrix<C_FLOAT64> or a CLinkMatrixView, that is to every 2-dimensional class that has numRows(), numCols(), and operator()(row, col)

Definition at line 27 of file CFitProblem.h.

Constructor & Destructor Documentation

template<class CMatrixType>
CCopasiMatrixInterface< CMatrixType >::CCopasiMatrixInterface ( MatrixType *  matrix)
inline

Definition at line 93 of file CCopasiArray.h.

94  : mMatrix(matrix)
95  {
96  assert(mMatrix);
97  mSizes.resize(2);
98  mSizes[0] = mMatrix->numRows();
99  mSizes[1] = mMatrix->numCols();
100  }
std::vector< size_t > mSizes
Definition: CCopasiArray.h:124
template<class CMatrixType>
virtual CCopasiMatrixInterface< CMatrixType >::~CCopasiMatrixInterface ( )
inlinevirtual

Definition at line 101 of file CCopasiArray.h.

101 {};

Member Function Documentation

template<class CMatrixType>
size_t CCopasiMatrixInterface< CMatrixType >::dimensionality ( ) const
inlinevirtual

Implements CCopasiAbstractArray.

Definition at line 137 of file CCopasiArray.h.

138  {return 2;}
template<class CMatrixType>
data_type& CCopasiMatrixInterface< CMatrixType >::operator[] ( const index_type index)
inlinevirtual

Implements CCopasiAbstractArray.

Definition at line 105 of file CCopasiArray.h.

106  {
107 #ifdef COPASI_DEBUG
108  assert(index.size() == 2);
109 #endif
110  return (*mMatrix)(index[0], index[1]);
111  }
template<class CMatrixType>
const data_type& CCopasiMatrixInterface< CMatrixType >::operator[] ( const index_type index) const
inlinevirtual

Implements CCopasiAbstractArray.

Definition at line 113 of file CCopasiArray.h.

114  {
115 #ifdef COPASI_DEBUG
116  assert(index.size() == 2);
117 #endif
118  return (*mMatrix)(index[0], index[1]);
119  }
template<class CMatrixType>
const index_type& CCopasiMatrixInterface< CMatrixType >::size ( ) const
inlinevirtual

Implements CCopasiAbstractArray.

Definition at line 129 of file CCopasiArray.h.

130  {
131  CCopasiMatrixInterface * tmp = const_cast<CCopasiMatrixInterface*>(this);
132  tmp->mSizes[0] = mMatrix->numRows();
133  tmp->mSizes[1] = mMatrix->numCols();
134  return mSizes;
135  }
std::vector< size_t > mSizes
Definition: CCopasiArray.h:124

Member Data Documentation

template<class CMatrixType>
MatrixType* CCopasiMatrixInterface< CMatrixType >::mMatrix
private
template<class CMatrixType>
std::vector<size_t> CCopasiMatrixInterface< CMatrixType >::mSizes
private

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