COPASI API  4.40.278
CMathObject Class Reference

#include <CMathObject.h>

Inheritance diagram for CMathObject:
[legend]

Public Types

typedef void(CMathObject::* calculate) ()
 
- Public Types inherited from CObjectInterface
typedef std::vector< const CDataContainer * > ContainerList
 
typedef std::set< const CObjectInterface * > ObjectSet
 

Public Member Functions

void appendDelays (CMath::DelayData &Delays) const
 
virtual void calculateValue () override
 
bool canCalculateValue () const
 
 CMathObject ()
 
 CMathObject (const CMathObject &src)
 
bool compile (CMathContainer &container)
 
void copy (const CMathObject &src, CMathContainer &container)
 
virtual CCommonName getCN () const override
 
const C_FLOAT64getCompartmentValue () const
 
const CMathObjectgetCorrespondingProperty () const
 
virtual const CDataObjectgetDataObject () const override
 
const CMath::EntityTypegetEntityType () const
 
const CMathExpressiongetExpressionPtr () const
 
virtual const CObjectInterfacegetObject (const CCommonName &cn) const override
 
virtual std::string getObjectDisplayName () const override
 
virtual const CObjectInterface::ObjectSetgetPrerequisites () const override
 
const CMath::SimulationTypegetSimulationType () const
 
virtual const CValiditygetValidity () const override
 
const C_FLOAT64getValue () const
 
virtual void * getValuePointer () const override
 
const CMath::ValueTypegetValueType () const
 
const bool & isInitialValue () const
 
const bool & isIntensiveProperty () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override
 
virtual void print (std::ostream *ostream) const override
 
void relocate (CMathContainer *pContainer, const std::vector< CMath::sRelocate > &relocations)
 
void setDataObject (const CDataObject *pDataObject)
 
bool setExpression (const CExpression &expression, CMathContainer &container)
 
bool setExpression (const std::string &infix, const bool &isBoolean, CMathContainer &container)
 
bool setExpressionPtr (CMathExpression *pMathExpression)
 
void setSimulationType (const CMath::SimulationType &simulationType)
 
void setValueType (const CMath::ValueType &valueType)
 
void validityChanged (const CValidity &changedValidity) override
 
virtual ~CMathObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
 CObjectInterface (const CObjectInterface &src)
 
virtual ~CObjectInterface ()
 

Static Public Member Functions

static void initialize (CMathObject *pObject, C_FLOAT64 *pValue, const CMath::ValueType &valueType, const CMath::EntityType &entityType, const CMath::SimulationType &simulationType, const bool &isIntensiveProperty, const bool &isInitialValue, const CDataObject *pDataObject)
 
- Static Public Member Functions inherited from CObjectInterface
static const CDataObjectDataObject (const CObjectInterface *pInterface)
 
static CObjectInterfaceGetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName)
 

Private Member Functions

void calculateCorrectedPropensity ()
 
void calculateExpression ()
 
void calculateExtensiveReactionRate ()
 
void calculateExtensiveValue ()
 
void calculateIntensiveValue ()
 
void calculateParticleFlux ()
 
void calculatePropensity ()
 
void calculateTransitionTime ()
 
bool compileDependentMass (CMathContainer &container)
 
void compileExpression ()
 
bool compileFlux (CMathContainer &container)
 
bool compileInitialValue (CMathContainer &container)
 
bool compileNoise (CMathContainer &container)
 
bool compileParticleFlux (CMathContainer &container)
 
bool compilePropensity (CMathContainer &container)
 
bool compileRate (CMathContainer &container)
 
bool compileReactionNoise (CMathContainer &container)
 
bool compileReactionParticleNoise (CMathContainer &container)
 
bool compileTotalMass (CMathContainer &container)
 
bool compileTransitionTime (CMathContainer &container)
 
bool compileValue (CMathContainer &container)
 
bool createConvertedExpression (const CExpression *pExpression, CMathContainer &container)
 
bool createExtensiveNoiseExpression (const CMetab *pSpecies, CMathContainer &container)
 
bool createExtensiveODERateExpression (const CMetab *pSpecies, CMathContainer &container)
 
bool createExtensiveReactionNoiseExpression (const CMetab *pSpecies, CMathContainer &container)
 
bool createExtensiveReactionRateExpression (const CMetab *pSpecies, CMathContainer &container)
 
bool createExtensiveValueExpression (const CMetab *pSpecies, CMathContainer &container)
 
bool createIntensiveNoiseExpression (const CMetab *pSpecies, CMathContainer &container)
 
bool createIntensiveRateExpression (const CMetab *pSpecies, CMathContainer &container)
 
bool createIntensiveValueExpression (const CMetab *pSpecies, CMathContainer &container)
 

