COPASI API  4.40.278
CEvaluationNodeOperator Class Reference

#include <CEvaluationNodeOperator.h>

Inheritance diagram for CEvaluationNodeOperator:
[legend]

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
 
CEvaluationNodegetLeft ()
 
const CEvaluationNodegetLeft () const
 
virtual std::string getMMLString (const std::vector< std::string > &children, bool expand, const std::vector< std::vector< std::string > > &variables) const override
 
CEvaluationNodegetRight ()
 
const CEvaluationNodegetRight () 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 > &currentUnits, std::map< CEvaluationNode *, CValidatedUnit > &targetUnits) const override
 
virtual CEvaluationNodesimplifyNode (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)
 
CEvaluationNodecopyBranch () const
 
CEvaluationNodecopyNode (CEvaluationNode *child1, CEvaluationNode *child2) const
 
CEvaluationNodecopyNode (const std::vector< CEvaluationNode * > &children) const
 
const CEvaluationNodefindTopMinus (const std::vector< CFunctionAnalyzer::CValue > &callParameters) const
 
const CEvaluationTreegetTree () const
 
const C_FLOAT64getValuePointer () const
 
const ValueTypegetValueType () const
 
virtual bool isBoolean () const
 
const MainTypemainType () 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)
 
CEvaluationNodesplitBranch (const CEvaluationNode *splitnode, bool left) const
 
const SubTypesubType () 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 DatagetData ()
 
virtual const DatagetData () 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 CEvaluationNodefromAST (const ASTNode *pASTNode, const std::vector< CEvaluationNode * > &children)
 
