COPASI API  4.40.278
CNodeK Class Reference

#include <CNodeK.h>

Public Member Functions

void cleanup ()
 
 CNodeK ()
 
 CNodeK (C_FLOAT64 constant)
 
 CNodeK (char type, char subtype)
 
 CNodeK (const CNodeK &src)
 
 CNodeK (const std::string &name)
 
C_FLOAT64 getConstant () const
 
std::string getExplicitFunctionString (const std::vector< std::vector< std::string > > &callParameterNames, const std::string &r)
 
C_INT32 getIndex () const
 
CNodeKgetLeft () const
 
std::string getName () const
 
CNodeKgetRight () const
 
char getSubtype () const
 
char getType () const
 
C_INT16 isIdentifier () const
 
C_INT16 isLeftValid () const
 
C_INT16 isNumber () const
 
C_INT16 isOperator () const
 
C_INT16 isRightValid () const
 
C_INT16 leftPrecedence () const
 
C_INT32 load (CReadConfig &configbuffer)
 
C_INT16 rightPrecedence () const
 
void setConstant (C_FLOAT64 &constant)
 
void setIndex (C_INT32 index)
 
void setLeft (CNodeK &left)
 
void setLeft (CNodeK *pleft)
 
void setName (const std::string &name)
 
void setOldIndex (C_INT32 oldindex)
 
void setRight (CNodeK &right)
 
void setRight (CNodeK *pright)
 
void setSubtype (const char subtype)
 
void setType (const char ype)
 
C_FLOAT64 value (const CCallParameters< C_FLOAT64 > &callParameters) const
 
void writeMathML (std::ostream &out, C_INT32 level) const
 
 ~CNodeK ()
 

Private Attributes

int attribute1
 
C_FLOAT64 mConstant
 
std::string mExplicitFunction
 
C_INT32 mIndex
 
CNodeKmLeft
 
std::string mName
 
C_INT32 mOldIndex
 
CNodeKmRight
 
char mSubtype
 
char mType
 

Constructor & Destructor Documentation

◆ CNodeK() [1/5]

CNodeK::CNodeK ( )

Default constructor

References CONSTRUCTOR_TRACE, mConstant, mIndex, mLeft, mOldIndex, mRight, mSubtype, mType, and N_NOP.

◆ CNodeK() [2/5]

CNodeK::CNodeK ( const CNodeK src)

Copy constructor

Parameters
const CNodeK &src

References CONSTRUCTOR_TRACE, mConstant, mIndex, mLeft, mName, mOldIndex, mRight, mSubtype, and mType.

◆ CNodeK() [3/5]

CNodeK::CNodeK ( char  type,
char  subtype 
)

Constructor for operator

Parameters
const chartype
const charsubtype

References CONSTRUCTOR_TRACE, mConstant, mIndex, mLeft, mOldIndex, mRight, mSubtype, and mType.

◆ CNodeK() [4/5]

CNodeK::CNodeK ( const std::string &  name)

Constructor for identifier

Parameters
const string&name

References CONSTRUCTOR_TRACE, mConstant, mIndex, mLeft, mName, mOldIndex, mRight, mSubtype, mType, N_IDENTIFIER, and N_NOP.

◆ CNodeK() [5/5]

CNodeK::CNodeK ( C_FLOAT64  constant)

Constructor for a constant

Parameters
const C_FLOAT64constant

References CONSTRUCTOR_TRACE, mConstant, mIndex, mLeft, mOldIndex, mRight, mSubtype, mType, N_NOP, and N_NUMBER.

◆ ~CNodeK()

CNodeK::~CNodeK ( )

Destructor

References DESTRUCTOR_TRACE.

Member Function Documentation

◆ cleanup()

void CNodeK::cleanup ( )

Delete

◆ getConstant()

C_FLOAT64 CNodeK::getConstant ( ) const

Retrieving value of a node

Returns
C_FLOAT64

References mConstant.

◆ getExplicitFunctionString()

