COPASI API
4.40.278
|
#include <CDerive.h>
Public Member Functions | |
CEvaluationNode * | add (CEvaluationNode *n1, CEvaluationNode *n2) |
CDerive () | |
CDerive (std::vector< const CEvaluationNode * > &env, const CEvaluationTree *pTree, bool simplify) | |
void | compileTree (CEvaluationNode *node) |
CEvaluationNode * | deriveBranch (const CEvaluationNode *node, const CDataObject *pObject) |
CEvaluationNode * | divide (CEvaluationNode *n1, CEvaluationNode *n2) |
CEvaluationNode * | multiply (CEvaluationNode *n1, CEvaluationNode *n2) |
CEvaluationNode * | power (CEvaluationNode *n1, CEvaluationNode *n2) |
CEvaluationNode * | subtract (CEvaluationNode *n1, CEvaluationNode *n2) |
Static Public Member Functions | |
static CEvaluationNode * | copyBranch_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 CEvaluationTree * | mpTree |
bool | mSimplify |
CDerive::CDerive | ( | ) |
CDerive::CDerive | ( | std::vector< const CEvaluationNode * > & | env, |
const CEvaluationTree * | pTree, | ||
bool | simplify | ||
) |
CEvaluationNode * CDerive::add | ( | CEvaluationNode * | n1, |
CEvaluationNode * | n2 | ||
) |
References CCopasiNode< _Data >::addChild(), deleteBranch(), CEvaluationNode::getValuePointer(), CEvaluationNode::INTEGER, isZero(), mSimplify, and CEvaluationNode::PLUS.
Referenced by deriveBranch().
void CDerive::compileTree | ( | CEvaluationNode * | node | ) |
References CEvaluationNode::compile(), CCopasiNode< _Data >::getChild(), and CCopasiNode< _Data >::getSibling().
Referenced by deriveBranch(), and CModel::prepareElasticity().
|
static |
References CNodeContextIterator< Node, Context >::context(), CEvaluationNode::copyBranch(), CNodeContextIterator< Node, Context >::end(), CEvaluationNodeVariable::getIndex(), CNodeContextIterator< Node, Context >::next(), CNodeContextIterator< Node, Context >::parentContextPtr(), and CEvaluationNode::VARIABLE.
Referenced by deriveBranch().
|
static |
delete a branch starting from the given node
References CCopasiNode< _Data >::getParent().
Referenced by add(), divide(), multiply(), power(), CModel::prepareElasticity(), and subtract().
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:
node | |
pObject | the variable to derive |
env | vector of trees to be substituted for variable nodes |
pTree,the | tree to differentiate |
simplify | if 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().
CEvaluationNode * CDerive::divide | ( | CEvaluationNode * | n1, |
CEvaluationNode * | n2 | ||
) |
References CCopasiNode< _Data >::addChild(), deleteBranch(), CEvaluationNode::DIVIDE, CEvaluationNode::INTEGER, isOne(), isZero(), and mSimplify.
Referenced by deriveBranch().
|
static |
tests whether the node is numerically 1
References CEvaluationNode::getValuePointer().
Referenced by divide(), multiply(), and power().
|
static |
tests whether the node is numerically 0
References CEvaluationNode::getValuePointer().
Referenced by add(), divide(), multiply(), power(), and subtract().
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().
CEvaluationNode * CDerive::power | ( | CEvaluationNode * | n1, |
CEvaluationNode * | n2 | ||
) |
References CCopasiNode< _Data >::addChild(), deleteBranch(), CEvaluationNode::INTEGER, isOne(), isZero(), mSimplify, and CEvaluationNode::POWER.
Referenced by deriveBranch().
CEvaluationNode * CDerive::subtract | ( | CEvaluationNode * | n1, |
CEvaluationNode * | n2 | ||
) |
References CCopasiNode< _Data >::addChild(), deleteBranch(), CEvaluationNode::getValuePointer(), CEvaluationNode::INTEGER, isZero(), CEvaluationNode::MINUS, and mSimplify.
Referenced by deriveBranch().
|
private |
Referenced by deriveBranch().
|
private |
|
private |
Referenced by add(), divide(), multiply(), power(), and subtract().