COPASI API
4.16.103
|
#include <CMathObject.h>
Public Member Functions | |
void | calculate () |
CMathObject () | |
bool | compile (CMathContainer &container) |
void | copy (const CMathObject &src, CMathContainer &container, const size_t &valueOffset, const size_t &objectOffset) |
virtual CCopasiObjectName | getCN () const |
const CCopasiObject * | getDataObject () const |
const CMath::EntityType & | getEntityType () const |
const CMathExpression * | getExpressionPtr () const |
virtual const CObjectInterface * | getObject (const CCopasiObjectName &cn) const |
virtual const CObjectInterface::ObjectSet & | getPrerequisites () const |
const CMath::SimulationType & | getSimulationType () const |
virtual void * | getValuePointer () const |
const CMath::ValueType & | getValueType () const |
const bool & | isInitialValue () const |
const bool & | isIntensiveProperty () const |
virtual bool | isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const |
virtual void | print (std::ostream *ostream) const |
bool | setExpression (const std::string &infix, const bool &isBoolean, CMathContainer &container) |
bool | setExpression (const CExpression &expression, CMathContainer &container) |
bool | setExpressionPtr (CMathExpression *pMathExpression) |
void | setSimulationType (const CMath::SimulationType &simulationType) |
virtual | ~CMathObject () |
![]() | |
CObjectInterface () | |
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 CCopasiObject *pDataObject) |
Private Member Functions | |
bool | compileDependentMass (CMathContainer &container) |
void | compileExpression () |
bool | compileFlux (CMathContainer &container) |
bool | compileInitialValue (CMathContainer &container) |
bool | compileParticleFlux (CMathContainer &container) |
bool | compilePropensity (CMathContainer &container) |
bool | compileRate (CMathContainer &container) |
bool | compileTotalMass (CMathContainer &container) |
bool | compileValue (CMathContainer &container) |
bool | createConvertedExpression (const CExpression *pExpression, CMathContainer &container) |
bool | createExtensiveODERateExpression (const CMetab *pSpecies, CMathContainer &container) |
bool | createExtensiveReactionRateExpression (const CMetab *pSpecies, CMathContainer &container) |
bool | createExtensiveValueExpression (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 |
const CCopasiObject * | mpDataObject |
CMathExpression * | mpExpression |
const CMathObject * | mpIntensiveProperty |
CObjectInterface::ObjectSet | mPrerequisites |
C_FLOAT64 * | mpValue |
CMath::SimulationType | mSimulationType |
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 | |
![]() | |
typedef std::set< const CObjectInterface * > | ObjectSet |
typedef std::vector < CObjectInterface * > | UpdateSequence |
Definition at line 22 of file CMathObject.h.
CMathObject::CMathObject | ( | ) |
Default Constructor
Definition at line 44 of file CMathObject.cpp.
|
virtual |
Calculate the objects value
Definition at line 263 of file CMathObject.cpp.
References getCN(), mpExpression, mpValue, and CMathExpression::value().
Referenced by CMathContainer::applyUpdateSequence(), compileExpression(), and copy().
bool CMathObject::compile | ( | CMathContainer & | container | ) |
Compile
CMathContainer | & container |
Definition at line 380 of file CMathObject.cpp.
References compileDependentMass(), compileFlux(), compileInitialValue(), compileParticleFlux(), compilePropensity(), compileRate(), compileTotalMass(), compileValue(), CMath::DependentMass, CMath::Discontinuous, CMath::EventAssignment, CMath::EventDelay, CMath::EventPriority, CMath::EventRoot, CMath::EventRootState, CMath::EventTrigger, CMath::Flux, mIsInitialValue, mValueType, CMath::ParticleFlux, CMath::Propensity, CMath::Rate, CMath::TotalMass, CMath::Value, and CMath::ValueTypeUndefined.
Referenced by CMathContainer::compileObjects().
|
private |
Compile the dependent mass of a moiety.
CMathContainer | & container |
Definition at line 910 of file CMathObject.cpp.
References C_FLOAT64, compileExpression(), CCopasiObject::getCN(), CMoiety::getEquation(), CMathContainer::getMathObject(), CCopasiObject::getObjectParent(), CMoiety::getTotalNumberReference(), getValuePointer(), InvalidValue, mIsInitialValue, mpDataObject, mpExpression, mPrerequisites, mpValue, and CExpression::setInfix().
Referenced by compile().
|
private |
Common compile steps after an expression has been created.
Definition at line 968 of file CMathObject.cpp.
References calculate(), CMathExpression::convertToInitialExpression(), CMathExpression::getPrerequisites(), mIsInitialValue, mpExpression, and mPrerequisites.
Referenced by compileDependentMass(), compileFlux(), compileParticleFlux(), compilePropensity(), compileTotalMass(), createConvertedExpression(), createExtensiveODERateExpression(), createExtensiveReactionRateExpression(), createExtensiveValueExpression(), createIntensiveRateExpression(), createIntensiveValueExpression(), and setExpressionPtr().
|
private |
Compile the reactions flux
CMathContainer | & container |
Definition at line 730 of file CMathObject.cpp.
References compileExpression(), CReaction::getCallParameters(), CReaction::getChemEq(), CCopasiObject::getCN(), CChemEq::getCompartments(), CReaction::getFunction(), CEvaluationTree::getInfix(), CCopasiObject::getObjectName(), CCopasiObject::getObjectParent(), InvalidValue, mIsInitialValue, mpDataObject, mpExpression, mPrerequisites, mpValue, and pdelete.
Referenced by compile().
|
private |
Compile initial value objects
CMathContainer | & container |
Definition at line 444 of file CMathObject.cpp.
References CMath::Assignment, C_FLOAT64, CMath::Conversion, createConvertedExpression(), createExtensiveValueExpression(), createIntensiveValueExpression(), CMath::Dependent, CMath::EventTarget, CMath::Fixed, CMetab::getInitialConcentrationReference(), CModelEntity::getInitialExpressionPtr(), CMathContainer::getMathObject(), CCopasiObject::getObjectParent(), CCopasiObject::getValuePointer(), CMath::Independent, InvalidValue, mIsIntensiveProperty, mpDataObject, mpIntensiveProperty, mPrerequisites, mpValue, mSimulationType, CMath::ODE, CMath::SimulationTypeUndefined, and CMath::Time.
Referenced by compile().
|
private |
Compile the reactions particle flux
CMathContainer | & container |
Definition at line 694 of file CMathObject.cpp.
References compileExpression(), CCopasiObject::getCN(), CReaction::getFluxReference(), CMathContainer::getModel(), CCopasiObject::getObjectParent(), CModel::getQuantity2NumberFactor(), InvalidValue, mIsInitialValue, mpDataObject, mpExpression, mPrerequisites, mpValue, and CExpression::setInfix().
Referenced by compile().
|
private |
Compile the reactions propensity
CMathContainer | & container |
Definition at line 770 of file CMathObject.cpp.
References CCopasiVector< T >::begin(), C_FLOAT64, compileExpression(), CModel::deterministic, CCopasiVector< T >::end(), CReaction::getChemEq(), CCopasiObject::getCN(), CMathContainer::getModel(), CModel::getModelType(), CCopasiObject::getObjectParent(), CReaction::getParticleFluxReference(), CChemEq::getSubstrates(), InvalidValue, CReaction::isReversible(), mIsInitialValue, mpDataObject, mpExpression, mPrerequisites, mpValue, and CExpression::setInfix().
Referenced by compile().
|
private |
Compile value rate objects
CMathContainer | & container |
Definition at line 610 of file CMathObject.cpp.
References CMath::Assignment, CMath::Conversion, createConvertedExpression(), createExtensiveODERateExpression(), createExtensiveReactionRateExpression(), createIntensiveRateExpression(), CMath::Dependent, CMath::EventTarget, CMath::Fixed, CModelEntity::getExpressionPtr(), CCopasiObject::getObjectParent(), CMath::Independent, InvalidValue, mEntityType, mIsIntensiveProperty, mpDataObject, mPrerequisites, mpValue, mSimulationType, CMath::ODE, CMath::SimulationTypeUndefined, CMath::Species, and CMath::Time.
Referenced by compile().
|
private |
Compile the total mass of a moiety.
CMathContainer | & container |
Definition at line 860 of file CMathObject.cpp.
References C_FLOAT64, compileExpression(), CMoiety::getEquation(), CCopasiObject::getObjectParent(), InvalidValue, mIsInitialValue, mpDataObject, mpExpression, mPrerequisites, mpValue, and CExpression::setInfix().
Referenced by compile().
|
private |
Compile value objects
CMathContainer | & container |
Definition at line 523 of file CMathObject.cpp.
References CMath::Assignment, CMath::Conversion, createConvertedExpression(), createExtensiveValueExpression(), createIntensiveValueExpression(), CMath::Dependent, CMath::EventTarget, CMath::Fixed, CMetab::getConcentrationReference(), CMoiety::getDependentNumberReference(), CModelEntity::getExpressionPtr(), CMathContainer::getMathObject(), CMetab::getMoiety(), CCopasiObject::getObjectParent(), CMath::Independent, InvalidValue, mEntityType, mIsIntensiveProperty, mpDataObject, mpIntensiveProperty, mPrerequisites, mpValue, mSimulationType, CMath::ODE, CMath::SimulationTypeUndefined, CMath::Species, and CMath::Time.
Referenced by compile().
void CMathObject::copy | ( | const CMathObject & | src, |
CMathContainer & | container, | ||
const size_t & | valueOffset, | ||
const size_t & | objectOffset | ||
) |
Copy an existing object
const | CMathObject & src |
CMathContainer | & container |
const | size_t & valueOffset |
const | size_t & objectOffset |
Definition at line 64 of file CMathObject.cpp.
References C_FLOAT64, calculate(), CMathExpression::copy(), getPrerequisites(), mEntityType, mIsInitialValue, mIsIntensiveProperty, mpDataObject, mpExpression, mpIntensiveProperty, mPrerequisites, mpValue, mSimulationType, and mValueType.
Referenced by CMathContainer::CMathContainer().
|
private |
Create and compile an expression based on the given expression.
const | CExpression * pExpression |
CMathContainer | & container |
Definition at line 986 of file CMathObject.cpp.
References compileExpression(), CMath::Discontinuous, CMath::EventAssignment, mIsInitialValue, mpExpression, and mValueType.
Referenced by compileInitialValue(), compileRate(), compileValue(), and setExpression().
|
private |
Create and compile an expression for an extensive rate of a species determined by an ODE.
const | CMetab * pSpecies |
CMathContainer | & container |
Definition at line 1124 of file CMathObject.cpp.
References compileExpression(), CCopasiObject::getCN(), CMetab::getCompartment(), CModelEntity::getExpression(), CMathContainer::getModel(), CModel::getQuantity2NumberFactor(), CModelEntity::getValueReference(), mIsInitialValue, mpExpression, and CExpression::setInfix().
Referenced by compileRate().
|
private |
Create and compile an expression for an extensive rate of a species determined by reactions
const | CMetab * pSpecies |
CMathContainer | & container |
Definition at line 1154 of file CMathObject.cpp.
References CCopasiVector< T >::begin(), C_FLOAT64, compileExpression(), CCopasiVector< T >::end(), CModelEntity::getKey(), CMathContainer::getModel(), CModel::getReactions(), mIsInitialValue, mpExpression, and CExpression::setInfix().
Referenced by compileRate().
|
private |
Create and compile an expression for an extensive value of a species.
const | CMetab * pSpecies |
CMathContainer | & container |
Definition at line 1045 of file CMathObject.cpp.
References compileExpression(), CObjectInterface::getCN(), CMetab::getCompartment(), CMetab::getConcentrationReference(), CMetab::getInitialConcentrationReference(), CModelEntity::getInitialValueReference(), CMathContainer::getModel(), CModel::getQuantity2NumberFactor(), CModelEntity::getValueReference(), mIsInitialValue, mpExpression, and CExpression::setInfix().
Referenced by compileInitialValue(), and compileValue().
|
private |
Create and compile an expression for an intensive rate of a species.
const | CMetab * pSpecies |
CMathContainer | & container |
Definition at line 1087 of file CMathObject.cpp.
References compileExpression(), CCopasiObject::getCN(), CMetab::getCompartment(), CMathContainer::getModel(), CModel::getNumber2QuantityFactor(), CModelEntity::getRateReference(), CModelEntity::getValueReference(), mIsInitialValue, mpExpression, and CExpression::setInfix().
Referenced by compileRate().
|
private |
Create and compile an expression for an intensive value of a species.
const | CMetab * pSpecies |
CMathContainer | & container |
Definition at line 1004 of file CMathObject.cpp.
References compileExpression(), CObjectInterface::getCN(), CMetab::getCompartment(), CModelEntity::getInitialValueReference(), CMathContainer::getModel(), CModel::getNumber2QuantityFactor(), CModelEntity::getValueReference(), mIsInitialValue, mpExpression, and CExpression::setInfix().
Referenced by compileInitialValue(), and compileValue().
|
virtual |
Retrieve the CN of the object
Implements CObjectInterface.
Definition at line 108 of file CMathObject.cpp.
References CCopasiObject::getCN(), and mpDataObject.
Referenced by calculate(), and operator<<().
const CCopasiObject * CMathObject::getDataObject | ( | ) | const |
Retrieve the pointer to the data object
Definition at line 291 of file CMathObject.cpp.
References mpDataObject.
Referenced by CEvaluationTree::compileNodes(), CMathContainer::fetchInitialState(), CMathContainer::fetchState(), CMathDependencyGraph::getDOTNodeId(), CEvaluationNodeObject::getMMLString(), CMathContainer::pushInitialState(), and CMathContainer::pushState().
const CMath::EntityType & CMathObject::getEntityType | ( | ) | const |
Retrieve the entity type
Definition at line 301 of file CMathObject.cpp.
References mEntityType.
Referenced by CMathContainer::createSynchronizeInitialValuesSequence().
const CMathExpression * CMathObject::getExpressionPtr | ( | ) | const |
Retrieve a pointer to the math expression.
Definition at line 375 of file CMathObject.cpp.
References mpExpression.
|
virtual |
Retrieve a descendant object by its CN.
const | CCopasiObjectName & cn |
Implements CObjectInterface.
Definition at line 117 of file CMathObject.cpp.
References CCopasiObject::getObject(), and mpDataObject.
|
virtual |
Retrieve the prerequisites, i.e., the objects which need to be evaluated before this.
Implements CObjectInterface.
Definition at line 131 of file CMathObject.cpp.
References mPrerequisites.
Referenced by copy().
const CMath::SimulationType & CMathObject::getSimulationType | ( | ) | const |
Retrieve the simulation type
Definition at line 306 of file CMathObject.cpp.
References mSimulationType.
Referenced by CMathDependencyNode::buildUpdateSequence(), and CMathContainer::createUpdateSimulationValuesSequence().
|
virtual |
Retrieve a pointer to the value of the object
Implements CObjectInterface.
Definition at line 258 of file CMathObject.cpp.
References mpValue.
Referenced by compileDependentMass(), CMathExpression::createNodeFromValue(), CMathContainer::createNodeFromValue(), CMathReaction::initialize(), and CMathContainer::replaceDiscontinuousNode().
const CMath::ValueType & CMathObject::getValueType | ( | ) | const |
Retrieve the value type
Definition at line 296 of file CMathObject.cpp.
References mValueType.
Referenced by CMathDependencyNode::buildUpdateSequence(), and CMathDependencyGraph::getDOTNodeId().
|
static |
Initialize a single mathematical object and advance relevant pointers
CMathObject | *& pObject |
C_FLOAT64 | *& pValue |
const | CMath::Value & valueType |
const | CMath::EntityType & entityType |
const | CMath::SimulationType & simulationType |
const | bool & isIntensiveProperty |
const | bool & isInitialValue |
const | CCopasiObject * pDataObject |
Definition at line 23 of file CMathObject.cpp.
References isInitialValue(), isIntensiveProperty(), mEntityType, mIsInitialValue, mIsIntensiveProperty, mpDataObject, mpValue, mSimulationType, and mValueType.
Referenced by CMathEventN::CAssignment::initialize(), CMathEventN::CTrigger::CRoot::initialize(), CMathEventN::CTrigger::initialize(), CMathEventN::initialize(), CMathContainer::initializeMathObjects(), and CMathContainer::initializeObjects().
const bool & CMathObject::isInitialValue | ( | ) | const |
Check whether the object is an initial value
Definition at line 321 of file CMathObject.cpp.
References mIsInitialValue.
Referenced by initialize().
const bool & CMathObject::isIntensiveProperty | ( | ) | const |
Check whether the object is an intensive property
Definition at line 316 of file CMathObject.cpp.
References mIsIntensiveProperty.
Referenced by CMathContainer::createSynchronizeInitialValuesSequence(), and initialize().
|
virtual |
Check whether a given object is a prerequisite for a context.
const | CObjectInterface * pObject |
const | CMath::SimulationContextFlag & context |
const | CObjectInterface::ObjectSet & changedObjects |
Implements CObjectInterface.
Definition at line 137 of file CMathObject.cpp.
References CMath::Assignment, CEvaluationNodeFunction::CEIL, CEvaluationNode::CHOICE, CMath::Dependent, CMath::DependentMass, CMath::Discontinuous, CMath::Event, CMath::EventHandling, CMath::EventTrigger, CEvaluationNodeFunction::FLOOR, CEvaluationNode::FUNCTION, CEvaluationTree::getRoot(), CEvaluationNode::getType(), CEvaluationNodeChoice::IF, mEntityType, mIsIntensiveProperty, CMath::Moiety, mpExpression, mpIntensiveProperty, mPrerequisites, mSimulationType, mValueType, CMath::Species, CMath::TotalMass, CMath::UpdateMoieties, CMath::UseMoieties, and CMath::Value.
|
virtual |
This is the output method for any object. The default implementation provided with CCopasiObject uses the ostream operator<< of the object to print the object.To override this default behavior one needs to reimplement the virtual print function.
std::ostream | * ostream |
Implements CObjectInterface.
Definition at line 252 of file CMathObject.cpp.
References mpValue.
bool CMathObject::setExpression | ( | const std::string & | infix, |
const bool & | isBoolean, | ||
CMathContainer & | container | ||
) |
Set the expression's infix and compile the object.
const | std::string & infix, |
const | bool & isBoolean, |
CMathContainer | & container |
Definition at line 326 of file CMathObject.cpp.
References CExpression::compile(), CExpression::setInfix(), and CExpression::setIsBoolean().
Referenced by CMathEventN::compile(), CMathEventN::setDelayExpression(), and CMathEventN::setPriorityExpression().
bool CMathObject::setExpression | ( | const CExpression & | expression, |
CMathContainer & | container | ||
) |
Set the expression and compile the object.
const | CExpression & expression, |
CMathContainer | & container |
Definition at line 343 of file CMathObject.cpp.
References createConvertedExpression().
bool CMathObject::setExpressionPtr | ( | CMathExpression * | pMathExpression | ) |
Set the expression and compile the object.
CMathExpression | * pMathExpression, |
Definition at line 353 of file CMathObject.cpp.
References CMathExpression::compile(), compileExpression(), mpExpression, mPrerequisites, and pdelete.
Referenced by CMathContainer::replaceDiscontinuousNode().
void CMathObject::setSimulationType | ( | const CMath::SimulationType & | simulationType | ) |
Set the simulation type
const | CMath::SimulationType & simulationType |
Definition at line 311 of file CMathObject.cpp.
References mSimulationType.
Referenced by CMathEventN::CAssignment::compile().
|
friend |
Definition at line 1229 of file CMathObject.cpp.
Definition at line 316 of file CMathObject.h.
Referenced by compileDependentMass(), compileFlux(), compileInitialValue(), compileParticleFlux(), compilePropensity(), compileRate(), compileTotalMass(), and compileValue().
|
private |
The entity type the object belongs
Definition at line 341 of file CMathObject.h.
Referenced by compileRate(), compileValue(), copy(), getEntityType(), initialize(), isPrerequisiteForContext(), and operator<<().
|
private |
A flag indicating whether this is an initial value, i.e, which dependency graph is used to update the object.
Definition at line 357 of file CMathObject.h.
Referenced by compile(), compileDependentMass(), compileExpression(), compileFlux(), compileParticleFlux(), compilePropensity(), compileTotalMass(), copy(), createConvertedExpression(), createExtensiveODERateExpression(), createExtensiveReactionRateExpression(), createExtensiveValueExpression(), createIntensiveRateExpression(), createIntensiveValueExpression(), initialize(), isInitialValue(), and operator<<().
|
private |
A flag indicating whether this is an intensive or extensive property.
Definition at line 351 of file CMathObject.h.
Referenced by compileInitialValue(), compileRate(), compileValue(), copy(), initialize(), isIntensiveProperty(), isPrerequisiteForContext(), and operator<<().
|
private |
A pointer to the data object
Definition at line 367 of file CMathObject.h.
Referenced by compileDependentMass(), compileFlux(), compileInitialValue(), compileParticleFlux(), compilePropensity(), compileRate(), compileTotalMass(), compileValue(), copy(), getCN(), getDataObject(), getObject(), initialize(), and operator<<().
|
private |
The expression which determines the value of the object.
Definition at line 321 of file CMathObject.h.
Referenced by calculate(), compileDependentMass(), compileExpression(), compileFlux(), compileParticleFlux(), compilePropensity(), compileTotalMass(), copy(), createConvertedExpression(), createExtensiveODERateExpression(), createExtensiveReactionRateExpression(), createExtensiveValueExpression(), createIntensiveRateExpression(), createIntensiveValueExpression(), getExpressionPtr(), isPrerequisiteForContext(), operator<<(), setExpressionPtr(), and ~CMathObject().
|
private |
A pointer to the corresponding intensive property if it exists otherwise NULL
Definition at line 362 of file CMathObject.h.
Referenced by compileInitialValue(), compileValue(), copy(), isPrerequisiteForContext(), and operator<<().
|
private |
The prerequisites, i.e., the objects which need to be evaluated before this.
Definition at line 331 of file CMathObject.h.
Referenced by compileDependentMass(), compileExpression(), compileFlux(), compileInitialValue(), compileParticleFlux(), compilePropensity(), compileRate(), compileTotalMass(), compileValue(), copy(), getPrerequisites(), isPrerequisiteForContext(), and setExpressionPtr().
|
private |
A pointer to value of the object
Definition at line 326 of file CMathObject.h.
Referenced by calculate(), compileDependentMass(), compileFlux(), compileInitialValue(), compileParticleFlux(), compilePropensity(), compileRate(), compileTotalMass(), compileValue(), copy(), getValuePointer(), initialize(), operator<<(), and print().
|
private |
The simulation type
Definition at line 346 of file CMathObject.h.
Referenced by compileInitialValue(), compileRate(), compileValue(), copy(), getSimulationType(), initialize(), isPrerequisiteForContext(), operator<<(), and setSimulationType().
|
private |
The type of the object
Definition at line 336 of file CMathObject.h.
Referenced by compile(), copy(), createConvertedExpression(), getValueType(), initialize(), isPrerequisiteForContext(), and operator<<().