std::string CNodeK::getExplicitFunctionString ( const std::vector< std::vector< std::string > > &  callParameterNames,
const std::string &  r 
)

Returns a string that contains the equation defined from this node downwards. The function contains explicit names of node identifiers, rather than the abstract symbol.

Parameters
const CCallParameters &callParameterNames a vector of string pointers with identifier names
const string &r a suffix for parameter names (usually reaction number)
Returns
string

◆ getIndex()

C_INT32 CNodeK::getIndex ( ) const

Retrieving index the name of a node

Returns
C_INT32

References mIndex.

◆ getLeft()

CNodeK & CNodeK::getLeft ( ) const

Retrieving mLeft the left branch of a node

Returns
CNodeK

References fatalError, and mLeft.

◆ getName()

std::string CNodeK::getName ( ) const

Retrieving mName the name of a node

Returns
string

References C_INT, isIdentifier(), and mName.

◆ getRight()

CNodeK & CNodeK::getRight ( ) const

Retrieving mName the name of a node

Returns
string

References fatalError, and mRight.

◆ getSubtype()

char CNodeK::getSubtype ( ) const

Retrieving mSubtype the subtype of a node

Returns
char

References mSubtype.

◆ getType()

char CNodeK::getType ( ) const

Retrieving mType the type of a node

Returns
char

References mType.

◆ isIdentifier()

C_INT16 CNodeK::isIdentifier ( ) const

This checks whether the node is an identifier (mType = N_IDENTIFIER)

Returns
int 1 or 0

References mType, N_IDENTIFIER, N_KCONSTANT, N_MODIFIER, N_OBJECT, N_PRODUCT, N_SUBSTRATE, and N_VOLUME.

Referenced by getName().

◆ isLeftValid()

C_INT16 CNodeK::isLeftValid ( ) const

This checks whether mLeft points to a valid CNodeK

Returns
int 1 or 0

References mLeft.

◆ isNumber()

C_INT16 CNodeK::isNumber ( ) const

This checks whether the node is a number (mType = N_NUMBER)

Returns
int 1 or 0

References mType, and N_NUMBER.

◆ isOperator()

C_INT16 CNodeK::isOperator ( ) const

This checks whether the node is a operator (mType = N_OPERATOR)

Returns
int 1 or 0

References mType, and N_OPERATOR.

◆ isRightValid()

C_INT16 CNodeK::isRightValid ( ) const

This checks whether mRight points to a valid CNodeK

Returns
int 1 or 0

References mRight.

◆ leftPrecedence()

C_INT16 CNodeK::leftPrecedence ( ) const

This returns the left precedence value of a node

Returns
int

References mSubtype, mType, N_FUNCTION, N_IDENTIFIER, N_NUMBER, and N_OBJECT.

◆ load()

C_INT32 CNodeK::load ( CReadConfig configbuffer)

Loads an object with data coming from a CReadConfig object. (CReadConfig object reads an input stream)

Parameters
pconfigbufferreference to a CReadConfig object.
Returns
Fail

References C_INT32, CReadConfig::getVariable(), mConstant, mIndex, mName, mSubtype, mType, N_IDENTIFIER, N_KCONSTANT, N_MODIFIER, N_NUMBER, N_PRODUCT, N_SUBSTRATE, and CReadConfig::SEARCH.

◆ rightPrecedence()

C_INT16 CNodeK::rightPrecedence ( ) const

This returns the right precedence value of a node

Returns
int

References mSubtype, mType, N_FUNCTION, N_IDENTIFIER, N_NUMBER, and N_OBJECT.

◆ setConstant()

void CNodeK::setConstant ( C_FLOAT64 constant)

Setting the value of a number

Parameters
C_FLOAT64&constant

References mConstant.

◆ setIndex()

void CNodeK::setIndex ( C_INT32  index)

Setting the index of an identifier

Parameters
C_INT32&index

References mIndex.

◆ setLeft() [1/2]

