COPASI API  4.40.278
CStateTemplate Class Reference

#include <CState.h>

Public Member Functions

void add (const CModelEntity *entity)
 
const CModelEntity *const * beginDependent () const
 
const CModelEntity *const * beginFixed () const
 
const CModelEntity *const * beginIndependent () const
 
 CStateTemplate (CModel &model)
 
const CModelEntity *const * endDependent () const
 
const CModelEntity *const * endFixed () const
 
const CModelEntity *const * endIndependent () const
 
const CVector< const CModelEntity * > & getEntities () const
 
size_t getIndex (const CModelEntity *entity) const
 
size_t getNumDependent () const
 
size_t getNumFixed () const
 
size_t getNumIndependent () const
 
size_t getNumVariable () const
 
const CVector< size_t > & getUserOrder () const
 
void remove (const CModelEntity *entity)
 
void reorder (const CVector< CModelEntity * > &newOrder)
 
void setUserOrder (const CVector< const CModelEntity * > &userOrder)
 
const size_t & size () const
 
 ~CStateTemplate ()
 

Protected Member Functions

void resize ()
 

Private Member Functions

 CStateTemplate ()
 

Private Attributes

CVector< const CModelEntity * > mEntities
 
std::map< const CModelEntity *, size_t > mIndexMap
 
size_t mInsert
 
CModelmModel
 
const CModelEntity *const * mpBeginDependent
 
const CModelEntity *const * mpBeginFixed
 
const CModelEntity *const * mpBeginIndependent
 
const CModelEntity *const * mpEnd
 
size_t mSize
 
CVector< size_t > mUserOrder
 

Constructor & Destructor Documentation

◆ CStateTemplate() [1/2]

CStateTemplate::CStateTemplate ( )
private

Default Constructor (inaccessible)

◆ CStateTemplate() [2/2]

CStateTemplate::CStateTemplate ( CModel model)

Specific constructor

Parameters
CModel& model

◆ ~CStateTemplate()

CStateTemplate::~CStateTemplate ( )

Destructor

Member Function Documentation

◆ add()

void CStateTemplate::add ( const CModelEntity entity)

Add an entity to the template.

Parameters
constCModelEntity * entity

References mEntities, mIndexMap, mInsert, mModel, mSize, resize(), and CModel::setCompileFlag().

Referenced by CModel::addModelEntity(), and CModel::initObjects().

◆ beginDependent()

const CModelEntity *const * CStateTemplate::beginDependent ( ) const

Retrieve the array of pointers to all dependent entities, which are only dependent species for a reduced model.

Returns
CModelEntities ** dependentEntities

References mpBeginDependent.

Referenced by CMathContainer::initializeObjects().

◆ beginFixed()

const CModelEntity *const * CStateTemplate::beginFixed ( ) const

Retrieve the array of pointers to all fixed entities.

Returns
CModelEntities ** fixedEntities

References mpBeginFixed.

Referenced by CMathContainer::allocate(), and CMathContainer::initializeObjects().

◆ beginIndependent()

const CModelEntity *const * CStateTemplate::beginIndependent ( ) const

Retrieve the array of pointers to all independent entities.

Returns
CModelEntities ** independentEntities

References mpBeginIndependent.

Referenced by CCSPMethod::CSPOutput(), CModel::initializeAtolVector(), CMathContainer::initializeObjects(), CCSPMethod::initializeOutput(), CModel::isStateVariable(), CCSPMethod::printResult(), and CCSPMethod::setAnnotationM().

◆ endDependent()

const CModelEntity *const * CStateTemplate::endDependent ( ) const

Retrieve pointer just beyond the dependent entities.

Returns
CModelEntities ** endDependentEntities

References mpBeginFixed.

Referenced by CMathContainer::initializeObjects(), and CModel::isStateVariable().

◆ endFixed()

const CModelEntity *const * CStateTemplate::endFixed ( ) const

Retrieve pointer just beyond the fixed entities.

Returns
CModelEntities ** endFixedEntities

References mpEnd.

Referenced by CMathContainer::allocate(), and CMathContainer::initializeObjects().

◆ endIndependent()

const CModelEntity *const * CStateTemplate::endIndependent ( ) const

Retrieve pointer just beyond the independent entities.

Returns
CModelEntities ** endIndependentEntities

References mpBeginDependent.

Referenced by CMathContainer::initializeObjects().

◆ getEntities()

const CVector< const CModelEntity * > & CStateTemplate::getEntities ( ) const

Retrieve the array of pointers to all entities.

Returns
const CVector< const CModelEntity *> & entities

References mEntities.

Referenced by CModel::buildUserOrder(), CFixLocalReactionParameters::checkModel(), CModel::getTreesWithDiscontinuities(), and CCopasiXML::saveModel().