Private Attributes

CMath::EntityType mEntityType
 
bool mIsInitialValue
 
bool mIsIntensiveProperty
 
calculate mpCalculate
 
const C_FLOAT64mpCompartmentValue
 
const CMathObjectmpCorrespondingProperty
 
const C_FLOAT64mpCorrespondingPropertyValue
 
const CDataObjectmpDataObject
 
CMathExpressionmpExpression
 
const C_FLOAT64mpQuantity2NumberValue
 
CObjectInterface::ObjectSet mPrerequisites
 
C_FLOAT64mpValue
 
CVector< const C_FLOAT64 * > mRateVector
 
CMath::SimulationType mSimulationType
 
CVector< C_FLOAT64mStoichiometryVector
 
CMath::ValueType mValueType
 

Static Private Attributes

static C_FLOAT64 InvalidValue = std::numeric_limits< C_FLOAT64 >::quiet_NaN()
 

Friends

std::ostream & operator<< (std::ostream &os, const CMathObject &o)
 

Additional Inherited Members

- Protected Attributes inherited from CObjectInterface
CValidity mValidity
 

Member Typedef Documentation

◆ calculate

typedef void(CMathObject::* CMathObject::calculate) ()

Constructor & Destructor Documentation

◆ CMathObject() [1/2]

CMathObject::CMathObject ( )

Default Constructor

◆ CMathObject() [2/2]

CMathObject::CMathObject ( const CMathObject src)

Copy constructor

◆ ~CMathObject()

CMathObject::~CMathObject ( )
virtual

Destructor

References mpExpression, and pdelete.

Member Function Documentation

◆ appendDelays()

void CMathObject::appendDelays ( CMath::DelayData Delays) const

Retrieve the number of delays involved in calculating the expression

Parameters
CMath::DelayData& Delays

References CEvaluationNode::buildInfix(), CEvaluationNode::DELAY, CEvaluationTree::getNodeList(), CCopasiNode< _Data >::getSibling(), and mpExpression.

Referenced by CMathContainer::createDelays().

◆ calculateCorrectedPropensity()

void CMathObject::calculateCorrectedPropensity ( )
private

◆ calculateExpression()

void CMathObject::calculateExpression ( )
private

◆ calculateExtensiveReactionRate()

◆ calculateExtensiveValue()

void CMathObject::calculateExtensiveValue ( )
private

◆ calculateIntensiveValue()

void CMathObject::calculateIntensiveValue ( )
private

◆ calculateParticleFlux()

void CMathObject::calculateParticleFlux ( )
private

◆ calculatePropensity()

void CMathObject::calculatePropensity ( )
private

References max, mpCorrespondingPropertyValue, and mpValue.

Referenced by compilePropensity().

◆ calculateTransitionTime()

void CMathObject::calculateTransitionTime ( )
private

◆ calculateValue()

◆ canCalculateValue()

bool CMathObject::canCalculateValue ( ) const

Check whether the object can calculate its value

References mpCalculate.

Referenced by CMathDependencyNode::buildUpdateSequence().

◆ compile()

◆ compileDependentMass()

◆ compileExpression()

◆ compileFlux()

◆ compileInitialValue()

◆ compileNoise()

◆ compileParticleFlux()

◆ compilePropensity()

◆ compileRate()

◆ compileReactionNoise()

◆ compileReactionParticleNoise()

bool CMathObject::compileReactionParticleNoise ( CMathContainer container)
private

◆ compileTotalMass()

◆ compileTransitionTime()

◆ compileValue()

◆ copy()

void CMathObject::copy ( const CMathObject src,
CMathContainer container 
)

Copy an existing object

Parameters
constCMathObject & src
CMathContainer& container

References CMathExpression::copy(), and mpExpression.

◆ createConvertedExpression()

bool CMathObject::createConvertedExpression ( const CExpression pExpression,
CMathContainer container 
)
private

◆ createExtensiveNoiseExpression()

bool CMathObject::createExtensiveNoiseExpression ( const CMetab pSpecies,
CMathContainer container 
)
private

Create and compile an expression for an extensive noise of a species determined by ODEs

Parameters
constCMetab * pSpecies
CMathContainer& container
Returns
bool success

References CExpression::compile(), compileExpression(), CModelEntity::getNoiseExpression(), CModelEntity::hasNoise(), InvalidValue, mIsInitialValue, mpCompartmentValue, mpExpression, mpQuantity2NumberValue, mPrerequisites, mpValue, pdelete, pointerToString(), and CExpression::setInfix().

Referenced by compileNoise().

◆ createExtensiveODERateExpression()

bool CMathObject::createExtensiveODERateExpression ( const CMetab pSpecies,
CMathContainer container 
)
private

