COPASI API
4.16.103
|
#include <CEvaluationNodeOperator.h>
Public Types | |
enum | SubType { INVALID = 0x00FFFFFF, POWER = 0x00000000, MULTIPLY = 0x00000001, DIVIDE = 0x00000002, MODULUS = 0x00000003, PLUS = 0x00000004, MINUS = 0x00000005 } |
![]() | |
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 void | calculate () |
CEvaluationNodeOperator (const SubType &subType, const Data &data) | |
CEvaluationNodeOperator (const CEvaluationNodeOperator &src) | |
virtual bool | compile (const CEvaluationTree *pTree) |
bool | createModuloTree (const CEvaluationNodeOperator *pNode, ASTNode *pASTNode, const CCopasiDataModel *pDataModel) const |
virtual std::string | getBerkeleyMadonnaString (const std::vector< std::string > &children) const |
virtual std::string | getCCodeString (const std::vector< std::string > &children) const |
virtual std::string | getDisplayString (const std::vector< std::string > &children) const |
virtual std::string | getInfix (const std::vector< std::string > &children) const |
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 |
CEvaluationNode * | getRight () |
const CEvaluationNode * | getRight () const |
virtual std::string | getXPPString (const std::vector< std::string > &children) const |
virtual CEvaluationNode * | simplifyNode (const std::vector< CEvaluationNode * > &children) const |
virtual ASTNode * | toAST (const CCopasiDataModel *pDataModel) const |
virtual | ~CEvaluationNodeOperator () |
![]() | |
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 | isBoolean () 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 |
CEvaluationNode * | splitBranch (const CEvaluationNode *splitnode, bool left) const |
virtual | ~CEvaluationNode () |
![]() | |
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 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 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 | |
CEvaluationNodeOperator () | |
Private Attributes | |
CEvaluationNode * | mpLeft |
CEvaluationNode * | mpRight |
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 32 of file CEvaluationNodeOperator.h.
Enumeration of possible node types.
Enumerator | |
---|---|
INVALID | |
POWER | |
MULTIPLY | |
DIVIDE | |
MODULUS | |
PLUS | |
MINUS |
Definition at line 38 of file CEvaluationNodeOperator.h.
|
private |
Default constructor
Definition at line 21 of file CEvaluationNodeOperator.cpp.
Referenced by fromAST().
Default constructor
const | SubType & subType |
const | Data & data |
Definition at line 27 of file CEvaluationNodeOperator.cpp.
References DIVIDE, MINUS, MODULUS, CEvaluationNode::mPrecedence, CEvaluationNode::mType, MULTIPLY, PLUS, POWER, PRECEDENCE_OPERATOR_DIVIDE, PRECEDENCE_OPERATOR_MINUS, PRECEDENCE_OPERATOR_MODULUS, PRECEDENCE_OPERATOR_MULTIPLY, PRECEDENCE_OPERATOR_PLUS, and PRECEDENCE_OPERATOR_POWER.
CEvaluationNodeOperator::CEvaluationNodeOperator | ( | const CEvaluationNodeOperator & | src | ) |
Copy constructor
const | CEvaluationNodeOperator & src |
Definition at line 64 of file CEvaluationNodeOperator.cpp.
|
virtual |
Calculate the numerical result of the node. It is assumed that all child nodes are up to date.
Reimplemented from CEvaluationNode.
Definition at line 80 of file CEvaluationNodeOperator.h.
References C_FLOAT64, C_INT32, DIVIDE, CEvaluationNode::getValue(), MINUS, MODULUS, mpLeft, mpRight, CEvaluationNode::mType, MULTIPLY, CEvaluationNode::mValue, PLUS, and POWER.
|
virtual |
Compile a node;
const | CEvaluationTree * pTree |
Reimplemented from CEvaluationNode.
Definition at line 72 of file CEvaluationNodeOperator.cpp.
References CCopasiNode< std::string >::getChild(), CCopasiNode< _Data >::getSibling(), mpLeft, and mpRight.
Referenced by CDerive::deriveBranch(), getBerkeleyMadonnaString(), getCCodeString(), getDisplayString(), getInfix(), and getXPPString().
bool CEvaluationNodeOperator::createModuloTree | ( | const CEvaluationNodeOperator * | pNode, |
ASTNode * | pASTNode, | ||
const CCopasiDataModel * | 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 |
Definition at line 1302 of file CEvaluationNodeOperator.cpp.
References CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::getType(), 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 |
Definition at line 257 of file CEvaluationNodeOperator.cpp.
References CCopasiNode< _Data >::addChild(), CEvaluationNodeOperator(), DIVIDE, CEvaluationNodeNumber::DOUBLE, CCopasiMessage::EXCEPTION, fatalError, INVALID, MCMathML, MINUS, CEvaluationNodeFunction::MINUS, MULTIPLY, PLUS, POWER, CEvaluationNode::subType(), and CEvaluationNode::type().
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 184 of file CEvaluationNodeOperator.cpp.
References compile(), CCopasiNode< std::string >::mData, mpLeft, and mpRight.
|
virtual |
Retrieve the display string of the node and its eventual child nodes in C.
Reimplemented from CEvaluationNode.
Definition at line 136 of file CEvaluationNodeOperator.cpp.
References compile(), CEvaluationNode::getType(), CCopasiNode< std::string >::mData, MODULUS, mpLeft, mpRight, POWER, and CEvaluationNode::subType().
|
virtual |
Retrieve the display string of the node and its eventual child nodes.
Reimplemented from CEvaluationNode.
Definition at line 111 of file CEvaluationNodeOperator.cpp.
References compile(), CCopasiNode< std::string >::mData, mpLeft, and mpRight.
|
virtual |
Retrieve the infix value of the node and its eventual child nodes.
Reimplemented from CEvaluationNode.
Definition at line 86 of file CEvaluationNodeOperator.cpp.
References compile(), CCopasiNode< std::string >::mData, mpLeft, and mpRight.
CEvaluationNode * CEvaluationNodeOperator::getLeft | ( | ) |
Definition at line 1387 of file CEvaluationNodeOperator.cpp.
References mpLeft.
Referenced by CDerive::deriveBranch(), and CFindDimensions::findDimension().
const CEvaluationNode * CEvaluationNodeOperator::getLeft | ( | ) | const |
|
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 1399 of file CEvaluationNodeOperator.cpp.
References CEvaluationNode::CALL, DIVIDE, CEvaluationNode::getType(), MINUS, MODULUS, mpLeft, mpRight, CEvaluationNode::mType, MULTIPLY, CEvaluationNode::OPERATOR, PLUS, and POWER.
CEvaluationNode * CEvaluationNodeOperator::getRight | ( | ) |
Definition at line 1391 of file CEvaluationNodeOperator.cpp.
References mpRight.
Referenced by CDerive::deriveBranch(), and CFindDimensions::findDimension().
const CEvaluationNode * CEvaluationNodeOperator::getRight | ( | ) | const |
|
virtual |
Retrieve the display string of the node and its eventual child nodes in XPPAUT format.
Reimplemented from CEvaluationNode.
Definition at line 216 of file CEvaluationNodeOperator.cpp.
References compile(), CEvaluationNode::getType(), CCopasiNode< std::string >::mData, MODULUS, mpLeft, mpRight, and CEvaluationNode::subType().
|
virtual |
Create a simplified node for an operatorNode with children from vector (if not exist, = NULL), and assign new children
Reimplemented from CEvaluationNode.
Definition at line 462 of file CEvaluationNodeOperator.cpp.
References CCopasiNode< _Data >::addChild(), CEvaluationNode::buildInfix(), CEvaluationNode::copyBranch(), CEvaluationNode::copyNode(), CEvaluationNode::create(), DIVIDE, CEvaluationNodeNumber::DOUBLE, CEvaluationNode::FUNCTION, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CCopasiNode< std::string >::getSibling(), CEvaluationNode::getType(), CEvaluationNode::getValue(), MINUS, CEvaluationNodeFunction::MINUS, CEvaluationNode::mType, MULTIPLY, CEvaluationNode::NUMBER, CEvaluationNode::OPERATOR, PLUS, POWER, CEvaluationNode::simplifyNode(), CEvaluationNode::subType(), and CEvaluationNode::type().
|
virtual |
Create a new ASTNode corresponding to this OperatorNode.
Reimplemented from CEvaluationNode.
Definition at line 404 of file CEvaluationNodeOperator.cpp.
References CCopasiNode< _Data >::addChild(), createModuloTree(), DIVIDE, CCopasiNode< std::string >::getChild(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::getType(), INVALID, MINUS, MODULUS, MULTIPLY, PLUS, POWER, CEvaluationNode::subType(), and CEvaluationNode::toAST().
|
private |
Definition at line 205 of file CEvaluationNodeOperator.h.
Referenced by calculate(), compile(), getBerkeleyMadonnaString(), getCCodeString(), getDisplayString(), getInfix(), getLeft(), getMMLString(), and getXPPString().
|
private |
Definition at line 207 of file CEvaluationNodeOperator.h.
Referenced by calculate(), compile(), getBerkeleyMadonnaString(), getCCodeString(), getDisplayString(), getInfix(), getMMLString(), getRight(), and getXPPString().