copasi API
0.1
|
#include <CEvaluationNode.h>
Classes | |
class | CPrecedence |
Public Types | |
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 } |
Public Member Functions | |
CEvaluationNode () | |
virtual bool | operator!= (const CEvaluationNode &right) const |
virtual bool | operator== (const CEvaluationNode &right) const |
virtual bool | operator< (const CEvaluationNode &right) const |
CEvaluationNode (const CEvaluationNode &src) | |
virtual | ~CEvaluationNode () |
virtual const C_FLOAT64 & | value () const |
virtual bool | compile (const CEvaluationTree *pTree) |
virtual std::string | getInfix () const |
virtual std::string | getDisplayString (const CEvaluationTree *pTree) const |
virtual std::string | getDisplay_C_String (const CEvaluationTree *pTree) const |
virtual std::string | getDisplay_MMD_String (const CEvaluationTree *pTree) const |
virtual std::string | getDisplay_XPP_String (const CEvaluationTree *pTree) const |
const Type & | getType () const |
virtual bool | isBoolean () const |
virtual ASTNode * | toAST (const CCopasiDataModel *pDataModel) const |
CEvaluationNode * | copyNode (CEvaluationNode *child1, CEvaluationNode *child2) const |
CEvaluationNode * | copyNode (const std::vector< CEvaluationNode * > &children) const |
CEvaluationNode * | copyBranch () const |
virtual CEvaluationNode * | simplifyNode (const std::vector< CEvaluationNode * > &children) const |
bool | operator< (const CEvaluationNode &rhs) |
const C_FLOAT64 * | getValuePointer () const |
virtual void | writeMathML (std::ostream &out, const std::vector< std::vector< std::string > > &env, bool expand=true, unsigned C_INT32 l=0) const |
void | printRecursively (std::ostream &os, int indent=0) const |
void | printRecursively () const |
CEvaluationNode * | splitBranch (const CEvaluationNode *splitnode, bool left) const |
const CEvaluationNode * | findTopMinus (const std::vector< CFunctionAnalyzer::CValue > &callParameters) const |
Static Public Member Functions | |
static CEvaluationNode * | create (const Type &type, const Data &data) |
static Type | subType (const Type &type) |
static Type | type (const Type &type) |
Protected Member Functions | |
CEvaluationNode (const Type &type, const Data &data) | |
Static Protected Member Functions | |
static void | replaceRoot (ConverterASTNode *sourceNode) |
static void | replaceLog (ConverterASTNode *sourceNode) |
Protected Attributes | |
Type | mType |
C_FLOAT64 | mValue |
class CEvaluationNode::CPrecedence | mPrecedence |
This is the base class for nodes used in an evaluation trees
CEvaluationNode::CEvaluationNode | ( | ) |
Default constructor
Specific constructor
const | Type & type |
const | Data & data |
CEvaluationNode::CEvaluationNode | ( | const CEvaluationNode & | src | ) |
Copy constructor
const | CEvaluationNode & src |
CEvaluationNode::~CEvaluationNode | ( | ) | [virtual] |
Destructor
bool CEvaluationNode::compile | ( | const CEvaluationTree * | pTree | ) | [virtual] |
Compile a node;
const | CEvaluationTree * pTree |
Reimplemented in CEvaluationNodeFunction, CEvaluationNodeLogical, CEvaluationNodeDelay, CEvaluationNodeOperator, CEvaluationNodeCall, CEvaluationNodeChoice, CEvaluationNodeObject, and CEvaluationNodeVariable.
CEvaluationNode * CEvaluationNode::copyBranch | ( | ) | const |
Copy the whole branch with this node as root.
CEvaluationNode * CEvaluationNode::copyNode | ( | CEvaluationNode * | child1, |
CEvaluationNode * | child2 | ||
) | const |
Copy a node and assign new children child1 and child2
CEvaluationNode * CEvaluationNode::copyNode | ( | const std::vector< CEvaluationNode * > & | children | ) | const |
Copy a node and assign new children in the vector
CEvaluationNode * CEvaluationNode::create | ( | const Type & | type, |
const Data & | data | ||
) | [static] |
Creates an evaluation node of type with the given data
const | Type & type |
const | Data & data |
const CEvaluationNode * CEvaluationNode::findTopMinus | ( | const std::vector< CFunctionAnalyzer::CValue > & | callParameters | ) | const |
Find a minus operator in the tree that is suitable for splitting with splitBranch(). Specifically it is a minus operator that is connected with the root node by multiplication or division nodes only. For the division nodes only the left child is considered.
std::string CEvaluationNode::getDisplay_C_String | ( | const CEvaluationTree * | pTree | ) | const [virtual] |
Retrieve the display string of the node and its eventual child nodes in C.
Reimplemented in CEvaluationNodeFunction, CEvaluationNodeLogical, CEvaluationNodeOperator, CEvaluationNodeObject, CEvaluationNodeCall, CEvaluationNodeChoice, CEvaluationNodeVector, CEvaluationNodeConstant, and CEvaluationNodeDelay.
std::string CEvaluationNode::getDisplay_MMD_String | ( | const CEvaluationTree * | pTree | ) | const [virtual] |
Retrieve the display string of the node and its eventual child nodes in Berkeley Madonna format.
Reimplemented in CEvaluationNodeFunction, CEvaluationNodeLogical, CEvaluationNodeOperator, CEvaluationNodeObject, CEvaluationNodeCall, CEvaluationNodeChoice, CEvaluationNodeVector, CEvaluationNodeConstant, and CEvaluationNodeDelay.
std::string CEvaluationNode::getDisplay_XPP_String | ( | const CEvaluationTree * | pTree | ) | const [virtual] |
Retrieve the display string of the node and its eventual child nodes in XPPAUT format.
Reimplemented in CEvaluationNodeFunction, CEvaluationNodeLogical, CEvaluationNodeOperator, CEvaluationNodeObject, CEvaluationNodeCall, CEvaluationNodeChoice, CEvaluationNodeVector, CEvaluationNodeConstant, and CEvaluationNodeDelay.
std::string CEvaluationNode::getDisplayString | ( | const CEvaluationTree * | pTree | ) | const [virtual] |
Retrieve the display string of the node and its eventual child nodes.
Reimplemented in CEvaluationNodeFunction, CEvaluationNodeLogical, CEvaluationNodeOperator, CEvaluationNodeObject, CEvaluationNodeCall, CEvaluationNodeChoice, CEvaluationNodeVector, and CEvaluationNodeDelay.
std::string CEvaluationNode::getInfix | ( | ) | const [virtual] |
Retrieve the infix value of the node and its eventual child nodes.
Reimplemented in CEvaluationNodeFunction, CEvaluationNodeLogical, CEvaluationNodeDelay, CEvaluationNodeOperator, CEvaluationNodeObject, CEvaluationNodeCall, CEvaluationNodeChoice, and CEvaluationNodeVector.
const CEvaluationNode::Type & CEvaluationNode::getType | ( | ) | const |
const C_FLOAT64 * CEvaluationNode::getValuePointer | ( | ) | const |
Retrieve the pointer to the value of the node
bool CEvaluationNode::isBoolean | ( | ) | const [virtual] |
Check whether the result is Boolean
Reimplemented in CEvaluationNodeCall, CEvaluationNodeFunction, CEvaluationNodeLogical, and CEvaluationNodeConstant.
bool CEvaluationNode::operator!= | ( | const CEvaluationNode & | right | ) | const [virtual] |
Unequal operator, compares two CEvaluationNode objects and return true if they are equal.
bool CEvaluationNode::operator< | ( | const CEvaluationNode & | right | ) | const [virtual] |
Less operator, compares two CEvaluationNode objects and return true if the first operand is smaller than the second.
bool CEvaluationNode::operator< | ( | const CEvaluationNode & | rhs | ) |
Comparison operator used to evaluate the precedence of the node. it compares the right precedence of the left node with the left precedence of the right node.
const | CEvaluationNode & rhs; |
bool CEvaluationNode::operator== | ( | const CEvaluationNode & | right | ) | const [virtual] |
Equals operator, compares two CEvaluationNode objects and return true if they are equal.
void CEvaluationNode::printRecursively | ( | std::ostream & | os, |
int | indent = 0 |
||
) | const |
void CEvaluationNode::printRecursively | ( | ) | const |
void CEvaluationNode::replaceLog | ( | ConverterASTNode * | sourceNode | ) | [static, protected] |
Replaces all LOG10 (AST_FUNCTION_LOG) nodes that have two children with the quotient of two LOG10 nodes with the base as the argument for the divisor LOG10 node.
void CEvaluationNode::replaceRoot | ( | ConverterASTNode * | sourceNode | ) | [static, protected] |
Replaces all root nodes with the corresponding power operator since COPASI does not have the ROOT function.
CEvaluationNode * CEvaluationNode::simplifyNode | ( | const std::vector< CEvaluationNode * > & | children | ) | const [virtual] |
Create a simplified node from the original node with children child1 and child2 (if not exist, = NULL)
Reimplemented in CEvaluationNodeFunction, and CEvaluationNodeOperator.
CEvaluationNode * CEvaluationNode::splitBranch | ( | const CEvaluationNode * | splitnode, |
bool | left | ||
) | const |
Split the tree in two parts at the given splitnode, starting from *this. Returned is the root node of a copy of the tree, including everything above the split node and either the branch below the left child of the split node or the branch below the right child of the split node. The split node itself is not included either case.
CEvaluationNode::Type CEvaluationNode::subType | ( | const Type & | type | ) | [static] |
Retrieve the subtype part of type
const | Type & type |
ASTNode * CEvaluationNode::toAST | ( | const CCopasiDataModel * | pDataModel | ) | const [virtual] |
Create a new invalid ASTNode.
Reimplemented in CEvaluationNodeFunction, CEvaluationNodeLogical, CEvaluationNodeOperator, CEvaluationNodeObject, CEvaluationNodeCall, CEvaluationNodeChoice, CEvaluationNodeVector, CEvaluationNodeConstant, CEvaluationNodeDelay, CEvaluationNodeVariable, CEvaluationNodeNumber, CEvaluationNodeStructure, and CEvaluationNodeWhiteSpace.
CEvaluationNode::Type CEvaluationNode::type | ( | const Type & | type | ) | [static] |
Retrieve the type part of type
const | Type & type |
virtual const C_FLOAT64& CEvaluationNode::value | ( | ) | const [inline, virtual] |
Retrieve the value of the node
Reimplemented in CEvaluationNodeFunction, CEvaluationNodeObject, CEvaluationNodeLogical, CEvaluationNodeCall, CEvaluationNodeOperator, CEvaluationNodeChoice, CEvaluationNodeVariable, CEvaluationNodeVector, and CEvaluationNodeDelay.
void CEvaluationNode::writeMathML | ( | std::ostream & | out, |
const std::vector< std::vector< std::string > > & | env, | ||
bool | expand = true , |
||
unsigned C_INT32 | l = 0 |
||
) | const [virtual] |
generate display MathML recursively
Reimplemented in CEvaluationNodeFunction, CEvaluationNodeLogical, CEvaluationNodeOperator, CEvaluationNodeCall, CEvaluationNodeObject, CEvaluationNodeChoice, CEvaluationNodeConstant, CEvaluationNodeDelay, CEvaluationNodeVariable, and CEvaluationNodeNumber.
class CEvaluationNode::CPrecedence
CEvaluationNode::mPrecedence [protected] |
Type CEvaluationNode::mType [protected] |
The type the node
C_FLOAT64 CEvaluationNode::mValue [protected] |
The numerical value of the node