COPASI API
4.16.103
|
#include <CMathTrigger.h>
Classes | |
class | CRootFinder |
Public Member Functions | |
void | applyInitialValues () |
bool | calculate () |
void | calculateInitialActivity () |
void | calculateTrueValue () |
CMathTrigger (const CCopasiContainer *pParent=NULL) | |
CMathTrigger (const CMathTrigger &src, const CCopasiContainer *pParent=NULL) | |
bool | compile (const CExpression *pTriggerExpression, std::vector< CCopasiContainer * > listOfContainer) |
CCopasiVector< CRootFinder > & | getRootFinders () |
virtual | ~CMathTrigger () |
![]() | |
virtual bool | add (CCopasiObject *pObject, const bool &adopt=true) |
CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container) | |
CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL) | |
virtual std::string | getChildObjectUnits (const CCopasiObject *pObject) const |
virtual const CObjectInterface * | getObject (const CCopasiObjectName &cn) const |
virtual const objectMap & | getObjects () const |
virtual std::string | getUnits () const |
virtual const CCopasiObject * | getValueObject () const |
virtual bool | remove (CCopasiObject *pObject) |
virtual | ~CCopasiContainer () |
![]() | |
void | addDirectDependency (const CCopasiObject *pObject) |
CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL) | |
void | clearDirectDependencies () |
void | clearRefresh () |
bool | dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const |
void | getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const |
virtual CCopasiObjectName | getCN () const |
virtual const DataObjectSet & | getDirectDependencies (const DataObjectSet &context=DataObjectSet()) const |
virtual const std::string & | getKey () const |
CCopasiContainer * | getObjectAncestor (const std::string &type) const |
CCopasiDataModel * | getObjectDataModel () |
const CCopasiDataModel * | getObjectDataModel () const |
virtual std::string | getObjectDisplayName (bool regular=true, bool richtext=false) const |
const std::string & | getObjectName () const |
CCopasiContainer * | getObjectParent () const |
const std::string & | getObjectType () const |
virtual const CObjectInterface::ObjectSet & | getPrerequisites () const |
virtual Refresh * | getRefresh () const |
UpdateMethod * | getUpdateMethod () const |
virtual void * | getValuePointer () const |
bool | hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const |
bool | hasUpdateMethod () const |
bool | isArray () const |
bool | isContainer () const |
bool | isDataModel () const |
bool | isMatrix () const |
bool | isNameVector () const |
bool | isNonUniqueName () const |
virtual bool | isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const |
bool | isReference () const |
bool | isRoot () const |
bool | isSeparator () const |
bool | isStaticString () const |
bool | isValueBool () const |
bool | isValueDbl () const |
bool | isValueInt () const |
bool | isValueInt64 () const |
bool | isValueString () const |
bool | isVector () const |
virtual bool | mustBeDeleted (const DataObjectSet &deletedObjects) const |
virtual void | print (std::ostream *ostream) const |
void | removeDirectDependency (const CCopasiObject *pObject) |
void | setDirectDependencies (const DataObjectSet &directDependencies) |
bool | setObjectName (const std::string &name) |
virtual bool | setObjectParent (const CCopasiContainer *pParent) |
void | setObjectValue (const C_FLOAT64 &value) |
void | setObjectValue (const C_INT32 &value) |
void | setObjectValue (const bool &value) |
template<class CType > | |
void | setRefresh (CType *pType, void(CType::*method)(void)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const bool &)) |
virtual | ~CCopasiObject () |
![]() | |
CObjectInterface () | |
virtual | ~CObjectInterface () |
Private Member Functions | |
bool | compile (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileAND (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileEQ (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileEXPRESSION (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileFUNCTION (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileGE (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileGT (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileLE (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileLT (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileNE (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileNOT (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileOR (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileVARIABLE (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
bool | compileXOR (const CEvaluationNode *pSource, CEvaluationNode *&pTrueExpression) |
CEvaluationNode * | copyBranch (const CEvaluationNode *pSource) |
Private Attributes | |
std::stack< std::vector< const CEvaluationNode * > > | mFunctionVariableMap |
CCopasiVector< CRootFinder > | mRootFinders |
CExpression | mTrueExpression |
Additional Inherited Members | |
![]() | |
typedef std::multimap < std::string, CCopasiObject * > | objectMap |
![]() | |
typedef std::set< const CCopasiObject * > | DataObjectSet |
typedef std::vector< Refresh * > | DataUpdateSequence |
![]() | |
typedef std::set< const CObjectInterface * > | ObjectSet |
typedef std::vector < CObjectInterface * > | UpdateSequence |
![]() | |
static std::vector< Refresh * > | buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet()) |
static void | setRenameHandler (CRenameHandler *rh) |
![]() | |
static const std::vector < CCopasiContainer * > | EmptyList |
![]() | |
enum | Flag { Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8, Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80, ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800, Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000, Root = 0x10000, Gui = 0x20000 } |
![]() | |
template<class CType > | |
CCopasiObject * | addMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
template<class CType > | |
CCopasiObject * | addObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
template<class CType > | |
CCopasiObject * | addVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
void | initObjects () |
![]() | |
CCopasiObject () | |
CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0) | |
![]() | |
objectMap | mObjects |
![]() | |
static CRenameHandler * | smpRenameHandler = NULL |
Definition at line 13 of file CMathTrigger.h.
CMathTrigger::CMathTrigger | ( | const CCopasiContainer * | pParent = NULL | ) |
Default constructor
const | CCopasiContainer * pParent (default: NULL) |
Definition at line 165 of file CMathTrigger.cpp.
CMathTrigger::CMathTrigger | ( | const CMathTrigger & | src, |
const CCopasiContainer * | pParent = NULL |
||
) |
Copy constructor
const CMathTrigger & | src |
"const | CCopasiContainer * pParent (default: NULL) |
Definition at line 172 of file CMathTrigger.cpp.
|
virtual |
void CMathTrigger::applyInitialValues | ( | ) |
Initialize all values of the math model with their initial values.
Definition at line 183 of file CMathTrigger.cpp.
References mRootFinders.
bool CMathTrigger::calculate | ( | void | ) |
Calculate the current trigger value.
Definition at line 207 of file CMathTrigger.cpp.
References CExpression::calcValue(), and mTrueExpression.
Referenced by CMathModel::processRoots().
void CMathTrigger::calculateInitialActivity | ( | ) |
Determine the activity for the initial conditions.
void CMathTrigger::calculateTrueValue | ( | ) |
Determine the true value for the initial conditions.
Definition at line 195 of file CMathTrigger.cpp.
References mRootFinders.
Referenced by CMathTrigger::CRootFinder::applyInitialValues().
bool CMathTrigger::compile | ( | const CExpression * | pTriggerExpression, |
std::vector< CCopasiContainer * > | listOfContainer | ||
) |
Compile the trigger
const | CExpression * pTriggerExpression |
std::vector< | CCopasiContainer * > listOfContainer |
Definition at line 212 of file CMathTrigger.cpp.
References CExpression::compile(), CEvaluationTree::getRoot(), CEvaluationNode::isBoolean(), mFunctionVariableMap, mRootFinders, mTrueExpression, CExpression::setInfix(), and CEvaluationTree::setRoot().
Referenced by CMathEvent::compile(), compileAND(), compileEQ(), compileEXPRESSION(), compileFUNCTION(), compileNOT(), compileOR(), compileVARIABLE(), and compileXOR().
|
private |
Definition at line 257 of file CMathTrigger.cpp.
References CEvaluationNodeLogical::AND, CEvaluationNodeVariable::ANY, CEvaluationNode::CALL, compileAND(), compileEQ(), compileEXPRESSION(), compileFUNCTION(), compileGE(), compileGT(), compileLE(), compileLT(), compileNE(), compileNOT(), compileOR(), compileVARIABLE(), compileXOR(), CEvaluationNode::CONSTANT, CEvaluationNodeLogical::EQ, CEvaluationNodeCall::EXPRESSION, CEvaluationNodeConstant::FALSE, CEvaluationNodeCall::FUNCTION, CEvaluationNode::FUNCTION, CEvaluationNodeLogical::GE, CEvaluationNode::getType(), CEvaluationNodeLogical::GT, CEvaluationNodeLogical::LE, CEvaluationNode::LOGICAL, CEvaluationNodeLogical::LT, CEvaluationNodeLogical::NE, CEvaluationNodeFunction::NOT, CEvaluationNodeLogical::OR, CEvaluationNode::subType(), CEvaluationNodeConstant::TRUE, CEvaluationNode::type(), CEvaluationNode::VARIABLE, and CEvaluationNodeLogical::XOR.
|
private |
Definition at line 390 of file CMathTrigger.cpp.
References CCopasiNode< _Data >::addChild(), CEvaluationNodeLogical::AND, compile(), CCopasiNode< _Data >::getChild(), and CCopasiNode< _Data >::getSibling().
Referenced by compile(), and compileEQ().
|
private |
Definition at line 459 of file CMathTrigger.cpp.
References CCopasiNode< _Data >::addChild(), CEvaluationNodeLogical::AND, compile(), compileAND(), copyBranch(), CEvaluationNodeLogical::EQ, CEvaluationNodeLogical::GE, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::getType(), CEvaluationNode::LOGICAL, pdelete, and CEvaluationNode::type().
Referenced by compile().
|
private |
Definition at line 680 of file CMathTrigger.cpp.
References compile(), and CEvaluationNode::isBoolean().
Referenced by compile().
|
private |
Definition at line 649 of file CMathTrigger.cpp.
References compile(), CEvaluationNodeCall::getCalledTree(), CCopasiNode< _Data >::getChild(), CEvaluationTree::getRoot(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::isBoolean(), and mFunctionVariableMap.
Referenced by compile().
|
private |
Definition at line 582 of file CMathTrigger.cpp.
References CCopasiNode< _Data >::addChild(), copyBranch(), CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), CMathTrigger::CRootFinder::getTrueExpression(), CMathTrigger::CRootFinder::mEquality, CEvaluationNodeOperator::MINUS, CMathTrigger::CRootFinder::mRoot, mRootFinders, and CEvaluationTree::setRoot().
Referenced by compile().
|
private |
Definition at line 607 of file CMathTrigger.cpp.
References CCopasiNode< _Data >::addChild(), copyBranch(), CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), CMathTrigger::CRootFinder::getTrueExpression(), CMathTrigger::CRootFinder::mEquality, CEvaluationNodeOperator::MINUS, CMathTrigger::CRootFinder::mRoot, mRootFinders, and CEvaluationTree::setRoot().
Referenced by compile().
|
private |
Definition at line 532 of file CMathTrigger.cpp.
References CCopasiNode< _Data >::addChild(), copyBranch(), CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), CMathTrigger::CRootFinder::getTrueExpression(), CMathTrigger::CRootFinder::mEquality, CEvaluationNodeOperator::MINUS, CMathTrigger::CRootFinder::mRoot, mRootFinders, and CEvaluationTree::setRoot().
Referenced by compile().
|
private |
Definition at line 557 of file CMathTrigger.cpp.
References CCopasiNode< _Data >::addChild(), copyBranch(), CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), CMathTrigger::CRootFinder::getTrueExpression(), CMathTrigger::CRootFinder::mEquality, CEvaluationNodeOperator::MINUS, CMathTrigger::CRootFinder::mRoot, mRootFinders, and CEvaluationTree::setRoot().
Referenced by compile().
|
private |
Definition at line 507 of file CMathTrigger.cpp.
References CCopasiNode< _Data >::addChild(), compileNOT(), CEvaluationNode::copyBranch(), CEvaluationNodeLogical::EQ, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), and CEvaluationNodeFunction::NOT.
Referenced by compile().
|
private |
Definition at line 632 of file CMathTrigger.cpp.
References CCopasiNode< _Data >::addChild(), compile(), CCopasiNode< _Data >::getChild(), and CEvaluationNodeFunction::NOT.
Referenced by compile(), and compileNE().
|
private |
Definition at line 413 of file CMathTrigger.cpp.
References CCopasiNode< _Data >::addChild(), compile(), CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), and CEvaluationNodeLogical::OR.
Referenced by compile().
|
private |
Definition at line 692 of file CMathTrigger.cpp.
References compile(), CEvaluationNode::isBoolean(), and mFunctionVariableMap.
Referenced by compile().
|
private |
Definition at line 436 of file CMathTrigger.cpp.
References CCopasiNode< _Data >::addChild(), compile(), CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), and CEvaluationNodeLogical::XOR.
Referenced by compile().
|
private |
Definition at line 708 of file CMathTrigger.cpp.
References CEvaluationNodeConstant::_NaN, C_INVALID_INDEX, CEvaluationNode::copyBranch(), CCopasiNode< _Data >::getData(), CEvaluationNode::getType(), mFunctionVariableMap, and CEvaluationNode::VARIABLE.
Referenced by compileEQ(), compileGE(), compileGT(), compileLE(), and compileLT().
CCopasiVector< CMathTrigger::CRootFinder > & CMathTrigger::getRootFinders | ( | ) |
Retrieve the list of root finders
Definition at line 252 of file CMathTrigger.cpp.
References mRootFinders.
Referenced by CMathModel::compile().
|
private |
A stack to map variable nodes to the value nodes provided in the function call
Definition at line 256 of file CMathTrigger.h.
Referenced by compile(), compileFUNCTION(), compileVARIABLE(), and copyBranch().
|
private |
A vector containing the root expression.
Definition at line 250 of file CMathTrigger.h.
Referenced by applyInitialValues(), calculateTrueValue(), compile(), compileGE(), compileGT(), compileLE(), compileLT(), and getRootFinders().
|
private |
This expression evaluates whether the trigger value is true.
Definition at line 245 of file CMathTrigger.h.
Referenced by calculate(), and compile().