COPASI API
4.16.103
|
#include <CEvaluationNodeFunction.h>
Public Types | |
enum | SubType { INVALID = 0x00FFFFFF, LOG = 0x00000000, LOG10 = 0x00000001, EXP = 0x00000002, SIN = 0x00000003, COS = 0x00000004, TAN = 0x00000005, SEC = 0x00000006, CSC = 0x00000007, COT = 0x00000008, SINH = 0x00000009, COSH = 0x0000000a, TANH = 0x0000000b, SECH = 0x0000000c, CSCH = 0x0000000d, COTH = 0x0000000e, ARCSIN = 0x0000000f, ARCCOS = 0x00000010, ARCTAN = 0x00000011, ARCSEC = 0x00000012, ARCCSC = 0x00000013, ARCCOT = 0x00000014, ARCSINH = 0x00000015, ARCCOSH = 0x00000016, ARCTANH = 0x00000017, ARCSECH = 0x00000018, ARCCSCH = 0x00000019, ARCCOTH = 0x0000001a, SQRT = 0x0000001b, ABS = 0x0000001c, FLOOR = 0x0000001d, CEIL = 0x0000001e, FACTORIAL = 0x0000001f, MINUS = 0x00000020, PLUS = 0x00000021, NOT = 0x00000022, RUNIFORM = 0x00000023, RNORMAL = 0x00000024, MAX = 0x00000025, MIN = 0x00000026, RGAMMA = 0x00000027, RPOISSON = 0x00000028 } |
![]() | |
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 () |
CEvaluationNodeFunction (const SubType &subType, const Data &data) | |
CEvaluationNodeFunction (const CEvaluationNodeFunction &src) | |
virtual bool | compile (const CEvaluationTree *pTree) |
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 |
virtual std::string | getXPPString (const std::vector< std::string > &children) const |
virtual bool | isBoolean () const |
virtual CEvaluationNode * | simplifyNode (const std::vector< CEvaluationNode * > &children) const |
virtual ASTNode * | toAST (const CCopasiDataModel *pDataModel) const |
virtual | ~CEvaluationNodeFunction () |
![]() | |
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 |
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 | |
CEvaluationNodeFunction () | |
std::string | handleNot (const std::string &str) const |
std::string | handleSign (const std::string &str) const |
Private Attributes | |
CEvaluationNode * | mpArg1 |
CEvaluationNode * | mpArg2 |
CEvaluationNode * | mpArg3 |
CEvaluationNode * | mpArg4 |
C_FLOAT64(* | mpFunction )(C_FLOAT64 arg1) |
C_FLOAT64(* | mpFunction2 )(const C_FLOAT64 &arg1, const C_FLOAT64 &arg2) |
C_FLOAT64(* | mpFunction4 )(const C_FLOAT64 &arg1, const C_FLOAT64 &arg2, const C_FLOAT64 &arg3, const C_FLOAT64 &arg4) |
Static Private Attributes | |
static CRandom * | mpRandom = NULL |
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 build-in functions used in an evaluation trees.
Definition at line 43 of file CEvaluationNodeFunction.h.
Enumeration of possible node types.
Definition at line 49 of file CEvaluationNodeFunction.h.
|
private |
Default constructor
Definition at line 61 of file CEvaluationNodeFunction.cpp.
References CEvaluationNode::mPrecedence, and PRECEDENCE_NUMBER.
Referenced by fromAST().
Default constructor
const | SubType & subType |
const | Data & data |
Definition at line 72 of file CEvaluationNodeFunction.cpp.
References ABS, acoth(), acsch(), ARCCOS, ARCCOSH, ARCCOT, arccot(), ARCCOTH, ARCCSC, arccsc(), ARCCSCH, ARCSEC, arcsec(), ARCSECH, ARCSIN, ARCSINH, ARCTAN, ARCTANH, asech(), CEIL, copasiNot(), COS, COSH, COT, cot(), COTH, coth(), CRandom::createGenerator(), CSC, csc(), CSCH, csch(), EXP, FACTORIAL, factorial(), fatalError, FLOOR, LOG, LOG10, MAX, max(), MIN, min(), MINUS, minus(), mpFunction, mpFunction2, mpRandom, CEvaluationNode::mPrecedence, NOT, PLUS, plus(), PRECEDENCE_FUNCTION, RGAMMA, rgamma(), RNORMAL, rnormal(), RPOISSON, rpoisson(), RUNIFORM, runiform(), SEC, sec(), SECH, sech(), SIN, SINH, SQRT, TAN, and TANH.
CEvaluationNodeFunction::CEvaluationNodeFunction | ( | const CEvaluationNodeFunction & | src | ) |
Copy constructor
const | CEvaluationNodeFunction & src |
Definition at line 274 of file CEvaluationNodeFunction.cpp.
|
virtual |
Definition at line 264 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 261 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 255 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 252 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 249 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 258 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Calculate the numerical result of the node. It is assumed that all child nodes are up to date.
Reimplemented from CEvaluationNode.
Definition at line 129 of file CEvaluationNodeFunction.h.
References CEvaluationNode::getValue(), mpArg1, mpArg2, mpArg3, mpArg4, mpFunction, mpFunction2, mpFunction4, and CEvaluationNode::mValue.
|
virtual |
Compile a node;
const | CEvaluationTree * pTree |
Reimplemented from CEvaluationNode.
Definition at line 287 of file CEvaluationNodeFunction.cpp.
References CCopasiNode< std::string >::getChild(), CCopasiNode< _Data >::getSibling(), mpArg1, mpArg2, mpArg3, mpArg4, mpFunction, and mpFunction2.
Referenced by getBerkeleyMadonnaString(), getCCodeString(), getDisplayString(), getInfix(), and getXPPString().
Definition at line 293 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 237 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 246 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 234 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 243 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 267 of file CEvaluationNodeFunction.h.
References C_FLOAT64.
Referenced by CEvaluationNodeFunction().
|
static |
Creates a new CEvaluationNodeCall from an ASTNode and the given children
const | ASTNode* pNode |
const | std::vector< CEvaluationNode * > & children |
Replaces all root nodes with the corresponding power operator since COPASI does not have the ROOT function.
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.
Definition at line 767 of file CEvaluationNodeFunction.cpp.
References ABS, CCopasiNode< _Data >::addChild(), ARCCOS, ARCCOSH, ARCCOT, ARCCOTH, ARCCSC, ARCCSCH, ARCSEC, ARCSECH, ARCSIN, ARCSINH, ARCTAN, ARCTANH, CEIL, CEvaluationNodeFunction(), COS, COSH, COT, COTH, CSC, CSCH, CEvaluationNodeOperator::DIVIDE, CEvaluationNodeNumber::DOUBLE, EXP, FACTORIAL, fatalError, FLOOR, INVALID, LOG, LOG10, NOT, CEvaluationNodeOperator::POWER, SEC, SECH, SIN, SINH, SQRT, CEvaluationNode::subType(), TAN, TANH, 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 580 of file CEvaluationNodeFunction.cpp.
References ABS, ARCCOS, ARCCOSH, ARCCOT, ARCCOTH, ARCCSC, ARCCSCH, ARCSEC, ARCSECH, ARCSIN, ARCSINH, ARCTAN, ARCTANH, CEIL, compile(), COS, COSH, COT, COTH, CSC, CSCH, EXP, FACTORIAL, FLOOR, CEvaluationNode::getType(), LOG, LOG10, MAX, CCopasiNode< std::string >::mData, MIN, MINUS, CEvaluationNode::mType, NOT, PLUS, RGAMMA, RNORMAL, RPOISSON, RUNIFORM, SEC, SECH, SIN, SINH, SQRT, CEvaluationNode::subType(), TAN, and TANH.
|
virtual |
Retrieve the display string of the node and its eventual child nodes in C.
Reimplemented from CEvaluationNode.
Definition at line 376 of file CEvaluationNodeFunction.cpp.
References ABS, ARCCOS, ARCCOSH, ARCCOT, ARCCOTH, ARCCSC, ARCCSCH, ARCSEC, ARCSECH, ARCSIN, ARCSINH, ARCTAN, ARCTANH, CEIL, compile(), COS, COSH, COT, COTH, CSC, CSCH, EXP, FACTORIAL, FLOOR, CEvaluationNode::getType(), LOG, LOG10, MAX, MIN, MINUS, CEvaluationNode::mType, NOT, PLUS, RGAMMA, RNORMAL, RPOISSON, RUNIFORM, SEC, SECH, SIN, SINH, SQRT, CEvaluationNode::subType(), TAN, and TANH.
|
virtual |
Retrieve the display string of the node and its eventual child nodes.
Reimplemented from CEvaluationNode.
Definition at line 346 of file CEvaluationNodeFunction.cpp.
References compile(), handleNot(), handleSign(), MAX, CCopasiNode< std::string >::mData, MIN, MINUS, CEvaluationNode::mType, NOT, PLUS, RGAMMA, RNORMAL, RPOISSON, and RUNIFORM.
|
virtual |
Retrieve the infix value of the node and its eventual child nodes.
Reimplemented from CEvaluationNode.
Definition at line 316 of file CEvaluationNodeFunction.cpp.
References compile(), handleNot(), handleSign(), MAX, CCopasiNode< std::string >::mData, MIN, MINUS, CEvaluationNode::mType, NOT, PLUS, RGAMMA, RNORMAL, RPOISSON, and RUNIFORM.
CEvaluationNode * CEvaluationNodeFunction::getLeft | ( | ) |
const CEvaluationNode * CEvaluationNodeFunction::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 1431 of file CEvaluationNodeFunction.cpp.
References ABS, ARCCOS, ARCCOSH, ARCCOT, ARCCOTH, ARCCSC, ARCCSCH, ARCSEC, ARCSECH, ARCSIN, ARCSINH, ARCTAN, ARCTANH, CEvaluationNode::CALL, CEIL, CEvaluationNode::CONSTANT, COS, COSH, COT, COTH, CSC, CSCH, EXP, FACTORIAL, FLOOR, CCopasiNode< _Data >::getChild(), CCopasiNode< std::string >::getParent(), CEvaluationNode::getType(), INVALID, LOG, LOG10, MAX, CCopasiNode< std::string >::mData, MIN, MINUS, mpArg1, CEvaluationNode::mType, NOT, CEvaluationNode::NUMBER, CEvaluationNode::OPERATOR, PLUS, CEvaluationNodeOperator::POWER, RGAMMA, RNORMAL, RPOISSON, RUNIFORM, SEC, SECH, SIN, SINH, SQRT, TAN, TANH, CEvaluationNode::type(), and CEvaluationNode::VARIABLE.
|
virtual |
Retrieve the display string of the node and its eventual child nodes in XPPAUT format.
Reimplemented from CEvaluationNode.
Definition at line 672 of file CEvaluationNodeFunction.cpp.
References ABS, ARCCOS, ARCCOSH, ARCCOT, ARCCOTH, ARCCSC, ARCCSCH, ARCSEC, ARCSECH, ARCSIN, ARCSINH, ARCTAN, ARCTANH, CEIL, compile(), COS, COSH, COT, COTH, CSC, CSCH, EXP, FACTORIAL, FLOOR, CEvaluationNode::getType(), LOG, LOG10, MAX, CCopasiNode< std::string >::mData, MIN, MINUS, CEvaluationNode::mType, NOT, PLUS, RGAMMA, RNORMAL, RPOISSON, RUNIFORM, SEC, SECH, SIN, SINH, SQRT, CEvaluationNode::subType(), TAN, and TANH.
|
private |
Definition at line 1407 of file CEvaluationNodeFunction.cpp.
References CEvaluationNode::getType(), CEvaluationNode::LOGICAL, CCopasiNode< std::string >::mData, and mpArg1.
Referenced by getDisplayString(), and getInfix().
|
private |
Definition at line 1384 of file CEvaluationNodeFunction.cpp.
References CCopasiNode< std::string >::getParent(), CEvaluationNode::getType(), CCopasiNode< std::string >::mData, mpArg1, CEvaluationNode::OPERATOR, and CEvaluationNodeOperator::POWER.
Referenced by getDisplayString(), and getInfix().
|
virtual |
Check whether the result is Boolean
Reimplemented from CEvaluationNode.
Definition at line 1003 of file CEvaluationNodeFunction.cpp.
References CEvaluationNode::mType, NOT, and CEvaluationNode::subType().
Definition at line 50 of file CEvaluationNodeFunction.cpp.
References max.
Referenced by CEvaluationNodeFunction().
Definition at line 56 of file CEvaluationNodeFunction.cpp.
References min.
Referenced by CEvaluationNodeFunction().
Definition at line 287 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 290 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
|
staticprivate |
Definition at line 37 of file CEvaluationNodeFunction.cpp.
References CRandom::getRandomGamma(), and mpRandom.
Referenced by CEvaluationNodeFunction().
|
staticprivate |
Definition at line 33 of file CEvaluationNodeFunction.cpp.
References CRandom::getRandomNormal(), and mpRandom.
Referenced by CEvaluationNodeFunction().
Definition at line 44 of file CEvaluationNodeFunction.cpp.
References CRandom::getRandomPoisson(), and mpRandom.
Referenced by CEvaluationNodeFunction().
|
staticprivate |
Definition at line 29 of file CEvaluationNodeFunction.cpp.
References CRandom::getRandomOO(), and mpRandom.
Referenced by CEvaluationNodeFunction().
Definition at line 231 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
Definition at line 240 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction().
|
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 1277 of file CEvaluationNodeFunction.cpp.
References CCopasiNode< _Data >::addChild(), CEvaluationNode::copyBranch(), CEvaluationNode::copyNode(), CEvaluationNode::create(), CEvaluationNodeOperator::DIVIDE, CEvaluationNodeNumber::DOUBLE, CEvaluationNode::FUNCTION, MINUS, CEvaluationNode::mType, CEvaluationNode::NUMBER, CEvaluationNode::OPERATOR, CEvaluationNodeOperator::PLUS, CEvaluationNodeOperator::POWER, SQRT, CEvaluationNode::subType(), and CEvaluationNode::type().
|
virtual |
Create a new ASTNode corresponding to this FunctionNode.
Reimplemented from CEvaluationNode.
Definition at line 1015 of file CEvaluationNodeFunction.cpp.
References ABS, CCopasiNode< _Data >::addChild(), ARCCOS, ARCCOSH, ARCCOT, ARCCOTH, ARCCSC, ARCCSCH, ARCSEC, ARCSECH, ARCSIN, ARCSINH, ARCTAN, ARCTANH, CEIL, COS, COSH, COT, COTH, CSC, CSCH, EXP, FACTORIAL, FLOOR, CCopasiNode< std::string >::getChild(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::getType(), INVALID, LOG, LOG10, MAX, MIN, MINUS, NOT, PLUS, RGAMMA, RNORMAL, RPOISSON, RUNIFORM, SEC, SECH, SIN, SINH, SQRT, CEvaluationNode::subType(), TAN, TANH, and CEvaluationNode::toAST().
|
private |
Definition at line 325 of file CEvaluationNodeFunction.h.
Referenced by calculate(), compile(), getLeft(), getMMLString(), handleNot(), and handleSign().
|
private |
Definition at line 326 of file CEvaluationNodeFunction.h.
Referenced by calculate(), and compile().
|
private |
Definition at line 327 of file CEvaluationNodeFunction.h.
Referenced by calculate(), and compile().
|
private |
Definition at line 328 of file CEvaluationNodeFunction.h.
Referenced by calculate(), and compile().
Definition at line 315 of file CEvaluationNodeFunction.h.
Referenced by calculate(), CEvaluationNodeFunction(), and compile().
|
private |
Definition at line 317 of file CEvaluationNodeFunction.h.
Referenced by calculate(), CEvaluationNodeFunction(), and compile().
|
private |
Definition at line 320 of file CEvaluationNodeFunction.h.
Referenced by calculate().
|
staticprivate |
Definition at line 330 of file CEvaluationNodeFunction.h.
Referenced by CEvaluationNodeFunction(), rgamma(), rnormal(), rpoisson(), and runiform().