void CNodeK::setLeft ( CNodeK left)

Setting mLeft the pointer to the left branch

Parameters
CNodeK&left

References mLeft.

◆ setLeft() [2/2]

void CNodeK::setLeft ( CNodeK pleft)

Setting mLeft the pointer to the left branch

Parameters
CNodeK*pleft

References mLeft.

◆ setName()

void CNodeK::setName ( const std::string &  name)

Setting mName the name of an identifier

Parameters
const string&name

References mName.

◆ setOldIndex()

void CNodeK::setOldIndex ( C_INT32  oldindex)

Setting the old index (Gepasi format, each type is indexed separately)

Parameters
C_INT32&index

References mOldIndex.

◆ setRight() [1/2]

void CNodeK::setRight ( CNodeK right)

Setting mRight the pointer to the right branch

Parameters
CNodeK&right

References mRight.

◆ setRight() [2/2]

void CNodeK::setRight ( CNodeK pright)

Setting mRight the pointer to the right branch

Parameters
CNodeK*pright

References mRight.

◆ setSubtype()

void CNodeK::setSubtype ( const char  subtype)

Setting mSubtype the subtype of a node

Parameters
const charsubtype

References mSubtype.

◆ setType()

void CNodeK::setType ( const char  ype)

Setting mType the subtype of a node

Parameters
const chartype

References mType.

◆ value()

C_FLOAT64 CNodeK::value ( const CCallParameters< C_FLOAT64 > &  callParameters) const

This calculates the value of this sub-tree (ie with this node as root)

Parameters
constCCallParameters<C_FLOAT64> & callParameters
Returns
C_FLOAT64

◆ writeMathML()

void CNodeK::writeMathML ( std::ostream &  out,
C_INT32  level 
) const

Member Data Documentation

◆ attribute1

int CNodeK::attribute1
private

WHAT IS THIS FOR??? PLEASE ADD COMMENT!

◆ mConstant

C_FLOAT64 CNodeK::mConstant
private

The value of a node of type N_NUMBER

Referenced by CNodeK(), getConstant(), load(), and setConstant().

◆ mExplicitFunction

std::string CNodeK::mExplicitFunction
private

The explicit function string

◆ mIndex

C_INT32 CNodeK::mIndex
private

The index of the node for type N_IDENTIFIER

Referenced by CNodeK(), getIndex(), load(), and setIndex().

◆ mLeft

CNodeK* CNodeK::mLeft
private

The left branch of the tree originating from tyhis node

Referenced by CNodeK(), getLeft(), isLeftValid(), and setLeft().

◆ mName

std::string CNodeK::mName
private

The name of the node for type N_IDENTIFIER

Referenced by CNodeK(), getName(), load(), and setName().

◆ mOldIndex

C_INT32 CNodeK::mOldIndex
private

The index in old Gepasi format

Referenced by CNodeK(), and setOldIndex().

◆ mRight

CNodeK* CNodeK::mRight
private

The right branch of the tree originating from tyhis node

Referenced by CNodeK(), getRight(), isRightValid(), and setRight().

◆ mSubtype

char CNodeK::mSubtype
private

The subtype of a node. for type N_FUNCTION one of: N_LOG10, N_LOG, N_EXP, N_SIN, N_COS, N_RND, N_GAUSS, N_BOLTZ for type N_IDENTIFIER one of:N_SUBSTRATE, N_PRODUCT, N_MODIFIER, N_KCONSTANT for type N_OPERATOR one of: + - * / ^ () ...

Referenced by CNodeK(), getSubtype(), leftPrecedence(), load(), rightPrecedence(), and setSubtype().

◆ mType

char CNodeK::mType
private

The type of the node. One of N_ROOT, N_OPERATOR, N_IDENTIFIER, N_FUNCTION, N_NUMBER

Referenced by CNodeK(), getType(), isIdentifier(), isNumber(), isOperator(), leftPrecedence(), load(), rightPrecedence(), and setType().


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