COPASI API
4.40.278
|
#include <CEvaluationNodeCall.h>
Public Member Functions | |
virtual bool | addChild (CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL) override |
virtual void | calculate () override |
bool | calls (std::set< std::string > &list) const |
CEvaluationNodeCall (const CEvaluationNodeCall &src) | |
CEvaluationNodeCall (const SubType &subType, const Data &data) | |
virtual CIssue | compile () override |
virtual std::string | getBerkeleyMadonnaString (const std::vector< std::string > &children) const override |
CFunction * | getCalledTree () |
const CFunction * | getCalledTree () const |
virtual std::string | getCCodeString (const std::vector< std::string > &children) const override |
virtual const Data & | getData () const override |
virtual std::string | getDisplayString (const std::vector< std::string > &children) const override |
virtual std::string | getInfix (const std::vector< std::string > &children) const override |
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 override |
virtual CValidatedUnit | getUnit (const CMathContainer &container, const std::vector< CValidatedUnit > &units) const override |
virtual std::string | getXPPString (const std::vector< std::string > &children) const override |
virtual bool | isBoolean () const override |
const bool & | isBooleanRequired () const |
virtual bool | removeChild (CCopasiNode< Data > *pChild) override |
virtual bool | setData (const Data &data) override |
virtual CValidatedUnit | setUnit (const CMathContainer &container, const std::map< CEvaluationNode *, CValidatedUnit > ¤tUnits, std::map< CEvaluationNode *, CValidatedUnit > &targetUnits) const override |
virtual CIssue | setValueType (const ValueType &valueType) override |
virtual ASTNode * | toAST (const CDataModel *pDataModel) const override |
virtual | ~CEvaluationNodeCall () |
Public Member Functions inherited from CEvaluationNode | |
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 CEvaluationTree * | getTree () const |
const C_FLOAT64 * | getValuePointer () const |
const ValueType & | getValueType () const |
const MainType & | mainType () const |
bool | operator!= (const CEvaluationNode &right) const |
bool | operator< (const CEvaluationNode &rhs) |
bool | operator< (const CEvaluationNode &right) const |
bool | operator== (const CEvaluationNode &right) const |
void | printRecursively () const |
void | printRecursively (std::ostream &os, int indent=0) const |
void | setTree (const CEvaluationTree *pTree) |
virtual CEvaluationNode * | simplifyNode (const std::vector< CEvaluationNode * > &children) const |
CEvaluationNode * | splitBranch (const CEvaluationNode *splitnode, bool left) const |
const SubType & | subType () const |
virtual | ~CEvaluationNode () |
Public Member Functions inherited from CCopasiNode< std::string > | |
virtual bool | addChild (CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL) |
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 |
virtual Data & | getData () |
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 bool | removeChild (CCopasiNode< Data > *pChild) |
virtual bool | setData (const Data &data) |
virtual | ~CCopasiNode () |
Static Public Member Functions | |
static CEvaluationNode * | fromAST (const ASTNode *pASTNode, const std::vector< CEvaluationNode * > &children) |
Static Public Member Functions inherited from CEvaluationNode | |
static CEvaluationNode * | create (const MainType &mainType, const SubType &subType, const std::string &data) |
static bool | isKeyword (const std::string &str) |
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 | |
std::vector< CEvaluationNode * > | mCallNodes |
SubType | mCompiledSubType |
CCallParameters< C_FLOAT64 > * | mpCallParameters |
CExpression * | mpExpression |
CFunction * | mpFunction |
bool | mQuotesRequired |
CRegisteredCommonName | mRegisteredFunctionCN |
This is the class for nodes presenting operators used in an evaluation trees.
|
private |
Default constructor
References CEvaluationNode::mPrecedence, and PRECEDENCE_NUMBER.
Referenced by fromAST().
Default constructor
const | SubType & subType |
const | Data & data |
References CEvaluationNode::EXPRESSION, fatalError, CEvaluationNode::FUNCTION, CEvaluationNode::mPrecedence, PRECEDENCE_FUNCTION, setData(), and CEvaluationNode::subType().
CEvaluationNodeCall::CEvaluationNodeCall | ( | const CEvaluationNodeCall & | src | ) |
Copy constructor
const | CEvaluationNodeCall & src |
References buildParameters(), mCallNodes, and mpCallParameters.
|
virtual |
Destructor
References clearParameters(), mCallNodes, and mpCallParameters.
|
overridevirtual |
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) |
References CCopasiNode< _Data >::addChild(), and mCallNodes.
Referenced by SBMLImporter::createCReactionFromReaction(), and CSBMLExporter::createKineticExpression().
|
staticprivate |
Build the list of call parameters which correspond to the list of call nodes.
References CCallParameters< Type >::begin(), CEvaluationNodeVector::getNodes(), and CEvaluationNode::VECTOR.
Referenced by CEvaluationNodeCall(), and compile().
|
overridevirtual |
Calculate the numerical result of the node. It is assumed that all child nodes are up to date.
Reimplemented from CEvaluationNode.
References CExpression::calcValue(), CFunction::calcValue(), CEvaluationNode::EXPRESSION, CEvaluationNode::FUNCTION, mCompiledSubType, mpCallParameters, mpExpression, mpFunction, 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 |
References CEvaluationTree::calls(), CFunctionDB::findFunction(), CRootContainer::getFunctionList(), and CCopasiNode< std::string >::mData.
Referenced by CEvaluationTree::calls().
|
staticprivate |
Clear the list of call parameters.
References CEvaluationNodeVector::getNodes(), and CEvaluationNode::VECTOR.
Referenced by compile(), and ~CEvaluationNodeCall().
|
overridevirtual |
Compile a node;
const | CEvaluationTree * pTree |
Reimplemented from CEvaluationNode.
References CEvaluationNode::Boolean, buildParameters(), CEvaluationNode::CALL, CIssue::CFunctionNotFound, clearParameters(), CEvaluationNode::DEFAULT, CIssue::Error, CEvaluationNode::EXPRESSION, fatalError, CFunctionDB::findFunction(), CEvaluationNode::FUNCTION, CDataObject::getCN(), CRootContainer::getFunctionList(), CDataContainer::getObject(), CRootContainer::getRoot(), CFunction::getVariables(), CEvaluationNode::INVALID, CEvaluationTree::isBoolean(), mCallNodes, mCompiledSubType, CCopasiNode< std::string >::mData, CEvaluationNode::mMainType, mpCallParameters, mpExpression, mpFunction, mRegisteredFunctionCN, CEvaluationNode::mSubType, CEvaluationNode::mValueType, setValueType(), CIssue::Success, CIssue::ValueTypeMismatch, CIssue::VariablesMismatch, and verifyParameters().
|
static |
Creates a new CEvaluationNodeCall from an ASTNode and the given children
const | ASTNode* pNode |
const | std::vector< CEvaluationNode * > & children |
References CEvaluationNode::addChildren(), CEvaluationNodeCall(), CEvaluationNode::FUNCTION, and CEvaluationNode::subType().
Referenced by CEvaluationTree::fromAST().
|
overridevirtual |
Retrieve the display string of the node and its eventual child nodes in Berkeley Madonna format.
Reimplemented from CEvaluationNode.
References CCopasiNode< std::string >::mData, mQuotesRequired, and quote().
CFunction * CEvaluationNodeCall::getCalledTree | ( | ) |
Retrieve the tree which is called from this node
References CEvaluationNode::EXPRESSION, CFunctionDB::findFunction(), CEvaluationNode::FUNCTION, CRootContainer::getFunctionList(), CCopasiNode< std::string >::mData, and CEvaluationNode::mSubType.
const CFunction * CEvaluationNodeCall::getCalledTree | ( | ) | const |
Retrieve the tree which is called from this node
References CEvaluationNode::EXPRESSION, CFunctionDB::findFunction(), CEvaluationNode::FUNCTION, CRootContainer::getFunctionList(), CCopasiNode< std::string >::mData, and CEvaluationNode::mSubType.
Referenced by CEvaluationTree::compileNodes(), CEvaluationTree::containsCN(), CMathContainer::copyBranch(), CDerive::deriveBranch(), CFunctionAnalyzer::evaluateNode(), CODEExporter::exportExpression(), CEvaluationTree::hasDiscontinuity(), isBoolean(), and CEvaluationTree::mapObjectNodes().
|
overridevirtual |
Retrieve the display string of the node and its eventual child nodes in C.
Reimplemented from CEvaluationNode.
References CEvaluationNode::EXPRESSION, CEvaluationNode::FUNCTION, getData(), CCopasiNode< std::string >::mData, mQuotesRequired, CEvaluationNode::mSubType, and quote().
|
overridevirtual |
Retrieve the value of the node.
Reimplemented from CCopasiNode< std::string >.
References CDataObject::getObjectName(), CEvaluationNode::isKeyword(), CCopasiNode< std::string >::mData, mpExpression, mpFunction, mQuotesRequired, quote(), and unQuote().
Referenced by getCCodeString(), getInfix(), and toAST().
|
overridevirtual |
Retrieve the display string of the node and its eventual child nodes.
Reimplemented from CEvaluationNode.
References CEvaluationNode::EXPRESSION, CEvaluationNode::FUNCTION, CCopasiNode< std::string >::mData, CEvaluationNode::mSubType, and quote().
|
overridevirtual |
Retrieve the infix value of the node and its eventual child nodes.
Reimplemented from CEvaluationNode.
References CEvaluationNode::DEFAULT, CEvaluationNode::EXPRESSION, CEvaluationNode::FUNCTION, getData(), CEvaluationNode::mSubType, and quote().
|
inline |
returns the vector of child nodes, corresponding to the arguments of a function call
References mCallNodes.
Referenced by CDerive::deriveBranch(), and CFunctionAnalyzer::evaluateNode().
|
overridevirtual |
Build the MathML string
const | std::vector< std::string > & children |
bool | expand = true |
const | std::vector< std::vector< std::string > > & variables |
Reimplemented from CEvaluationNode.
References CEvaluationNode::EXPRESSION, CMathMl::fixName(), CEvaluationNode::FUNCTION, CCopasiNode< std::string >::mData, mpFunction, CEvaluationNode::mSubType, quote(), and CFunction::writeMathML().
|
overridevirtual |
Figure out the appropriate CUnit to use, based on the child nodes. This sets the default, appropriate for many cases, as Dimensionless
const | CMathContainer & container |
const | std::vector< CValidatedUnit > & units |
Reimplemented from CEvaluationNode.
References CEvaluationNode::EXPRESSION, CEvaluationNode::FUNCTION, CUnitValidator::getUnit(), mpExpression, mpFunction, CEvaluationNode::mSubType, CBaseUnit::undefined, and CUnitValidator::validateUnits().
|
overridevirtual |
Retrieve the display string of the node and its eventual child nodes in XPPAUT format.
Reimplemented from CEvaluationNode.
References CCopasiNode< std::string >::mData, mQuotesRequired, and quote().
|
overridevirtual |
Check whether the result is Boolean
Reimplemented from CEvaluationNode.
References getCalledTree(), and CEvaluationTree::isBoolean().
const bool& CEvaluationNodeCall::isBooleanRequired | ( | ) | const |
Check whether the result must be Boolean
|
overridevirtual |
Remove a child from a node.
CCopasiNode< | Data > * pChild |
References mCallNodes, and CCopasiNode< _Data >::removeChild().
|
overridevirtual |
Set the data of the Node.
const | Data & data |
References CEvaluationNode::isKeyword(), CCopasiNode< std::string >::mData, mQuotesRequired, mRegisteredFunctionCN, quote(), and unQuote().
Referenced by CEvaluationNodeCall().
|
overridevirtual |
Set the unit for the node and return the resulting unit. The child node units are added to the map
const | CMathContainer & container |
const | std::map < CEvaluationNode * , CValidatedUnit > & currentUnits |
std::map | < CEvaluationNode * , CValidatedUnit > & targetUnits |
Reimplemented from CEvaluationNode.
References CEvaluationNode::EXPRESSION, CEvaluationNode::FUNCTION, CUnitValidator::getUnit(), CUnitValidator::getVariableUnits(), mCallNodes, CValidatedUnit::merge(), mpExpression, mpFunction, CEvaluationNode::mSubType, CEvaluationNode::setUnit(), CBaseUnit::undefined, and CUnitValidator::validateUnits().
Set the type the result of the node
const | ValueType & valueType |
Reimplemented from CEvaluationNode.
References CEvaluationNode::mValueType, CEvaluationNode::setValueType(), and CEvaluationNode::Unknown.
Referenced by compile().
|
overridevirtual |
Create a new ASTNode corresponding to this choice node.
Reimplemented from CEvaluationNode.
References CCopasiNode< _Data >::addChild(), fatalError, CFunctionDB::findFunction(), CCopasiNode< std::string >::getChild(), getData(), CRootContainer::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 |
References CFunctionParameters::size(), CEvaluationNode::VECTOR, and CFunctionParameter::VFLOAT64.
Referenced by compile().
|
private |
Referenced by addChild(), CEvaluationNodeCall(), compile(), getListOfChildNodes(), removeChild(), setUnit(), and ~CEvaluationNodeCall().
|
private |
Referenced by calculate(), and compile().
|
private |
Referenced by calculate(), CEvaluationNodeCall(), compile(), and ~CEvaluationNodeCall().
|
private |
Referenced by calculate(), compile(), getData(), getUnit(), and setUnit().
|
private |
Referenced by calculate(), compile(), getData(), getMMLString(), getUnit(), and setUnit().
|
mutableprivate |
Referenced by getBerkeleyMadonnaString(), getCCodeString(), getData(), getXPPString(), and setData().
|
private |