- Static Public Member Functions inherited from CEvaluationNode
static CEvaluationNodecreate (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

CEvaluationNodempLeftNode
 
const C_FLOAT64mpLeftValue
 
OPERATOR mpOperator
 
CEvaluationNodempRightNode
 
const C_FLOAT64mpRightValue
 

Additional Inherited Members

- Public Types inherited from CEvaluationNode
enum class  MainType {
  INVALID , NUMBER , CONSTANT , OPERATOR ,
  OBJECT , FUNCTION , CALL , STRUCTURE ,
  CHOICE , VARIABLE , WHITESPACE , LOGICAL ,
  MV_FUNCTION , VECTOR , DELAY , UNIT ,
  __SIZE
}
 
enum class  SubType {
  DEFAULT , DELAY , IF , VECTOR ,
  CN , DOUBLE , FUNCTION , LOG ,
  OPEN , PI , POWER , EXPRESSION ,
  POINTER , EXPONENTIALE , INTEGER , LOG10 ,
  MULTIPLY , OR , VECTOROPEN , COMMA ,
  DIVIDE , ENOTATION , EXP , True ,
  XOR , RATIONALE , AND , CLOSE ,
  False , MODULUS , SIN , VECTORCLOSE ,
  COS , EQ , Infinity , PLUS ,
  NaN , MINUS , NE , TAN ,
  REMAINDER , GT , SEC , CSC ,
  GE , COT , LT , LE ,
  SINH , COSH , TANH , SECH ,
  CSCH , COTH , ARCSIN , ARCCOS ,
  ARCTAN , ARCSEC , ARCCSC , ARCCOT ,
  ARCSINH , ARCCOSH , ARCTANH , ARCSECH ,
  ARCCSCH , ARCCOTH , SQRT , ABS ,
  FLOOR , CEIL , FACTORIAL , NOT ,
  RUNIFORM , RNORMAL , MAX , MIN ,
  RGAMMA , RPOISSON , SIGN , AVOGADRO ,
  INVALID , __SIZE
}
 
enum class  ValueType { Unknown , Boolean , Number , __SIZE }
 
- Public Types inherited from CCopasiNode< std::string >
typedef std::string Data
 
- Static Public Attributes inherited from CEvaluationNode
static const CEnumAnnotation< std::string, MainTypeMainTypeName
 
static const CEnumAnnotation< std::string, SubTypeSubTypeName
 
- Protected Member Functions inherited from CEvaluationNode
 CEvaluationNode (const MainType &type, const SubType &subType, const Data &data)
 
- Protected Member Functions inherited from CCopasiNode< std::string >
bool setChild (CCopasiNode< Data > *pChild)
 
bool setParent (CCopasiNode< Data > *pParent)
 
bool setSibling (CCopasiNode< Data > *pSibling)
 
- Protected Attributes inherited from CEvaluationNode
MainType mMainType
 
class CEvaluationNode::CPrecedence mPrecedence
 
const CEvaluationTreempTree
 
const C_FLOAT64mpValue
 
SubType mSubType
 
C_FLOAT64 mValue
 
ValueType mValueType
 
- Protected Attributes inherited from CCopasiNode< std::string >
Data mData
 

Detailed Description

This is the class for nodes presenting operators used in an evaluation trees.

Member Typedef Documentation

◆ OPERATOR

typedef void(CEvaluationNodeOperator::* CEvaluationNodeOperator::OPERATOR) ()
private

Constructor & Destructor Documentation

◆ CEvaluationNodeOperator() [1/3]

CEvaluationNodeOperator::CEvaluationNodeOperator ( )
private

Default constructor

Referenced by fromAST().

◆ CEvaluationNodeOperator() [2/3]

◆ CEvaluationNodeOperator() [3/3]

CEvaluationNodeOperator::CEvaluationNodeOperator ( const CEvaluationNodeOperator src)

Copy constructor

Parameters
constCEvaluationNodeOperator & src

◆ ~CEvaluationNodeOperator()

CEvaluationNodeOperator::~CEvaluationNodeOperator ( )
virtual

Destructor

Member Function Documentation

◆ calculate()

void CEvaluationNodeOperator::calculate ( void  )
overridevirtual

Calculate the numerical result of the node. It is assumed that all child nodes are up to date.

Reimplemented from CEvaluationNode.

References mpOperator.

◆ compile()

◆ createModuloTree()

bool CEvaluationNodeOperator::createModuloTree ( const CEvaluationNodeOperator pNode,
ASTNode *  pASTNode,
const CDataModel pDataModel 
) const

Convert our modulo to something SBML understands

Parameters
constCEvaluationNodeOperator* pNode the modulo operator node to be converted.
constASTNode* pASTNode the root node for the SBML math expression
Returns
bool which is true on sucessfull conversion.

References CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::MODULUS, CEvaluationNode::subType(), and CEvaluationNode::toAST().

Referenced by toAST().

◆ fromAST()

CEvaluationNode * CEvaluationNodeOperator::fromAST ( const ASTNode *  pASTNode,
const std::vector< CEvaluationNode * > &  children 
)
static

◆ getBerkeleyMadonnaString()

std::string CEvaluationNodeOperator::getBerkeleyMadonnaString ( const std::vector< std::string > &  children) const
overridevirtual

Retrieve the display string of the node and its eventual child nodes in Berkeley Madonna format.

Returns
const Data & value

Reimplemented from CEvaluationNode.

References compile(), CCopasiNode< std::string >::mData, mpLeftNode, and mpRightNode.

◆ getCCodeString()

std::string CEvaluationNodeOperator::getCCodeString ( const std::vector< std::string > &  children) const
overridevirtual

Retrieve the display string of the node and its eventual child nodes in C.

Returns
const Data & value

Reimplemented from CEvaluationNode.

References compile(), CCopasiNode< std::string >::mData, CEvaluationNode::MODULUS, mpLeftNode, mpRightNode, CEvaluationNode::POWER, CEvaluationNode::REMAINDER, and CEvaluationNode::subType().

◆ getDisplayString()

std::string CEvaluationNodeOperator::getDisplayString ( const std::vector< std::string > &  children) const
overridevirtual

Retrieve the display string of the node and its eventual child nodes.

Returns
const Data & value

Reimplemented from CEvaluationNode.

References compile(), CCopasiNode< std::string >::mData, mpLeftNode, mpRightNode, CEvaluationNode::mSubType, and CEvaluationNode::REMAINDER.

◆ getInfix()

std::string CEvaluationNodeOperator::getInfix ( const std::vector< std::string > &  children) const
overridevirtual

Retrieve the infix value of the node and its eventual child nodes.

Returns
const Data & value

Reimplemented from CEvaluationNode.

References compile(), CCopasiNode< std::string >::mData, mpLeftNode, mpRightNode, CEvaluationNode::mSubType, and CEvaluationNode::REMAINDER.

◆ getLeft() [1/2]

CEvaluationNode * CEvaluationNodeOperator::getLeft ( )

References mpLeftNode.

Referenced by CDerive::deriveBranch().

◆ getLeft() [2/2]

const CEvaluationNode * CEvaluationNodeOperator::getLeft ( ) const

References mpLeftNode.

◆ getMMLString()

std::string CEvaluationNodeOperator::getMMLString ( const std::vector< std::string > &  children,
bool  expand,
const std::vector< std::vector< std::string > > &  variables 
) const
overridevirtual

Build the MathML string

Parameters
conststd::vector< std::string > & children
boolexpand = true
conststd::vector< std::vector< std::string > > & variables
Returns
std::string MMLString

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().

◆ getRight() [1/2]

CEvaluationNode * CEvaluationNodeOperator::getRight ( )

References mpRightNode.

Referenced by CDerive::deriveBranch().

◆ getRight() [2/2]

const CEvaluationNode * CEvaluationNodeOperator::getRight ( ) const

References mpRightNode.

◆ getUnit()

◆ getXPPString()

std::string CEvaluationNodeOperator::getXPPString ( const std::vector< std::string > &  children) const
overridevirtual

Retrieve the display string of the node and its eventual child nodes in XPPAUT format.

Returns
const Data & value

Reimplemented from CEvaluationNode.

References compile(), CCopasiNode< std::string >::mData, CEvaluationNode::MODULUS, mpLeftNode, mpRightNode, CEvaluationNode::REMAINDER, and CEvaluationNode::subType().

◆ s_divide()

void CEvaluationNodeOperator::s_divide ( )
private

◆ s_invalid()

void CEvaluationNodeOperator::s_invalid ( )
private

◆ s_minus()

void CEvaluationNodeOperator::s_minus ( )
private

◆ s_modulus()

void CEvaluationNodeOperator::s_modulus ( )
private

◆ s_multiply()

void CEvaluationNodeOperator::s_multiply ( )
private

◆ s_plus()

void CEvaluationNodeOperator::s_plus ( )
private

◆ s_power()

void CEvaluationNodeOperator::s_power ( )
private

◆ s_remainder()

void CEvaluationNodeOperator::s_remainder ( )
private

◆ setUnit()

CValidatedUnit CEvaluationNodeOperator::setUnit ( const CMathContainer container,
const std::map< CEvaluationNode *, CValidatedUnit > &  currentUnits,
std::map< CEvaluationNode *, CValidatedUnit > &  targetUnits 
) const
overridevirtual

◆ simplifyNode()

◆ toAST()

ASTNode * CEvaluationNodeOperator::toAST ( const CDataModel pDataModel) const
overridevirtual

Member Data Documentation

◆ mpLeftNode

◆ mpLeftValue

const C_FLOAT64* CEvaluationNodeOperator::mpLeftValue
private

◆ mpOperator

OPERATOR CEvaluationNodeOperator::mpOperator
private

◆ mpRightNode

◆ mpRightValue

const C_FLOAT64* CEvaluationNodeOperator::mpRightValue
private

The documentation for this class was generated from the following files: