COPASI API  4.40.278
CDerive Class Reference

#include <CDerive.h>

Public Member Functions

CEvaluationNodeadd (CEvaluationNode *n1, CEvaluationNode *n2)
 CDerive ()
 CDerive (std::vector< const CEvaluationNode * > &env, const CEvaluationTree *pTree, bool simplify)
void compileTree (CEvaluationNode *node)
CEvaluationNodederiveBranch (const CEvaluationNode *node, const CDataObject *pObject)
CEvaluationNodedivide (CEvaluationNode *n1, CEvaluationNode *n2)
CEvaluationNodemultiply (CEvaluationNode *n1, CEvaluationNode *n2)
CEvaluationNodepower (CEvaluationNode *n1, CEvaluationNode *n2)
CEvaluationNodesubtract (CEvaluationNode *n1, CEvaluationNode *n2)

Static Public Member Functions

static CEvaluationNodecopyBranch_var2obj (const CEvaluationNode *node, std::vector< const CEvaluationNode * > &env)
static void deleteBranch (CEvaluationNode *node)
 delete a branch starting from the given node More...
static bool isOne (const CEvaluationNode *node)
 tests whether the node is numerically 1 More...
static bool isZero (const CEvaluationNode *node)
 tests whether the node is numerically 0 More...

Private Attributes

std::vector< const CEvaluationNode * > mEnv
const CEvaluationTreempTree
bool mSimplify

Constructor & Destructor Documentation

◆ CDerive() [1/2]

CDerive::CDerive ( )

◆ CDerive() [2/2]

CDerive::CDerive ( std::vector< const CEvaluationNode * > &  env,
const CEvaluationTree pTree,
bool  simplify 

Member Function Documentation

◆ add()

◆ compileTree()

◆ copyBranch_var2obj()

◆ deleteBranch()

void CDerive::deleteBranch ( CEvaluationNode node)

delete a branch starting from the given node

References CCopasiNode< _Data >::getParent().

Referenced by add(), divide(), multiply(), power(), CModel::prepareElasticity(), and subtract().

◆ deriveBranch()

CEvaluationNode * CDerive::deriveBranch ( const CEvaluationNode node,
const CDataObject pObject 

create a derivative of a mathematical expression with root at *node with respect to the variable *pObject. in env we pass the vector of trees that will be substituted for variable nodes The treatment of object nodes in env[] is specific:

  • It is assumed that the value of all the objects is updated before the derivative will be evaluated (the evaluation of objects is not expanded)
  • However, the derivation of objects is expanded, for entities with assignments, concentrations, dependent species, reactions.
pObjectthe variable to derive
envvector of trees to be substituted for variable nodes
pTree,thetree to differentiate
simplifyif true the expression will be simplified

References add(), CCopasiNode< _Data >::addChild(), CEvaluationNode::CN, CEvaluationNode::compile(), CEvaluationNodeObject::compile(), compileTree(), copyBranch_var2obj(), CObjectInterface::DataObject(), divide(), CEvaluationNode::DIVIDE, CEvaluationNodeCall::getCalledTree(), CDataObject::getCN(), CEvaluationNodeVariable::getIndex(), CEvaluationNodeOperator::getLeft(), CEvaluationNodeCall::getListOfChildNodes(), CDataObject::getObjectAncestor(), CEvaluationNodeObject::getObjectCN(), CEvaluationNodeObject::getObjectInterfacePtr(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CEvaluationNodeOperator::getRight(), CEvaluationTree::getRoot(), CEvaluationNode::INTEGER, CEvaluationNode::LOG, mEnv, CEvaluationNode::MINUS, multiply(), CEvaluationNode::MULTIPLY, CEvaluationNode::PLUS, power(), CEvaluationNode::POWER, subtract(), and CEvaluationNode::subType().

Referenced by CMathDerive::initOneVar(), and CModel::prepareElasticity().

◆ divide()

◆ isOne()

bool CDerive::isOne ( const CEvaluationNode node)

tests whether the node is numerically 1

References CEvaluationNode::getValuePointer().

Referenced by divide(), multiply(), and power().

◆ isZero()

bool CDerive::isZero ( const CEvaluationNode node)

tests whether the node is numerically 0

References CEvaluationNode::getValuePointer().

Referenced by add(), divide(), multiply(), power(), and subtract().

◆ multiply()

CEvaluationNode * CDerive::multiply ( CEvaluationNode n1,
CEvaluationNode n2 

These methods create a node for a basic mathematical operation. In addition they check for basic simplifications

References CCopasiNode< _Data >::addChild(), deleteBranch(), CEvaluationNode::INTEGER, isOne(), isZero(), mSimplify, and CEvaluationNode::MULTIPLY.

Referenced by deriveBranch(), and CModel::prepareElasticity().

◆ power()

◆ subtract()

Member Data Documentation

◆ mEnv

std::vector<const CEvaluationNode*> CDerive::mEnv

Referenced by deriveBranch().

◆ mpTree

const CEvaluationTree* CDerive::mpTree

◆ mSimplify

bool CDerive::mSimplify

Referenced by add(), divide(), multiply(), power(), and subtract().

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