Create and compile an expression for an extensive rate of a species determined by an ODE.

Parameters
constCMetab * pSpecies
CMathContainer& container
Returns
bool success

References CExpression::compile(), compileExpression(), CModelEntity::getExpression(), mIsInitialValue, mpCompartmentValue, mpExpression, mpQuantity2NumberValue, pdelete, pointerToString(), and CExpression::setInfix().

Referenced by compileRate().

◆ createExtensiveReactionNoiseExpression()

bool CMathObject::createExtensiveReactionNoiseExpression ( const CMetab pSpecies,
CMathContainer container 
)
private

◆ createExtensiveReactionRateExpression()

bool CMathObject::createExtensiveReactionRateExpression ( const CMetab pSpecies,
CMathContainer container 
)
private

◆ createExtensiveValueExpression()

◆ createIntensiveNoiseExpression()

bool CMathObject::createIntensiveNoiseExpression ( const CMetab pSpecies,
CMathContainer container 
)
private

Create and compile an expression for the intensive noise of a species

Parameters
constCMetab * pSpecies
CMathContainer& container
Returns
bool success

References compileExpression(), CModelEntity::getNoiseExpressionPtr(), CModelEntity::hasNoise(), InvalidValue, mIsInitialValue, mpExpression, mPrerequisites, mpValue, and pdelete.

Referenced by compileNoise().

◆ createIntensiveRateExpression()

bool CMathObject::createIntensiveRateExpression ( const CMetab pSpecies,
CMathContainer container 
)
private

◆ createIntensiveValueExpression()

bool CMathObject::createIntensiveValueExpression ( const CMetab pSpecies,
CMathContainer container 
)
private

Create and compile an expression for an intensive value of a species.

Parameters
constCMetab * pSpecies
CMathContainer& container
Returns
bool success

References calculateIntensiveValue(), CMathExpression::compile(), compileExpression(), mpCalculate, mpCompartmentValue, mpCorrespondingPropertyValue, mpExpression, mpQuantity2NumberValue, pointerToString(), and CEvaluationTree::setInfix().

Referenced by compileInitialValue(), and compileValue().

◆ getCN()

CCommonName CMathObject::getCN ( ) const
overridevirtual

Retrieve the CN of the object

Returns
CCommonName

Implements CObjectInterface.

References CDataObject::getCN(), and mpDataObject.

Referenced by calculateValue(), and CAnalyticsTask::createEvent().

◆ getCompartmentValue()

const C_FLOAT64 * CMathObject::getCompartmentValue ( ) const

Retrieve the compartment value

Returns
const CMathObject * compartment

References mpCompartmentValue.

Referenced by CMathContainer::createValueChangeProhibited().

◆ getCorrespondingProperty()

const CMathObject * CMathObject::getCorrespondingProperty ( ) const

◆ getDataObject()

◆ getEntityType()

◆ getExpressionPtr()

const CMathExpression * CMathObject::getExpressionPtr ( ) const

Retrieve a pointer to the math expression.

Returns
const CMathExpression * pExpression

References mpExpression.

Referenced by CMathContainer::analyzeRoots(), CModelParameterGroup::getObjectUnit(), and CMathDerive::initOneVar().

◆ getObject()

const CObjectInterface * CMathObject::getObject ( const CCommonName cn) const
overridevirtual

Retrieve a descendant object by its CN.

Parameters
constCCommonName & cn
Returns
const CObjectInterface * pObject

Implements CObjectInterface.

References CDataObject::getObject(), and mpDataObject.

◆ getObjectDisplayName()

std::string CMathObject::getObjectDisplayName ( ) const
overridevirtual

Retrieve the display name of the object

Parameters
boolregular (default: true)
boolrichtext (default: false)
Returns
std::string objectDisplayName

Implements CObjectInterface.

References CDataObject::getObjectDisplayName(), and mpDataObject.

Referenced by CTimeSensMethod::printUpdateSeq().

◆ getPrerequisites()

const CObjectInterface::ObjectSet & CMathObject::getPrerequisites ( ) const
overridevirtual

Retrieve the prerequisites, i.e., the objects which need to be evaluated before this.

Returns
const CObjectInterface::ObjectSet & prerequisites

Implements CObjectInterface.

References mPrerequisites.

Referenced by CMathContainer::createSynchronizeInitialValuesSequence().

◆ getSimulationType()

◆ getValidity()

const CValidity & CMathObject::getValidity ( ) const
overridevirtual

Get the aggregation of any issues associated with this object

Returns
const CValidity & validity

Implements CObjectInterface.

References CObjectInterface::mValidity.

◆ getValue()

const C_FLOAT64 & CMathObject::getValue ( ) const

◆ getValuePointer()

◆ getValueType()

◆ initialize()

void CMathObject::initialize ( CMathObject pObject,
C_FLOAT64 pValue,
const CMath::ValueType valueType,
const CMath::EntityType entityType,
const CMath::SimulationType simulationType,
const bool &  isIntensiveProperty,
const bool &  isInitialValue,
const CDataObject pDataObject 
)
static

◆ isInitialValue()

const bool & CMathObject::isInitialValue ( ) const

Check whether the object is an initial value

Returns
const bool & isInitialValue

References mIsInitialValue.

Referenced by CMathDependencyNode::buildUpdateSequence(), CEvaluationNodeOperator::getUnit(), and initialize().

◆ isIntensiveProperty()

const bool & CMathObject::isIntensiveProperty ( ) const

◆ isPrerequisiteForContext()

◆ print()

void CMathObject::print ( std::ostream *  ostream) const
overridevirtual

This is the output method for any object. The default implementation provided with CDataObject uses the ostream operator<< of the object to print the object.To override this default behavior one needs to reimplement the virtual print function.

Parameters
std::ostream* ostream

Implements CObjectInterface.

References mpValue.

◆ relocate()

◆ setDataObject()

void CMathObject::setDataObject ( const CDataObject pDataObject)

Set the pointer to the data object

Parameters
constCDataObject * pDataObject

References mpDataObject.

Referenced by CMathEvent::compile(), and CMathContainer::removeDataObject().

◆ setExpression() [1/2]

bool CMathObject::setExpression ( const CExpression expression,
CMathContainer container 
)

Set the expression and compile the object.

Parameters
constCExpression & expression,
CMathContainer& container
Returns
bool success

References createConvertedExpression().

◆ setExpression() [2/2]

bool CMathObject::setExpression ( const std::string &  infix,
const bool &  isBoolean,
CMathContainer container 
)

Set the expression's infix and compile the object.

Parameters
conststd::string & infix,
constbool & isBoolean,
CMathContainer& container
Returns
bool success

References CExpression::compile(), CExpression::setInfix(), and CExpression::setIsBoolean().

Referenced by CMathDelay::addValueObject(), CMathEvent::compile(), CMathDelay::create(), CMathEvent::setDelayExpression(), and CMathEvent::setPriorityExpression().

◆ setExpressionPtr()

bool CMathObject::setExpressionPtr ( CMathExpression pMathExpression)

Set the expression and compile the object.

Parameters
CMathExpression* pMathExpression,
Returns
bool success

References CMathExpression::compile(), compileExpression(), mpExpression, mPrerequisites, and pdelete.

Referenced by CMathContainer::addAnalysisObject(), and CMathContainer::replaceDiscontinuousNode().

◆ setSimulationType()

void CMathObject::setSimulationType ( const CMath::SimulationType simulationType)

Set the simulation type

Parameters
constCMath::SimulationType & simulationType

References mSimulationType.

Referenced by CMathEvent::CAssignment::compile().

◆ setValueType()

void CMathObject::setValueType ( const CMath::ValueType valueType)

Set the value type

Parameters
constCMath::ValueType & valueType

References mValueType.

Referenced by CMathContainer::replaceDiscontinuousNode().

◆ validityChanged()

void CMathObject::validityChanged ( const CValidity changedValidity)
overridevirtual

This method is called whenever the validity object changes.

Parameters
constCValidity & changedValidity

Implements CObjectInterface.

References mpDataObject.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CMathObject o 
)
friend

Member Data Documentation

◆ InvalidValue

◆ mEntityType

CMath::EntityType CMathObject::mEntityType
private

◆ mIsInitialValue

◆ mIsIntensiveProperty

bool CMathObject::mIsIntensiveProperty
private

A flag indicating whether this is an intensive or extensive property.

Referenced by compileInitialValue(), compileNoise(), compileRate(), compileValue(), initialize(), isIntensiveProperty(), and isPrerequisiteForContext().

◆ mpCalculate

◆ mpCompartmentValue

◆ mpCorrespondingProperty

const CMathObject* CMathObject::mpCorrespondingProperty
private

A pointer to the corresponding intensive or extensive property value if it exists otherwise NULL

Referenced by compileInitialValue(), compileParticleFlux(), compilePropensity(), compileValue(), getCorrespondingProperty(), initialize(), isPrerequisiteForContext(), and relocate().

◆ mpCorrespondingPropertyValue

const C_FLOAT64* CMathObject::mpCorrespondingPropertyValue
private

◆ mpDataObject

◆ mpExpression

◆ mpQuantity2NumberValue

◆ mPrerequisites

◆ mpValue

◆ mRateVector

◆ mSimulationType

◆ mStoichiometryVector

◆ mValueType

CMath::ValueType CMathObject::mValueType
private

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