COPASI API
4.16.103
|
#include <CEvaluationNodeCall.h>
Public Types | |
enum | SubType { INVALID = 0x00FFFFFF, FUNCTION = 0x00000000, EXPRESSION = 0x00000001 } |
![]() | |
enum | Type { INVALID = 0xFF000000, NUMBER = 0x01000000, CONSTANT = 0x02000000, OPERATOR = 0x03000000, OBJECT = 0x04000000, FUNCTION = 0x05000000, CALL = 0x06000000, STRUCTURE = 0x07000000, CHOICE = 0x08000000, VARIABLE = 0x09000000, WHITESPACE = 0x0a000000, LOGICAL = 0x0b000000, MV_FUNCTION = 0x0c000000, VECTOR = 0x0d000000, DELAY = 0x0e000000 } |
![]() | |
typedef std::string | Data |
Public Member Functions | |
virtual bool | addChild (CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL) |
virtual void | calculate () |
bool | calls (std::set< std::string > &list) const |
CEvaluationNodeCall (const SubType &subType, const Data &data) | |
CEvaluationNodeCall (const CEvaluationNodeCall &src) | |
virtual bool | compile (const CEvaluationTree *pTree) |
virtual std::string | getBerkeleyMadonnaString (const std::vector< std::string > &children) const |
const CEvaluationTree * | getCalledTree () const |
virtual std::string | getCCodeString (const std::vector< std::string > &children) const |
virtual const Data & | getData () const |
virtual std::string | getDisplayString (const std::vector< std::string > &children) const |
virtual std::string | getInfix (const std::vector< std::string > &children) const |
const std::vector < CEvaluationNode * > | getListOfChildNodes () const |
virtual std::string | getMMLString (const std::vector< std::string > &children, bool expand, const std::vector< std::vector< std::string > > &variables) const |
virtual std::string | getXPPString (const std::vector< std::string > &children) const |
virtual bool | isBoolean () const |
const bool & | isBooleanRequired () const |
virtual bool | removeChild (CCopasiNode< Data > *pChild) |
void | setBooleanRequired (const bool &booleanRequired) |
virtual bool | setData (const Data &data) |
virtual ASTNode * | toAST (const CCopasiDataModel *pDataModel) const |
virtual | ~CEvaluationNodeCall () |
![]() | |
void | addChildren (const std::vector< CEvaluationNode * > &children) |
std::string | buildBerkeleyMadonnaString () const |
std::string | buildCCodeString () const |
std::string | buildDisplayString () const |
std::string | buildInfix () const |
std::string | buildMMLString (bool expand, const std::vector< std::vector< std::string > > &variables) const |
std::string | buildXPPString () const |
CEvaluationNode () | |
CEvaluationNode (const CEvaluationNode &src) | |
CEvaluationNode * | copyBranch () const |
CEvaluationNode * | copyNode (CEvaluationNode *child1, CEvaluationNode *child2) const |
CEvaluationNode * | copyNode (const std::vector< CEvaluationNode * > &children) const |
const CEvaluationNode * | findTopMinus (const std::vector< CFunctionAnalyzer::CValue > &callParameters) const |
const Type & | getType () const |
const C_FLOAT64 & | getValue () const |
const C_FLOAT64 * | getValuePointer () const |
virtual bool | operator!= (const CEvaluationNode &right) const |
bool | operator< (const CEvaluationNode &right) const |
bool | operator< (const CEvaluationNode &rhs) |
bool | operator== (const CEvaluationNode &right) const |
void | printRecursively (std::ostream &os, int indent=0) const |
void | printRecursively () const |
virtual CEvaluationNode * | simplifyNode (const std::vector< CEvaluationNode * > &children) const |
CEvaluationNode * | splitBranch (const CEvaluationNode *splitnode, bool left) const |
virtual | ~CEvaluationNode () |
![]() | |
bool | addSibling (CCopasiNode< Data > *pSibling, CCopasiNode< Data > *pAfter=NULL) |
CCopasiNode (CCopasiNode< Data > *pParent=NULL) | |
CCopasiNode (const CCopasiNode< Data > &src) | |
CCopasiNode (const Data &data, CCopasiNode< Data > *pParent=NULL) | |
bool | deleteChildren () |
CCopasiNode< Data > * | getChild () |
const CCopasiNode< Data > * | getChild () const |
CCopasiNode< Data > * | getChild (const size_t &index) |
const CCopasiNode< Data > * | getChild (const size_t &index) const |
CCopasiNode< Data > * | getNext () |
const CCopasiNode< Data > * | getNext () const |
CCopasiNode< Data > * | getNextNonChild () |
const CCopasiNode< Data > * | getNextNonChild () const |
size_t | getNumChildren () const |
CCopasiNode< Data > * | getParent () |
const CCopasiNode< Data > * | getParent () const |
CCopasiNode< Data > * | getSibling () |
const CCopasiNode< Data > * | getSibling () const |
virtual | ~CCopasiNode () |
Static Public Member Functions | |
static CEvaluationNode * | fromAST (const ASTNode *pASTNode, const std::vector< CEvaluationNode * > &children) |
![]() | |
static CEvaluationNode * | create (const Type &type, const Data &data) |
static bool | isKeyword (const std::string &str) |
static Type | subType (const Type &type) |
static Type | type (const Type &type) |
Private Member Functions | |
CEvaluationNodeCall () | |
Static Private Member Functions | |
static CCallParameters < C_FLOAT64 > * | buildParameters (const std::vector< CEvaluationNode * > &vector) |
static void | clearParameters (CCallParameters< C_FLOAT64 > *pCallParameters, const std::vector< CEvaluationNode * > &vector) |
static bool | verifyParameters (const std::vector< CEvaluationNode * > &vector, const CFunctionParameters &functionParameters) |
Private Attributes | |
bool | mBooleanRequired |
std::vector< CEvaluationNode * > | mCallNodes |
CCallParameters< C_FLOAT64 > * | mpCallParameters |
CExpression * | mpExpression |
CFunction * | mpFunction |
bool | mQuotesRequired |
CRegisteredObjectName | mRegisteredFunctionCN |
Additional Inherited Members | |
![]() | |
CEvaluationNode (const Type &type, const Data &data) | |
![]() | |
bool | setChild (CCopasiNode< Data > *pChild) |
bool | setParent (CCopasiNode< Data > *pParent) |
bool | setSibling (CCopasiNode< Data > *pSibling) |
![]() | |
class CEvaluationNode::CPrecedence | mPrecedence |
const C_FLOAT64 * | mpValue |
Type | mType |
C_FLOAT64 | mValue |
![]() | |
Data | mData |
This is the class for nodes presenting operators used in an evaluation trees.
Definition at line 30 of file CEvaluationNodeCall.h.
Enumeration of possible node types.
Enumerator | |
---|---|
INVALID | |
FUNCTION | |
EXPRESSION |
Definition at line 36 of file CEvaluationNodeCall.h.
|
private |
Default constructor
Definition at line 28 of file CEvaluationNodeCall.cpp.
References CEvaluationNode::mPrecedence, and PRECEDENCE_NUMBER.
Referenced by fromAST().
Default constructor
const | SubType & subType |
const | Data & data |
Definition at line 39 of file CEvaluationNodeCall.cpp.
References EXPRESSION, fatalError, FUNCTION, CEvaluationNode::isKeyword(), CCopasiNode< std::string >::mData, CEvaluationNode::mPrecedence, mQuotesRequired, PRECEDENCE_FUNCTION, quote(), setData(), and unQuote().
CEvaluationNodeCall::CEvaluationNodeCall | ( | const CEvaluationNodeCall & | src | ) |
Copy constructor
const | CEvaluationNodeCall & src |
Definition at line 78 of file CEvaluationNodeCall.cpp.
References buildParameters(), mCallNodes, and mpCallParameters.
|
virtual |
|
virtual |
Add a child to a node. If pAfter == this the child will be inserted at the front of the list of children.
CCopasiNode< | Data > * pChild |
CCopasiNode< | Data > * pAfter (default: NULL appended to the list of children) |
Reimplemented from CCopasiNode< std::string >.
Definition at line 465 of file CEvaluationNodeCall.cpp.
References CCopasiNode< _Data >::addChild(), and mCallNodes.
Referenced by SBMLImporter::createCReactionFromReaction(), CSBMLExporter::createKineticExpression(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeCall(), and test_compare_utilities::test_copasi_function_expansion().
|
staticprivate |
Build the list of call parameters which correspond to the list of call nodes.
Definition at line 503 of file CEvaluationNodeCall.cpp.
References CEvaluationNode::type(), and CEvaluationNode::VECTOR.
Referenced by CEvaluationNodeCall(), and compile().
Calculate the numerical result of the node. It is assumed that all child nodes are up to date.
Reimplemented from CEvaluationNode.
Definition at line 91 of file CEvaluationNodeCall.cpp.
References CExpression::calcValue(), CFunction::calcValue(), EXPRESSION, FUNCTION, mpCallParameters, mpExpression, mpFunction, CEvaluationNode::mType, and CEvaluationNode::mValue.
bool CEvaluationNodeCall::calls | ( | std::set< std::string > & | list | ) | const |
Check whether node the calls any tree in the list
std::set< | std::string > & list |
Definition at line 196 of file CEvaluationNodeCall.cpp.
References CEvaluationTree::calls(), CFunctionDB::findFunction(), CCopasiRootContainer::getFunctionList(), and CCopasiNode< std::string >::mData.
|
staticprivate |
Clear the list of call parameters.
Definition at line 524 of file CEvaluationNodeCall.cpp.
References CEvaluationNode::type(), and CEvaluationNode::VECTOR.
Referenced by compile().
|
virtual |
Compile a node;
const | CEvaluationTree * pTree |
Reimplemented from CEvaluationNode.
Definition at line 109 of file CEvaluationNodeCall.cpp.
References buildParameters(), CEvaluationNode::CALL, clearParameters(), CExpression::compile(), EXPRESSION, CFunctionDB::findFunction(), FUNCTION, CCopasiObject::getCN(), CCopasiRootContainer::getFunctionList(), CCopasiContainer::getObject(), CCopasiRootContainer::getRoot(), CFunction::getVariables(), mCallNodes, CCopasiNode< std::string >::mData, mpCallParameters, mpExpression, mpFunction, mRegisteredFunctionCN, CEvaluationNode::mType, and verifyParameters().
|
static |
Creates a new CEvaluationNodeCall from an ASTNode and the given children
const | ASTNode* pNode |
const | std::vector< CEvaluationNode * > & children |
Definition at line 427 of file CEvaluationNodeCall.cpp.
References CEvaluationNode::addChildren(), CEvaluationNodeCall(), FUNCTION, and CEvaluationNode::subType().
Referenced by CEvaluationTree::fromAST().
|
virtual |
Retrieve the display string of the node and its eventual child nodes in Berkeley Madonna format.
Reimplemented from CEvaluationNode.
Definition at line 393 of file CEvaluationNodeCall.cpp.
References CCopasiNode< std::string >::mData, mQuotesRequired, and quote().
const CEvaluationTree * CEvaluationNodeCall::getCalledTree | ( | ) | const |
Retrieve the tree which is called from this node
Definition at line 567 of file CEvaluationNodeCall.cpp.
References EXPRESSION, CFunctionDB::findFunction(), FUNCTION, CCopasiRootContainer::getFunctionList(), CCopasiNode< std::string >::mData, and CEvaluationNode::mType.
Referenced by CMathTrigger::compileFUNCTION(), CMathContainer::copyBranch(), CFunctionAnalyzer::evaluateNode(), CODEExporter::exportExpression(), isBoolean(), test000042::test_hasOnlySubstanceUnits(), and test000043::test_hasOnlySubstanceUnits().
|
virtual |
Retrieve the display string of the node and its eventual child nodes in C.
Reimplemented from CEvaluationNode.
Definition at line 345 of file CEvaluationNodeCall.cpp.
References EXPRESSION, FUNCTION, getData(), CCopasiNode< std::string >::mData, mQuotesRequired, CEvaluationNode::mType, and quote().
|
virtual |
Retrieve the value of the node.
Reimplemented from CCopasiNode< std::string >.
Definition at line 209 of file CEvaluationNodeCall.cpp.
References CCopasiObject::getObjectName(), CEvaluationNode::isKeyword(), CCopasiNode< std::string >::mData, mpExpression, mpFunction, mQuotesRequired, quote(), and unQuote().
Referenced by expand_function_call(), getCCodeString(), getInfix(), getMMLString(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeCall(), test000043::test_hasOnlySubstanceUnits(), test000042::test_hasOnlySubstanceUnits(), test000075::test_import_time_dependent_function_definition(), test000078::test_l2v4_import_unordered_functions(), and toAST().
|
virtual |
Retrieve the display string of the node and its eventual child nodes.
Reimplemented from CEvaluationNode.
Definition at line 305 of file CEvaluationNodeCall.cpp.
References EXPRESSION, FUNCTION, CCopasiNode< std::string >::mData, mQuotesRequired, CEvaluationNode::mType, and quote().
|
virtual |
Retrieve the infix value of the node and its eventual child nodes.
Reimplemented from CEvaluationNode.
Definition at line 262 of file CEvaluationNodeCall.cpp.
References EXPRESSION, FUNCTION, getData(), mQuotesRequired, CEvaluationNode::mType, and quote().
|
inline |
returns the vector of child nodes, corresponding to the arguments of a function call
Definition at line 188 of file CEvaluationNodeCall.h.
References mCallNodes.
Referenced by CFunctionAnalyzer::evaluateNode(), and CEvaluationNodeNormalizer::normalizeCEvaluationNodeCall().
|
virtual |
Build the MathML string
const | std::vector< std::string > & children |
bool | expand = true |
const | std::vector< std::vector< std::string > > & variables |
Reimplemented from CEvaluationNode.
Definition at line 583 of file CEvaluationNodeCall.cpp.
References EXPRESSION, CMathMl::fixName(), FUNCTION, getData(), mpFunction, mQuotesRequired, CEvaluationNode::mType, quote(), and CFunction::writeMathML().
|
virtual |
Retrieve the display string of the node and its eventual child nodes in XPPAUT format.
Reimplemented from CEvaluationNode.
Definition at line 410 of file CEvaluationNodeCall.cpp.
References CCopasiNode< std::string >::mData, mQuotesRequired, and quote().
|
virtual |
Check whether the result is Boolean
Reimplemented from CEvaluationNode.
Definition at line 665 of file CEvaluationNodeCall.cpp.
References getCalledTree(), and CEvaluationTree::isBoolean().
const bool & CEvaluationNodeCall::isBooleanRequired | ( | ) | const |
Check whether the result must be Boolean
Definition at line 661 of file CEvaluationNodeCall.cpp.
References mBooleanRequired.
|
virtual |
Remove a child from a node.
CCopasiNode< | Data > * pChild |
Reimplemented from CCopasiNode< std::string >.
Definition at line 490 of file CEvaluationNodeCall.cpp.
References mCallNodes, and CCopasiNode< _Data >::removeChild().
Referenced by CEvaluationNodeNormalizer::normalizeCEvaluationNodeCall().
void CEvaluationNodeCall::setBooleanRequired | ( | const bool & | booleanRequired | ) |
Set whether the result of the node must be Boolean
const | bool & booleanRequired |
Definition at line 658 of file CEvaluationNodeCall.cpp.
References mBooleanRequired.
|
virtual |
Set the data of the Node.
const | Data & data |
Reimplemented from CCopasiNode< std::string >.
Definition at line 241 of file CEvaluationNodeCall.cpp.
References CEvaluationNode::isKeyword(), CCopasiNode< std::string >::mData, mQuotesRequired, mRegisteredFunctionCN, quote(), and unQuote().
Referenced by CEvaluationNodeCall().
|
virtual |
Create a new ASTNode corresponding to this choice node.
Reimplemented from CEvaluationNode.
Definition at line 441 of file CEvaluationNodeCall.cpp.
References CCopasiNode< _Data >::addChild(), fatalError, CFunctionDB::findFunction(), CCopasiNode< std::string >::getChild(), getData(), CCopasiRootContainer::getFunctionList(), CFunction::getSBMLId(), CCopasiNode< _Data >::getSibling(), and CEvaluationNode::toAST().
|
staticprivate |
Verifies that the parameters match the function parameters.
const | std::vector<CEvaluationNode *> & vector |
const | CFunctionParameters & functionParameters |
Definition at line 546 of file CEvaluationNodeCall.cpp.
References CEvaluationNode::getType(), CFunctionParameters::size(), CEvaluationNode::type(), CEvaluationNode::VECTOR, and CFunctionParameter::VFLOAT64.
Referenced by compile().
|
private |
Definition at line 240 of file CEvaluationNodeCall.h.
Referenced by isBooleanRequired(), and setBooleanRequired().
|
private |
Definition at line 237 of file CEvaluationNodeCall.h.
Referenced by addChild(), CEvaluationNodeCall(), compile(), getListOfChildNodes(), and removeChild().
|
private |
Definition at line 238 of file CEvaluationNodeCall.h.
Referenced by calculate(), CEvaluationNodeCall(), and compile().
|
private |
Definition at line 236 of file CEvaluationNodeCall.h.
Referenced by calculate(), compile(), and getData().
|
private |
Definition at line 235 of file CEvaluationNodeCall.h.
Referenced by calculate(), compile(), getData(), and getMMLString().
|
mutableprivate |
Definition at line 239 of file CEvaluationNodeCall.h.
Referenced by CEvaluationNodeCall(), getBerkeleyMadonnaString(), getCCodeString(), getData(), getDisplayString(), getInfix(), getMMLString(), getXPPString(), and setData().
|
private |
The registered object name to track eventual renaming.
Definition at line 245 of file CEvaluationNodeCall.h.