COPASI API
4.40.278
|
#include <CEvaluationNodeOperator.h>
Public Member Functions | |
virtual void | calculate () override |
CEvaluationNodeOperator (const CEvaluationNodeOperator &src) | |
CEvaluationNodeOperator (const SubType &subType, const Data &data) | |
virtual CIssue | compile () override |
bool | createModuloTree (const CEvaluationNodeOperator *pNode, ASTNode *pASTNode, const CDataModel *pDataModel) const |
virtual std::string | getBerkeleyMadonnaString (const std::vector< std::string > &children) const override |
virtual std::string | getCCodeString (const std::vector< std::string > &children) 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 |
CEvaluationNode * | getLeft () |
const CEvaluationNode * | getLeft () const |
virtual std::string | getMMLString (const std::vector< std::string > &children, bool expand, const std::vector< std::vector< std::string > > &variables) const override |
CEvaluationNode * | getRight () |
const CEvaluationNode * | getRight () const |
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 CValidatedUnit | setUnit (const CMathContainer &container, const std::map< CEvaluationNode *, CValidatedUnit > ¤tUnits, std::map< CEvaluationNode *, CValidatedUnit > &targetUnits) const override |
virtual CEvaluationNode * | simplifyNode (const std::vector< CEvaluationNode * > &children) const override |
virtual ASTNode * | toAST (const CDataModel *pDataModel) const override |
virtual | ~CEvaluationNodeOperator () |
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 |
virtual bool | isBoolean () 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 CIssue | setValueType (const ValueType &valueType) |
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 () |
virtual const Data & | getData () 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 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 Types | |
typedef void(CEvaluationNodeOperator::* | OPERATOR) () |
Private Member Functions | |
CEvaluationNodeOperator () | |
void | s_divide () |
void | s_invalid () |
void | s_minus () |
void | s_modulus () |
void | s_multiply () |
void | s_plus () |
void | s_power () |
void | s_remainder () |
Private Attributes | |
CEvaluationNode * | mpLeftNode |
const C_FLOAT64 * | mpLeftValue |
OPERATOR | mpOperator |
CEvaluationNode * | mpRightNode |
const C_FLOAT64 * | mpRightValue |
This is the class for nodes presenting operators used in an evaluation trees.
|
private |
|
private |
Default constructor
Referenced by fromAST().
Default constructor
const | SubType & subType |
const | Data & data |
References CEvaluationNode::DIVIDE, CEvaluationNode::MINUS, CEvaluationNode::MODULUS, mpOperator, CEvaluationNode::mPrecedence, CEvaluationNode::mSubType, CEvaluationNode::MULTIPLY, CEvaluationNode::mValueType, CEvaluationNode::Number, CEvaluationNode::PLUS, CEvaluationNode::POWER, PRECEDENCE_OPERATOR_DIVIDE, PRECEDENCE_OPERATOR_MINUS, PRECEDENCE_OPERATOR_MODULUS, PRECEDENCE_OPERATOR_MULTIPLY, PRECEDENCE_OPERATOR_PLUS, PRECEDENCE_OPERATOR_POWER, PRECEDENCE_OPERATOR_REMAINDER, CEvaluationNode::REMAINDER, s_divide(), s_minus(), s_modulus(), s_multiply(), s_plus(), s_power(), and s_remainder().
CEvaluationNodeOperator::CEvaluationNodeOperator | ( | const CEvaluationNodeOperator & | src | ) |
Copy constructor
const | CEvaluationNodeOperator & src |
|
virtual |
Destructor
|
overridevirtual |
Calculate the numerical result of the node. It is assumed that all child nodes are up to date.
Reimplemented from CEvaluationNode.
References mpOperator.
|
overridevirtual |
Compile a node;
const | CEvaluationTree * pTree |
Reimplemented from CEvaluationNode.
References CIssue::Error, CCopasiNode< std::string >::getChild(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::getValuePointer(), mpLeftNode, mpLeftValue, mpRightNode, mpRightValue, CEvaluationNode::Number, CEvaluationNode::setValueType(), CIssue::StructureInvalid, and CIssue::TooManyArguments.
Referenced by getBerkeleyMadonnaString(), getCCodeString(), getDisplayString(), getInfix(), and getXPPString().
bool CEvaluationNodeOperator::createModuloTree | ( | const CEvaluationNodeOperator * | pNode, |
ASTNode * | pASTNode, | ||
const CDataModel * | pDataModel | ||
) | const |
Convert our modulo to something SBML understands
const | CEvaluationNodeOperator* pNode the modulo operator node to be converted. |
const | ASTNode* pASTNode the root node for the SBML math expression |
References CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::MODULUS, CEvaluationNode::subType(), and CEvaluationNode::toAST().
Referenced by toAST().
|
static |
Creates a new CEvaluationNodeCall from an ASTNode and the given children
const | ASTNode* pNode |
const | std::vector< CEvaluationNode * > & children |
References CCopasiNode< _Data >::addChild(), CEvaluationNodeOperator(), CEvaluationNode::DIVIDE, CEvaluationNode::DOUBLE, CCopasiMessage::EXCEPTION, fatalError, CEvaluationNode::INVALID, MCMathML, CEvaluationNode::MINUS, CEvaluationNode::MULTIPLY, CEvaluationNode::PLUS, CEvaluationNode::POWER, 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 compile(), CCopasiNode< std::string >::mData, mpLeftNode, and mpRightNode.
|
overridevirtual |
Retrieve the display string of the node and its eventual child nodes in C.
Reimplemented from CEvaluationNode.
References compile(), CCopasiNode< std::string >::mData, CEvaluationNode::MODULUS, mpLeftNode, mpRightNode, CEvaluationNode::POWER, CEvaluationNode::REMAINDER, and CEvaluationNode::subType().
|
overridevirtual |
Retrieve the display string of the node and its eventual child nodes.
Reimplemented from CEvaluationNode.
References compile(), CCopasiNode< std::string >::mData, mpLeftNode, mpRightNode, CEvaluationNode::mSubType, and CEvaluationNode::REMAINDER.
|
overridevirtual |
Retrieve the infix value of the node and its eventual child nodes.
Reimplemented from CEvaluationNode.
References compile(), CCopasiNode< std::string >::mData, mpLeftNode, mpRightNode, CEvaluationNode::mSubType, and CEvaluationNode::REMAINDER.
CEvaluationNode * CEvaluationNodeOperator::getLeft | ( | ) |
References mpLeftNode.
Referenced by CDerive::deriveBranch().
const CEvaluationNode * CEvaluationNodeOperator::getLeft | ( | ) | const |
References mpLeftNode.
|
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::CALL, CEvaluationNode::DIVIDE, CEvaluationNode::mainType(), CEvaluationNode::MINUS, CEvaluationNode::MODULUS, mpLeftNode, mpRightNode, CEvaluationNode::mSubType, CEvaluationNode::MULTIPLY, CEvaluationNode::OPERATOR, CEvaluationNode::PLUS, CEvaluationNode::POWER, CEvaluationNode::REMAINDER, and CEvaluationNode::subType().
CEvaluationNode * CEvaluationNodeOperator::getRight | ( | ) |
References mpRightNode.
Referenced by CDerive::deriveBranch().
const CEvaluationNode * CEvaluationNodeOperator::getRight | ( | ) | const |
References mpRightNode.
|
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 CMathContainer::areObjectsConstant(), C_FLOAT64, CBaseUnit::dimensionless, CEvaluationNode::DIVIDE, CNodeContextIterator< Node, Context >::end(), CUnit::getComponents(), CMathContainer::getMathObject(), CEvaluationNode::getValuePointer(), CMathObject::isInitialValue(), CValidatedUnit::merge(), CEvaluationNode::MINUS, CEvaluationNode::MODULUS, mpRightNode, CEvaluationNode::mSubType, CEvaluationNode::MULTIPLY, CNodeContextIterator< Node, Context >::next(), CEvaluationNode::OBJECT, CEvaluationNode::PLUS, CEvaluationNode::POWER, CValidatedUnit::setConflict(), and CBaseUnit::undefined.
|
overridevirtual |
Retrieve the display string of the node and its eventual child nodes in XPPAUT format.
Reimplemented from CEvaluationNode.
References compile(), CCopasiNode< std::string >::mData, CEvaluationNode::MODULUS, mpLeftNode, mpRightNode, CEvaluationNode::REMAINDER, and CEvaluationNode::subType().
|
private |
References mpLeftValue, mpRightValue, and CEvaluationNode::mValue.
Referenced by CEvaluationNodeOperator().
|
private |
References CEvaluationNode::mValue.
|
private |
References mpLeftValue, mpRightValue, and CEvaluationNode::mValue.
Referenced by CEvaluationNodeOperator().
|
private |
References C_FLOAT64, C_INT32, mpLeftValue, mpRightValue, and CEvaluationNode::mValue.
Referenced by CEvaluationNodeOperator().
|
private |
References mpLeftValue, mpRightValue, and CEvaluationNode::mValue.
Referenced by CEvaluationNodeOperator().
|
private |
References mpLeftValue, mpRightValue, and CEvaluationNode::mValue.
Referenced by CEvaluationNodeOperator().
|
private |
References mpLeftValue, mpRightValue, and CEvaluationNode::mValue.
Referenced by CEvaluationNodeOperator().
|
private |
References mpLeftValue, mpRightValue, and CEvaluationNode::mValue.
Referenced by CEvaluationNodeOperator().
|
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 C_FLOAT64, CValidatedUnit::conflict(), CBaseUnit::dimensionless, CEvaluationNode::DIVIDE, CValidatedUnit::exponentiate(), CCopasiNode< _Data >::getChild(), CUnit::getComponents(), CEvaluationNode::getValuePointer(), min, CEvaluationNode::MINUS, CEvaluationNode::MODULUS, mpLeftNode, mpRightNode, CEvaluationNode::mSubType, CEvaluationNode::MULTIPLY, CEvaluationNode::PLUS, CEvaluationNode::POWER, CValidatedUnit::setConflict(), and CEvaluationNode::setUnit().
|
overridevirtual |
Create a simplified node for an operatorNode with children from vector (if not exist, = NULL), and assign new children
Reimplemented from CEvaluationNode.
References CCopasiNode< _Data >::addChild(), CEvaluationNode::buildInfix(), CEvaluationNode::copyBranch(), CEvaluationNode::copyNode(), CEvaluationNode::create(), CEvaluationNode::DIVIDE, CEvaluationNode::DOUBLE, fatalError, CEvaluationNode::FUNCTION, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CCopasiNode< std::string >::getSibling(), CEvaluationNode::getValuePointer(), CEvaluationNode::mainType(), CEvaluationNode::MINUS, CEvaluationNode::mSubType, CEvaluationNode::MULTIPLY, CEvaluationNode::NUMBER, CEvaluationNode::OPERATOR, CEvaluationNode::PLUS, CEvaluationNode::POWER, CEvaluationNode::simplifyNode(), and CEvaluationNode::subType().
|
overridevirtual |
Create a new ASTNode corresponding to this OperatorNode.
Reimplemented from CEvaluationNode.
References CCopasiNode< _Data >::addChild(), createModuloTree(), CEvaluationNode::DIVIDE, CCopasiNode< std::string >::getChild(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::INVALID, CEvaluationNode::MINUS, CEvaluationNode::MODULUS, CEvaluationNode::MULTIPLY, CEvaluationNode::PLUS, CEvaluationNode::POWER, CEvaluationNode::REMAINDER, CEvaluationNode::subType(), and CEvaluationNode::toAST().
|
private |
Referenced by compile(), getBerkeleyMadonnaString(), getCCodeString(), getDisplayString(), getInfix(), getLeft(), getMMLString(), getXPPString(), and setUnit().
|
private |
Referenced by compile(), s_divide(), s_minus(), s_modulus(), s_multiply(), s_plus(), s_power(), and s_remainder().
|
private |
Referenced by calculate(), and CEvaluationNodeOperator().
|
private |
Referenced by compile(), getBerkeleyMadonnaString(), getCCodeString(), getDisplayString(), getInfix(), getMMLString(), getRight(), getUnit(), getXPPString(), and setUnit().
|
private |
Referenced by compile(), s_divide(), s_minus(), s_modulus(), s_multiply(), s_plus(), s_power(), and s_remainder().