◆ getIndex()

size_t CStateTemplate::getIndex ( const CModelEntity entity) const

Retrieve the index of an entity in the template. Returns C_INVALID_INDEX if the entity is not found.

Parameters
constCModelEntity * entity
Returns
size_t index

References C_INVALID_INDEX, and mIndexMap.

Referenced by setUserOrder().

◆ getNumDependent()

size_t CStateTemplate::getNumDependent ( ) const

Retrieve the number of dependent entities.

Returns
size_t numDependent

References mpBeginDependent, and mpBeginFixed.

Referenced by CMathContainer::allocate().

◆ getNumFixed()

size_t CStateTemplate::getNumFixed ( ) const

Retrieve the number of fixed entities.

Returns
size_t numFixed

References mpBeginFixed, and mpEnd.

Referenced by CMathContainer::allocate().

◆ getNumIndependent()

size_t CStateTemplate::getNumIndependent ( ) const

Retrieve the number of independent entities.

Returns
size_t numIndependent

References mpBeginDependent, and mpBeginIndependent.

Referenced by CMathContainer::allocate(), CModel::buildUserOrder(), and CModel::initializeAtolVector().

◆ getNumVariable()

size_t CStateTemplate::getNumVariable ( ) const

Retrieve the number of variable entities, i.e., the sum of independent and dependent variables.

Returns
size_t numVariable

References mpBeginFixed, and mpBeginIndependent.

◆ getUserOrder()

const CVector< size_t > & CStateTemplate::getUserOrder ( ) const

Retrieve a pivot vector which can be used to reconstruct the user order.

Returns
const CVector<size_t> & userOrder

References mUserOrder.

Referenced by CModel::buildUserOrder().

◆ remove()

void CStateTemplate::remove ( const CModelEntity entity)

Remove an entity from the template.

Parameters
constCModelEntity * entity

References mEntities, mIndexMap, mModel, and CModel::setCompileFlag().

Referenced by CModel::removeModelEntity().

◆ reorder()

◆ resize()

void CStateTemplate::resize ( )
protected

Resize the template

References mEntities, mSize, and CVector< CType >::resize().

Referenced by add().

◆ setUserOrder()

void CStateTemplate::setUserOrder ( const CVector< const CModelEntity * > &  userOrder)

Set the user preferred order of the entities.

Parameters
constCVector< const CModelEntity * > & userOrder

References CVectorCore< CType >::array(), getIndex(), mUserOrder, CVector< CType >::resize(), and CVectorCore< CType >::size().

Referenced by CModel::buildUserOrder().

◆ size()

const size_t & CStateTemplate::size ( ) const

Retrieve size of the template, i.e., the number of entities.

Returns
size_t size

References mInsert.

Referenced by CFixLocalReactionParameters::checkModel(), CModel::getTreesWithDiscontinuities(), and CCopasiXML::saveModel().

Member Data Documentation

◆ mEntities

CVector< const CModelEntity * > CStateTemplate::mEntities
private

The array of entities

Referenced by add(), getEntities(), remove(), reorder(), and resize().

◆ mIndexMap

std::map< const CModelEntity *, size_t > CStateTemplate::mIndexMap
private

A map of pointer to entities to the index it appear in the template

Referenced by add(), getIndex(), remove(), and reorder().

◆ mInsert

size_t CStateTemplate::mInsert
private

The index in which the next added entity must be inserted.

Referenced by add(), reorder(), and size().

◆ mModel

CModel& CStateTemplate::mModel
private

A reference to the model

Referenced by add(), and remove().

◆ mpBeginDependent

const CModelEntity* const* CStateTemplate::mpBeginDependent
private

A pointer to the dependent entities

Referenced by beginDependent(), endIndependent(), getNumDependent(), getNumIndependent(), and reorder().

◆ mpBeginFixed

const CModelEntity* const* CStateTemplate::mpBeginFixed
private

A pointer to the fixed entities

Referenced by beginFixed(), endDependent(), getNumDependent(), getNumFixed(), getNumVariable(), and reorder().

◆ mpBeginIndependent

const CModelEntity* const* CStateTemplate::mpBeginIndependent
private

A pointer to the independent entities

Referenced by beginIndependent(), getNumIndependent(), getNumVariable(), and reorder().

◆ mpEnd

const CModelEntity* const* CStateTemplate::mpEnd
private

A pointer just beyond the entities

Referenced by endFixed(), getNumFixed(), and reorder().

◆ mSize

size_t CStateTemplate::mSize
private

The allocate size of the template

Referenced by add(), and resize().

◆ mUserOrder

CVector<size_t> CStateTemplate::mUserOrder
private

A pivot vector storing the user order of the entities

Referenced by getUserOrder(), and setUserOrder().


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