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

#include <CCopasiArray.h>

Inheritance diagram for CCopasiVectorInterface< VectorType >:
Inheritance graph
[legend]
Collaboration diagram for CCopasiVectorInterface< VectorType >:
Collaboration graph
[legend]

Public Member Functions

 CCopasiVectorInterface (VectorType *vector)
 
size_t dimensionality () const
 
data_typeoperator[] (const index_type &index)
 
const data_typeoperator[] (const index_type &index) const
 
const index_typesize () const
 
virtual ~CCopasiVectorInterface ()
 
- Public Member Functions inherited from CCopasiAbstractArray
virtual ~CCopasiAbstractArray ()
 

Private Attributes

std::vector< size_t > mSizes
 
VectorType * mVector
 

Additional Inherited Members

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

Detailed Description

template<class VectorType>
class CCopasiVectorInterface< VectorType >

this class provides an interface to a CVector<C_FLOAT64>, or indeed to any container class that has a size() method and a [] operator that returns C_FLOAT64.

Definition at line 148 of file CCopasiArray.h.

Constructor & Destructor Documentation

template<class VectorType >
CCopasiVectorInterface< VectorType >::CCopasiVectorInterface ( VectorType *  vector)
inline

Definition at line 152 of file CCopasiArray.h.

References CCopasiVectorInterface< VectorType >::mSizes, and CCopasiVectorInterface< VectorType >::mVector.

153  : mVector(vector)
154  {
155  assert(mVector);
156  mSizes.resize(1);
157  mSizes[0] = mVector->size();
158  }
std::vector< size_t > mSizes
Definition: CCopasiArray.h:179
template<class VectorType >
virtual CCopasiVectorInterface< VectorType >::~CCopasiVectorInterface ( )
inlinevirtual

Definition at line 159 of file CCopasiArray.h.

159 {};

Member Function Documentation

template<class VectorType >
size_t CCopasiVectorInterface< VectorType >::dimensionality ( ) const
inlinevirtual

Implements CCopasiAbstractArray.

Definition at line 190 of file CCopasiArray.h.

191  {return 1;}
template<class VectorType >
data_type& CCopasiVectorInterface< VectorType >::operator[] ( const index_type index)
inlinevirtual

Implements CCopasiAbstractArray.

Definition at line 161 of file CCopasiArray.h.

References CCopasiVectorInterface< VectorType >::mVector.

162  {
163 #ifdef COPASI_DEBUG
164  assert(index.size() == 1);
165 #endif
166  return (*mVector)[index[0]];
167  }
template<class VectorType >
const data_type& CCopasiVectorInterface< VectorType >::operator[] ( const index_type index) const
inlinevirtual

Implements CCopasiAbstractArray.

Definition at line 169 of file CCopasiArray.h.

References CCopasiVectorInterface< VectorType >::mVector.

170  {
171 #ifdef COPASI_DEBUG
172  assert(index.size() == 1);
173 #endif
174  return (*mVector)[index[0]];
175  }
template<class VectorType >
const index_type& CCopasiVectorInterface< VectorType >::size ( ) const
inlinevirtual

Implements CCopasiAbstractArray.

Definition at line 182 of file CCopasiArray.h.

References CCopasiVectorInterface< VectorType >::mSizes, and CCopasiVectorInterface< VectorType >::mVector.

183  {
184  //CCopasiMatrixInterface * tmp = const_cast<CCopasiMatrixInterface*>(this);
185  /*tmp->*/
186  mSizes[0] = mVector->size();
187  return mSizes;
188  }
std::vector< size_t > mSizes
Definition: CCopasiArray.h:179

Member Data Documentation

template<class VectorType >
std::vector<size_t> CCopasiVectorInterface< VectorType >::mSizes
mutableprivate
template<class VectorType >
VectorType* CCopasiVectorInterface< VectorType >::mVector
private

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