18 #include "sbml/math/ASTNode.h"
20 #include "sbml/util/List.h"
25 const size_t & right):
38 const std::string & contents)
121 {
return (
Type)(type & 0x00FFFFFF);}
124 {
return (
Type)(type & 0xFF000000);}
150 "arcsinh",
"ARCSINH",
151 "arccosh",
"ARCCOSH",
152 "arctanh",
"ARCTANH",
153 "arcsech",
"ARCSECH",
154 "arccsch",
"ARCCSCH",
155 "arccoth",
"ARCCOTH",
160 "factorial",
"FACTORIAL",
161 "uniform",
"UNIFORM",
164 "poisson",
"POISSON",
177 for (; *pKeyword != NULL; ++pKeyword)
178 if (!strcmp(str.c_str(), *pKeyword))
return true;
197 mValue(std::numeric_limits<
C_FLOAT64>::quiet_NaN()),
209 mPrecedence(src.mPrecedence)
225 std::string Infix =
"";
252 std::string DisplayString =
"";
270 return DisplayString;
282 std::string CCodeString =
"";
309 std::string BerkeleyMadonnaString =
"";
327 return BerkeleyMadonnaString;
336 std::string BerkeleyMadonnaString =
"";
354 return BerkeleyMadonnaString;
366 std::vector< CEvaluationNode * >::const_iterator it = children.begin();
367 std::vector< CEvaluationNode * >::const_iterator end = children.end();
369 for (; it != end; ++it)
380 std::vector<CEvaluationNode*> children;
382 if (child1 != NULL) children.push_back(child1);
384 if (child2 != NULL) children.push_back(child2);
392 std::vector<CEvaluationNode*>::const_iterator it = children.begin();
393 std::vector<CEvaluationNode*>::const_iterator endit = children.end();
409 while (itNode.
next() != itNode.
end())
422 assert(*itNode ==
this);
438 return new ASTNode();
447 const std::vector< std::vector< std::string > > & )
const
453 const std::vector< std::vector< std::string > > & variables)
const
455 std::string MMLString =
"";
483 for (i = 0; i < indent; ++i) os <<
" ";
485 os <<
"mData: " <<
mData << std::endl;
487 for (i = 0; i < indent; ++i) os <<
" ";
491 for (i = 0; i < indent; ++i) os <<
" ";
493 os <<
"mValue: " <<
mValue << std::endl;
513 if (splitnode ==
this)
517 if (!child)
return NULL;
527 if (!child)
return NULL;
549 std::vector<CEvaluationNode*> children;
552 while (child != NULL)
556 children.push_back(newchild);
560 children.push_back(NULL);
572 while (itNode.
next() != itNode.
end())
580 std::cout << itNode->
getData() << std::endl;
606 if (itNode.
context()[0] != NULL)
610 if (itNode.
context()[1] != NULL)
626 else if (itNode.
context()[1] != NULL)
668 return !(*
this == right);
676 while (itLeft.
next() != itLeft.
end() &&
677 itRight.
next() != itRight.
end())
679 if (*itLeft == NULL && *itRight == NULL)
684 if (*itLeft == NULL || *itRight == NULL)
736 while (result ==
false)
738 if (pChild1 == NULL || pChild2 == NULL)
740 if (pChild1 == NULL && pChild2 != NULL)
747 result = (*pChild1 < *pChild2);
bool operator<(const CEvaluationNode &right) const
virtual ASTNode * toAST(const CCopasiDataModel *pDataModel) const
const CEvaluationNode * findTopMinus(const std::vector< CFunctionAnalyzer::CValue > &callParameters) const
CEvaluationNode * copyBranch() const
virtual std::string getDisplayString(const std::vector< std::string > &children) const
virtual std::string getXPPString(const std::vector< std::string > &children) const
CPrecedence(const size_t &left=0, const size_t &right=0)
CCopasiNode< Data > * getSibling()
const C_FLOAT64 * getValuePointer() const
static CValue evaluateNode(const CEvaluationNode *node, const std::vector< CValue > &callParameters, Mode mode)
CEvaluationNode * copyNode(CEvaluationNode *child1, CEvaluationNode *child2) const
virtual bool operator!=(const CEvaluationNode &right) const
const Type & getType() const
static CEvaluationNode * create(const Type &type, const Data &data)
std::string buildInfix() const
virtual ~CEvaluationNode()
std::string buildCCodeString() const
const CNodeIteratorMode::State & next()
virtual std::string getInfix(const std::vector< std::string > &children) const
virtual std::string getMMLString(const std::vector< std::string > &children, bool expand, const std::vector< std::vector< std::string > > &variables) const
static bool isKeyword(const std::string &str)
void addChildren(const std::vector< CEvaluationNode * > &children)
static Type type(const Type &type)
std::string buildXPPString() const
std::string buildDisplayString() const
virtual bool addChild(CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
virtual std::string getBerkeleyMadonnaString(const std::vector< std::string > &children) const
void printRecursively() const
const CNodeIteratorMode::State & skipChildren()
Context * parentContextPtr()
std::string buildMMLString(bool expand, const std::vector< std::vector< std::string > > &variables) const
static Type subType(const Type &type)
void setProcessingModes(const CNodeIteratorMode::Flag &processingModes)
class CEvaluationNode::CPrecedence mPrecedence
virtual bool isBoolean() const
#define PRECEDENCE_DEFAULT
bool operator==(const CEvaluationNode &right) const
virtual bool compile(const CEvaluationTree *pTree)
const CNodeIteratorMode::State & processingMode() const
std::string buildBerkeleyMadonnaString() const
virtual CEvaluationNode * simplifyNode(const std::vector< CEvaluationNode * > &children) const
virtual const Data & getData() const
const C_FLOAT64 * mpValue
CNodeIteratorMode::State end() const
CCopasiNode< Data > * getChild()
virtual std::string getCCodeString(const std::vector< std::string > &children) const
CEvaluationNode * splitBranch(const CEvaluationNode *splitnode, bool left) const
static const char * Keywords[]