COPASI API
4.40.278
|
#include <CEvaluationTree.h>
Public Types | |
enum | Type { Function = 0 , MassAction , PreDefined , UserDefined , Expression , MathExpression } |
Public Types inherited from CDataContainer | |
typedef CDataObjectMap | objectMap |
Public Types inherited from CDataObject | |
typedef std::set< const CDataObject * > | DataObjectSet |
enum | Flag { Container , Vector , Matrix , NameVector , Reference , ValueBool , ValueInt , ValueInt64 , ValueDbl , NonUniqueName , StaticString , ValueString , Separator , DisplayName , ModelEntity , Array , DataModel , Root , Gui , __SIZE } |
Public Types inherited from CObjectInterface | |
typedef std::vector< const CDataContainer * > | ContainerList |
typedef std::set< const CObjectInterface * > | ObjectSet |
Public Member Functions | |
virtual bool | applyData (const CData &data, CUndoData::CChangeSet &changes) |
bool | calls (std::set< std::string > &list) const |
CEvaluationTree (const CEvaluationTree &src, const CDataContainer *pParent) | |
CEvaluationTree (const std::string &name="NoName", const CDataContainer *pParent=NO_PARENT, const Type &type=Function) | |
virtual CIssue | compile () |
bool | containsCN (const DataObjectSet &elements) const |
std::string::size_type | getErrorPosition () const |
const std::string & | getInfix () const |
const std::vector< CEvaluationNode * > & | getNodeList () const |
virtual const CObjectInterface * | getNodeObject (const CCommonName &CN) const |
CEvaluationNode * | getRoot () |
const CEvaluationNode * | getRoot () const |
const CEvaluationTree::Type & | getType () const |
virtual size_t | getVariableIndex (const std::string &name) const |
virtual const C_FLOAT64 & | getVariableValue (const size_t &index) const |
bool | hasCircularDependency () const |
bool | hasDiscontinuity () const |
bool | isBoolean () const |
bool | mapObjectNodes (const CDataContainer *pSrc, const CDataContainer *pTarget) |
bool | operator== (const CEvaluationTree &rhs) const |
virtual CIssue | setInfix (const std::string &infix) |
virtual bool | setRoot (CEvaluationNode *pRootNode) |
bool | setTree (const ASTNode &pRootNode, bool isFunction) |
size_t | size () const |
virtual ASTNode * | toAST (const CDataModel *pDataModel) const |
virtual CData | toData () const |
CIssue | updateTree () |
virtual | ~CEvaluationTree () |
Public Member Functions inherited from CDataContainer | |
virtual bool | add (CDataObject *pObject, const bool &adopt=true) |
virtual bool | appendDeletedDependentData (CUndoData &undoData) const |
CDataContainer (const CDataContainer &src, const CDataContainer *pParent) | |
CDataContainer (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None) | |
virtual void | createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const override |
virtual std::string | getChildObjectUnits (const CDataObject *pObject) const |
void | getDescendants (CDataObject::DataObjectSet &descendants, const bool &recursive=false) const |
virtual size_t | getIndex (const CDataObject *pObject) const |
virtual const CObjectInterface * | getObject (const CCommonName &cn) const override |
virtual objectMap & | getObjects () |
virtual const objectMap & | getObjects () const |
virtual const std::string | getUnits () const override |
virtual const CDataObject * | getValueObject () const override |
virtual CUndoObjectInterface * | insert (const CData &data) override |
void | objectRenamed (CDataObject *pObject, const std::string &oldName) |
virtual bool | remove (CDataObject *pObject) |
virtual | ~CDataContainer () |
Public Member Functions inherited from CDataObject | |
void | addIssue (const CIssue &issue) |
void | addReference (const CDataContainer *pReference) |
virtual void | calculateValue () override |
CDataObject (const CDataObject &src, const CDataContainer *pParent=NULL) | |
virtual void | destruct () override |
virtual CCommonName | getCN () const override |
virtual const CDataObject * | getDataObject () const override |
virtual const std::string & | getKey () const |
CDataContainer * | getObjectAncestor (const std::string &type) const |
CDataModel * | getObjectDataModel () const |
virtual std::string | getObjectDisplayName () const override |
const CObjectInterface * | getObjectFromCN (const CCommonName &cn) const |
const std::string & | getObjectName () const |
CDataContainer * | getObjectParent () const |
const std::string & | getObjectType () const |
virtual const CObjectInterface::ObjectSet & | getPrerequisites () const override |
virtual const CValidity & | getValidity () const override |
virtual void * | getValuePointer () const override |
bool | hasFlag (const Flag &flag) const |
virtual bool | isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override |
bool | prerequisitsContains (const DataObjectSet &objects) const |
virtual void | print (std::ostream *ostream) const override |
void | removeIssue (const CIssue &issue) |
void | removeReference (const CDataContainer *pReference) |
bool | setObjectName (const std::string &name) |
virtual bool | setObjectParent (const CDataContainer *pParent) |
void | validityChanged (const CValidity &changedValidity) override |
void | validityRemoved (const CValidity &changedValidity) |
virtual | ~CDataObject () |
Public Member Functions inherited from CObjectInterface | |
CObjectInterface () | |
CObjectInterface (const CObjectInterface &src) | |
virtual | ~CObjectInterface () |
Public Member Functions inherited from CUndoObjectInterface | |
CUndoObjectInterface () | |
CUndoObjectInterface (const CUndoObjectInterface &src) | |
bool | generateUuid () |
const xg::Guid & | getUuid () const |
bool | setUuid (const std::string &uuid) |
bool | setUuid (const xg::Guid &uuid) |
virtual void | updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject) |
virtual | ~CUndoObjectInterface () |
Static Public Member Functions | |
static CEvaluationTree * | copy (const CEvaluationTree &src) |
static CEvaluationTree * | create (CEvaluationTree::Type type) |
static CEvaluationNode * | fromAST (const ASTNode *pASTNode, bool isFunction) |
static CEvaluationTree * | fromData (const CData &data, CUndoObjectInterface *pParent) |
Static Public Member Functions inherited from CDataContainer | |
static CDataContainer * | fromData (const CData &data, CUndoObjectInterface *pParent) |
Static Public Member Functions inherited from CDataObject | |
static CDataObject * | fromData (const CData &data, CUndoObjectInterface *pParent) |
static void | sanitizeObjectName (std::string &name) |
Static Public Member Functions inherited from CObjectInterface | |
static const CDataObject * | DataObject (const CObjectInterface *pInterface) |
static CObjectInterface * | GetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName) |
Static Public Member Functions inherited from CUndoObjectInterface | |
template<class CType > | |
static CType * | fromData (const CData &, CUndoObjectInterface *) |
Static Public Attributes | |
static const std::string | TypeName [] |
static const char * | XMLType [] |
Static Public Attributes inherited from CDataContainer | |
static const CObjectInterface::ContainerList | EmptyList |
Protected Member Functions | |
void | buildCalculationSequence () |
void | calculate () |
CEvaluationTree (const CEvaluationTree &src) | |
void | clearNodes () |
CIssue | compileNodes () |
CIssue | parse () |
void | setType (const CEvaluationTree::Type &type) |
Protected Member Functions inherited from CDataContainer | |
template<class CType > | |
CDataMatrixReference< CType > * | addMatrixReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
template<class CType > | |
CDataObjectReference< CType > * | addObjectReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
template<class CType > | |
CDataVectorReference< CType > * | addVectorReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
CDataContainer (const CDataContainer &src) | |
void | initObjects () |
Protected Member Functions inherited from CDataObject | |
CDataObject () | |
CDataObject (const std::string &name, const CDataContainer *pParent=static_cast< CDataContainer * >((void *) 0), const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None) | |
Protected Attributes | |
CVector< CEvaluationNode * > | mCalculationSequence |
std::string | mInfix |
std::vector< CEvaluationNode * > * | mpNodeList |
const C_FLOAT64 * | mpRootValue |
CEvaluationTree::Type | mType |
C_FLOAT64 | mValue |
Protected Attributes inherited from CDataContainer | |
objectMap | mObjects |
Protected Attributes inherited from CDataObject | |
ObjectSet | mPrerequisits |
std::set< CDataContainer * > | mReferences |
Protected Attributes inherited from CObjectInterface | |
CValidity | mValidity |
Private Member Functions | |
void | initObjects () |
Private Attributes | |
std::string::size_type | mErrorPosition |
CEvaluationNode * | mpRootNode |
|
protected |
CEvaluationTree::CEvaluationTree | ( | const std::string & | name = "NoName" , |
const CDataContainer * | pParent = NO_PARENT , |
||
const Type & | type = Function |
||
) |
Default constructor
const | std::string & name (default: "NoName") |
const | CDataContainer * pParent (default: NULL) |
const | CEvaluationTree::Type & type (default: Function) |
References initObjects(), and setInfix().
CEvaluationTree::CEvaluationTree | ( | const CEvaluationTree & | src, |
const CDataContainer * | pParent | ||
) |
Copy constructor
const | CEvaluationTree & src |
const | CDataContainer * pParent (default: NULL) |
References initObjects(), mInfix, and setInfix().
|
virtual |
Destructor
References clearNodes().
|
virtual |
Apply the provided data to the object
const | CData & data |
Reimplemented from CDataContainer.
Reimplemented in CFunction.
References CDataContainer::applyData().
Referenced by CFunction::applyData().
|
protected |
Build the sequence of calculations required to determine the value of the expression.
References CVectorCore< CType >::begin(), CEvaluationNode::CONSTANT, CVectorCore< CType >::end(), CNodeContextIterator< Node, Context >::end(), mCalculationSequence, mpRootNode, CNodeContextIterator< Node, Context >::next(), CEvaluationNode::NUMBER, CEvaluationNode::OBJECT, CVector< CType >::resize(), and CEvaluationNode::UNIT.
Referenced by CMathExpression::compile(), compileNodes(), CMathExpression::copy(), and mapObjectNodes().
|
protected |
Calculate the value
References CVectorCore< CType >::begin(), CVectorCore< CType >::end(), CValidity::getFirstWorstIssue(), CIssue::isSuccess(), mCalculationSequence, mpRootNode, mpRootValue, CObjectInterface::mValidity, and mValue.
Referenced by CExpression::calcValue(), CFunction::calcValue(), and CMathExpression::value().
bool CEvaluationTree::calls | ( | std::set< std::string > & | list | ) | const |
Check whether the evaluation tree calls any tree in the list
std::set< | std::string > & list |
References CEvaluationNode::CALL, CEvaluationNodeCall::calls(), CDataObject::getObjectName(), and mpNodeList.
Referenced by CEvaluationNodeCall::calls(), and hasCircularDependency().
|
protected |
Convenient function to free the list of generated nodes.
References mpNodeList, mpRootNode, mpRootValue, mValue, and pdelete.
Referenced by CMathExpression::CMathExpression(), parse(), setRoot(), updateTree(), and ~CEvaluationTree().
|
virtual |
Compile the evaluation tree.
Reimplemented in CMathExpression, and CMassAction.
References compileNodes().
Referenced by CMathEvent::CTrigger::allocate(), CExpression::CExpression(), CFunction::CFunction(), SBMLImporter::createCFunctionFromFunctionTree(), SBMLImporter::importFunctionDefinitions(), CRootContainer::initializeChildren(), CFunctionDB::load(), CReaction::setFunctionFromExpressionTree(), and CFunction::splitFunction().
|
protected |
Compile the individual nodes.
References CValidity::add(), CFlags< Enum >::All, buildCalculationSequence(), CEvaluationNode::CALL, CNodeContextIterator< Node, Context >::end(), CCopasiMessage::ERROR, CIssue::Error, CIssue::ExpressionDataTypeInvalid, CIssue::ExpressionInvalid, CEvaluationNodeCall::getCalledTree(), CValidity::getFirstWorstIssue(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CEvaluationNode::getValuePointer(), CIssue::HasCircularDependency, mCalculationSequence, MCFunction, mErrorPosition, mInfix, mpNodeList, CDataObject::mPrerequisits, mpRootNode, mpRootValue, CObjectInterface::mValidity, mValue, CNodeContextIterator< Node, Context >::next(), CValidity::remove(), CVector< CType >::resize(), and CIssue::StructureInvalid.
Referenced by compile(), CExpression::compile(), and CFunction::setInfix().
bool CEvaluationTree::containsCN | ( | const DataObjectSet & | elements | ) | const |
References CEvaluationNode::CALL, CEvaluationNode::CN, containsCN(), CEvaluationNode::EXPRESSION, CEvaluationNode::FUNCTION, CEvaluationNodeCall::getCalledTree(), CEvaluationNodeObject::getObjectCN(), mpNodeList, and CEvaluationNode::OBJECT.
Referenced by containsCN(), and CEvent::getOriginFor().
|
static |
Copy an EvaluationTree of the specified type. Note: the returned object has to be released after use with delete.
const | EvaluationTree & src |
References Expression, fatalError, Function, getType(), MassAction, NO_PARENT, PreDefined, and UserDefined.
|
static |
Create an EvaluationTree of the specified type. Note: the returned object has to be released after use with delete.
CEvaluationTree::Type | type |
References Expression, fatalError, Function, MassAction, PreDefined, setType(), and UserDefined.
Referenced by SBMLImporter::createExpressionFromFunction(), fromData(), SBMLImporter::importEvent(), and FunctionHandler::processStart().
|
static |
Converts an SBML ASTNode to the corresponding CEvaluationNode tree.
const | ASTNode * pASTNode |
bool | isFunction |
References CNodeContextIterator< Node, Context >::context(), CNodeContextIterator< Node, Context >::end(), CCopasiMessage::EXCEPTION, fatalError, CEvaluationNodeCall::fromAST(), CEvaluationNodeChoice::fromAST(), CEvaluationNodeConstant::fromAST(), CEvaluationNodeDelay::fromAST(), CEvaluationNodeFunction::fromAST(), CEvaluationNodeLogical::fromAST(), CEvaluationNodeNumber::fromAST(), CEvaluationNodeObject::fromAST(), CEvaluationNodeOperator::fromAST(), CEvaluationNodeVariable::fromAST(), MCMathML, CNodeContextIterator< Node, Context >::next(), and CNodeContextIterator< Node, Context >::parentContextPtr().
Referenced by SBMLImporter::createCReactionFromReaction(), and setTree().
|
static |
Static method to create a CDataObject based on the provided data
const | CData & data |
References create(), CData::EVALUATION_TREE_TYPE, CData::getProperty(), CData::OBJECT_NAME, CDataObject::setObjectName(), CDataValue::toString(), and CDataValue::toUint().
Referenced by CFunction::fromData().
std::string::size_type CEvaluationTree::getErrorPosition | ( | ) | const |
Retrieve the position of the error in the string description. std::string::npos indicates no error.
References mErrorPosition.
const std::string & CEvaluationTree::getInfix | ( | ) | const |
Retrieve the infix description of the tree
References mInfix.
Referenced by CMathObject::calculateValue(), CModelEntity::compile(), CMetab::compile(), CMathObject::compileFlux(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), CModelAdd::copyInitialExpression(), CModelAdd::copyTriggerExpression(), CMathContainer::createDelays(), CSBMLExporter::createEvent(), CReaction::createUndoData(), COptProblem::elevateChildren(), CSBMLExporter::exportEventAssignments(), CEvent::getDelayExpression(), CEventAssignment::getExpression(), CModelEntity::getExpression(), CReactionInterface::getFunctionDescription(), CModelParameter::getInitialExpression(), CModelEntity::getInitialExpression(), CModelEntity::getNoiseExpression(), CReaction::getNoiseExpression(), COptProblem::getObjectiveFunction(), CEvent::getPriorityExpression(), CEvent::getTriggerExpression(), COptProblem::initialize(), CMathDelay::modifyMathObject(), CCopasiXML::saveFunctionList(), CEvent::setDelayExpression(), CEventAssignment::setExpression(), CModelEntity::setExpression(), CModelEntity::setInitialExpression(), CReaction::setNoiseExpression(), CEvent::setPriorityExpression(), CEvent::setTriggerExpression(), and CReaction::toData().
const std::vector< CEvaluationNode * > & CEvaluationTree::getNodeList | ( | ) | const |
Retrieve the list of nodes
References mpNodeList.
Referenced by CMathObject::appendDelays(), CSBMLExporter::checkForUnsupportedObjectReferences(), CFunction::completeFunctionList(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), CModelAdd::copyInitialExpression(), CModelAdd::copyTriggerExpression(), CExpression::createInitialExpression(), CODEExporter::exportExpression(), CModelExpansion::expressionContainsObject(), CODEExporter::isModelEntityExpressionODEExporterCompatible(), CModelMerging::mergeInExpression(), CModelExpansion::replaceInExpression(), and CModelExpansion::updateExpression().
|
virtual |
Retrieve a pointer to the object defined by CN. This method may only be called during compile() since the list mpListOfContainer is only valid then.
const | CCommonName & CN |
Reimplemented in CExpression.
References CRootContainer::getFunctionList(), CDataContainer::getObject(), and CDataObject::getObjectFromCN().
Referenced by CEvaluationNodeObject::compile(), and CExpression::getNodeObject().
CEvaluationNode * CEvaluationTree::getRoot | ( | ) |
Returns the root node of the tree.
References mpRootNode.
Referenced by CMathContainer::addAnalysisObject(), CMathEvent::CTrigger::allocate(), SBMLImporter::applyStoichiometricExpressions(), SBMLImporter::areEqualFunctions(), CSBMLExporter::checkForPiecewiseFunctions(), CSBMLExporter::checkForUnsupportedFunctionCalls(), CFunctionAnalyzer::checkKineticFunction(), CMathExpression::CMathExpression(), CExpression::compile(), CMathEvent::CTrigger::compile(), CMathExpression::convertToInitialExpression(), CMathExpression::copy(), CMathContainer::copyBranch(), SBMLImporter::createCFunctionFromFunctionTree(), CFunction::createCopy(), SBMLImporter::createCReactionFromReaction(), CMathContainer::createDiscontinuityEvents(), CSBMLExporter::createEvent(), SBMLImporter::createExpressionFromFunction(), CSBMLExporter::createInitialAssignment(), CKinFunction::createParameters(), CSBMLExporter::createRule(), CDerive::deriveBranch(), CFunctionAnalyzer::evaluateNode(), CSBMLExporter::exportEventAssignments(), CODEExporter::exportKineticFunction(), CODEExporterC::exportKineticFunctionGroup(), CODEExporter::exportModelEntityExpression(), CODEExporter::exportModelValuesExpressions(), CODEExporter::exportSingleFunction(), CODEExporterC::exportSingleFunction(), SBMLImporter::findCorrespondingFunction(), SBMLImporter::findFunctionCalls(), CODEExporter::findFunctionsCalls(), CSBMLExporter::findUsedFunctions(), CExpression::getBerkeleyMadonnaString(), CExpression::getCCodeString(), CODEExporterBM::getDisplayExpressionString(), CODEExporterC::getDisplayExpressionString(), CODEExporterXPPAUT::getDisplayExpressionString(), CODEExporterBM::getDisplayFunctionString(), CODEExporterXPPAUT::getDisplayFunctionString(), CUnitValidator::getUnit(), CUnitValidator::getUnits(), CExpression::getXPPString(), SBMLImporter::importEvent(), SBMLImporter::importInitialAssignments(), SBMLImporter::importRuleForModelEntity(), CMathDerive::initOneVar(), SBMLImporter::isConstantFlux(), CSBMLExporter::isEventAssignmentSBMLCompatible(), CSBMLExporter::isEventSBMLCompatible(), CSBMLExporter::isExpressionSBMLCompatible(), SBMLImporter::isMassAction(), SBMLImporter::isMassActionFunction(), CSBMLExporter::isModelSBMLCompatible(), CMathObject::isPrerequisiteForContext(), CODEExporter::modifyTreeForMassAction(), CSBMLExporter::orderRules(), CModel::prepareElasticity(), CODEExporterC::preprocess(), CMathExpression::relocate(), SBMLImporter::removeUnusedFunctions(), CODEExporterC::setExportNameOfFunction(), CReaction::setFunctionFromExpressionTree(), CExpression::setInfix(), CUnitValidator::setUnits(), CFunction::splitFunction(), CExpression::updateInfix(), CModelParameter::updateModel(), CUnitValidator::validate(), CFunction::writeMathML(), and CExpression::writeMathML().
const CEvaluationNode * CEvaluationTree::getRoot | ( | ) | const |
Returns the root node of the tree.
References mpRootNode.
const CEvaluationTree::Type & CEvaluationTree::getType | ( | ) | const |
Retrieves the type of the function
References mType.
Referenced by CMathExpression::CMathExpression(), copy(), SBMLImporter::createCFunctionFromFunctionDefinition(), SBMLImporter::createCReactionFromReaction(), CSBMLExporter::createKineticExpression(), CKinFunction::createParameters(), CUnitValidator::CUnitValidator(), CODEExporter::exportKineticFunction(), CODEExporterC::exportKineticFunctionGroup(), CODEExporterC::exportSingleFunction(), CODEExporter::findFunctionsCalls(), CReactionInterface::getFunction(), SBMLImporter::isMassAction(), CODEExporterC::KineticFunction2ODEmember(), CFunctionDB::load(), CODEExporter::modifyTreeForMassAction(), CODEExporterC::preprocess(), SBMLImporter::restoreFunctionDB(), CCopasiXML::saveFunctionList(), CODEExporterC::setExportNameOfFunction(), and CUnitValidator::validate().
|
virtual |
Retrieve the index to the value of the named variable.
const | std::string & name |
Reimplemented in CFunction.
References C_INVALID_INDEX.
Referenced by CEvaluationNodeVariable::compile().
|
virtual |
Retrieve the value of the indexed variable
const | size_t & index |
Reimplemented in CFunction.
References C_FLOAT64.
Referenced by CEvaluationNodeVariable::calculate().
bool CEvaluationTree::hasCircularDependency | ( | ) | const |
bool CEvaluationTree::hasDiscontinuity | ( | ) | const |
Check whether tree may introduce discontinuities.
References CEvaluationNode::CALL, CEvaluationNode::CEIL, CEvaluationNode::CHOICE, CEvaluationNode::EXPRESSION, CEvaluationNode::FLOOR, CEvaluationNode::FUNCTION, CEvaluationNodeCall::getCalledTree(), hasDiscontinuity(), CEvaluationNode::IF, CEvaluationNode::MODULUS, mpNodeList, CEvaluationNode::OPERATOR, and CEvaluationNode::REMAINDER.
Referenced by hasDiscontinuity().
|
private |
Initialize the contained CDataObjects
References CDataContainer::addObjectReference(), and mValue.
Referenced by CEvaluationTree().
bool CEvaluationTree::isBoolean | ( | ) | const |
Check whether this function evaluates to a boolean value.
References CEvaluationNode::isBoolean(), and mpRootNode.
Referenced by CEvaluationNodeCall::compile(), CEvaluationNodeCall::isBoolean(), CMathDelay::modifyMathObject(), CExpression::setInfix(), and CExpression::setIsBoolean().
bool CEvaluationTree::mapObjectNodes | ( | const CDataContainer * | pSrc, |
const CDataContainer * | pTarget | ||
) |
Map object nodes which are children of the src container to children of the target container
const | CDataContainer * pSrc |
const | CDataContainer * pTarget |
References buildCalculationSequence(), CEvaluationNode::CALL, CEvaluationNode::CN, CEvaluationNode::EXPRESSION, CEvaluationNode::FUNCTION, CEvaluationNodeCall::getCalledTree(), CDataObject::getCN(), CEvaluationNodeObject::getObjectInterfacePtr(), CDataObject::getPrerequisites(), CEvaluationNode::getValuePointer(), CEvaluationNodeObject::mapObject(), mapObjectNodes(), mCalculationSequence, mpNodeList, CDataObject::mPrerequisits, mpRootNode, mpRootValue, mValue, CEvaluationNode::OBJECT, and CVector< CType >::resize().
Referenced by COptProblem::initialize(), and mapObjectNodes().
bool CEvaluationTree::operator== | ( | const CEvaluationTree & | rhs | ) | const |
|
protected |
Parse the description
References CValidity::add(), CFlags< Enum >::All, clearNodes(), CCopasiMessage::ERROR, CIssue::Error, CIssue::ExpressionInvalid, CEvaluationParserBase::getErrorPosition(), CEvaluationParserBase::getNodeList(), CEvaluationParserBase::getRootNode(), CEvaluationNode::getValuePointer(), hasCircularDependency(), CIssue::HasCircularDependency, MassAction, MCFunction, mErrorPosition, mInfix, mpNodeList, mpRootNode, mpRootValue, mType, CObjectInterface::mValidity, mValue, CValidity::remove(), CEvaluationNode::setTree(), CIssue::Success, and CEvaluationParserBase::yyparse().
Referenced by setInfix().
|
virtual |
Set the infix description of the tree and compile it.
const | std::string & infix |
Reimplemented in CExpression, CMassAction, and CFunction.
References CValidity::clear(), CIssue::Error, mInfix, CObjectInterface::mValidity, parse(), and CIssue::Success.
Referenced by CEvaluationTree(), CMathObject::compileDependentMass(), CMathObject::compileParticleFlux(), CMathObject::compilePropensity(), CMathObject::compileReactionNoise(), CMathObject::compileTotalMass(), CMathObject::compileTransitionTime(), CMathContainer::createDelays(), CSBMLExporter::createEvent(), CMathObject::createExtensiveReactionNoiseExpression(), CMathObject::createExtensiveReactionRateExpression(), CMathObject::createExtensiveValueExpression(), CMathObject::createIntensiveRateExpression(), CMathObject::createIntensiveValueExpression(), CSBMLExporter::createRule(), CSBMLExporter::exportEventAssignments(), CFunction::setInfix(), and CExpression::setInfix().
|
virtual |
Sets the root node of the tree.
CEvaluationNode* | root node of the tree |
Reimplemented in CMathExpression.
References clearNodes(), CCopasiNode< _Data >::getParent(), mpRootNode, CEvaluationNode::setTree(), and updateTree().
Referenced by CFunction::createCopy(), SBMLImporter::createCReactionFromReaction(), SBMLImporter::createExpressionFromFunction(), SBMLImporter::importEvent(), SBMLImporter::importInitialAssignments(), SBMLImporter::importRuleForModelEntity(), CModel::prepareElasticity(), CReaction::setFunctionFromExpressionTree(), CMathExpression::setRoot(), setTree(), and CFunction::splitFunction().
bool CEvaluationTree::setTree | ( | const ASTNode & | pRootNode, |
bool | isFunction | ||
) |
Sets the complete tree from an SBML ASTNode.
const | ASTNode& root node of the tree |
bool | isFunction |
References CCopasiNode< _Data >::addChild(), CEvaluationNode::Boolean, CNodeContextIterator< Node, Context >::end(), CIssue::Error, fromAST(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::IF, mpRootNode, CNodeContextIterator< Node, Context >::next(), CEvaluationNode::Number, setRoot(), CEvaluationNode::setValueType(), CEvaluationNode::Unknown, updateTree(), and CIssue::ValueTypeMismatch.
Referenced by SBMLImporter::applyStoichiometricExpressions(), SBMLImporter::createCFunctionFromFunctionTree(), SBMLImporter::importEvent(), SBMLImporter::importInitialAssignments(), and SBMLImporter::importRuleForModelEntity().
|
protected |
Set the type of the function
const | CEvaluationTree::Type & type |
References mType.
Referenced by create(), and CFunction::load().
size_t CEvaluationTree::size | ( | ) | const |
Retrieve the number of node evaluations required to computate the value of the tree.
References mCalculationSequence, and CVectorCore< CType >::size().
Referenced by SBMLImporter::findCorrespondingFunction(), and CModelMerging::mergeMetabolites().
|
virtual |
Converts a CEvaluationTree to an ASTNode based tree.
References mpRootNode, and CEvaluationNode::toAST().
|
virtual |
Retrieve the data describing the object
Reimplemented from CDataContainer.
Reimplemented in CFunction.
References CDataContainer::toData().
Referenced by CFunction::toData().
CIssue CEvaluationTree::updateTree | ( | ) |
Updates the infix and the nodeList
References CValidity::add(), CFlags< Enum >::All, CEvaluationNode::buildInfix(), clearNodes(), CIssue::Error, CIssue::ExpressionInvalid, CEvaluationNode::getValuePointer(), CIssue::HasCircularDependency, mInfix, mpNodeList, mpRootNode, mpRootValue, CObjectInterface::mValidity, mValue, CValidity::remove(), and CIssue::StructureInvalid.
Referenced by CMathExpression::compile(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), CModelAdd::copyInitialExpression(), CModelAdd::copyTriggerExpression(), CExpression::createInitialExpression(), CModelMerging::mergeInExpression(), setRoot(), and setTree().
|
protected |
A vector of nodes which need to be calculated in sequence
Referenced by buildCalculationSequence(), calculate(), CMathExpression::compile(), compileNodes(), mapObjectNodes(), and size().
|
private |
The error position in case the compilation fails. std::string::npos indicates no error.
Referenced by compileNodes(), getErrorPosition(), and parse().
|
protected |
The key of the function The infix representation of the expression
Referenced by CEvaluationTree(), CMathExpression::compile(), CExpression::compile(), compileNodes(), CMathExpression::convertToInitialExpression(), getInfix(), CFunction::initVariables(), operator==(), parse(), CMathExpression::relocate(), setInfix(), CFunction::setInfix(), CExpression::updateInfix(), and updateTree().
|
protected |
A vector of nodes containing the result of parse.
Referenced by calls(), clearNodes(), CMathExpression::compile(), compileNodes(), containsCN(), CMathExpression::convertToInitialExpression(), CKinFunction::createParameters(), getNodeList(), hasDiscontinuity(), CFunction::initVariables(), mapObjectNodes(), parse(), CFunction::setInfix(), CExpression::setInfix(), and updateTree().
|
private |
The root node of the tree.
Referenced by buildCalculationSequence(), calculate(), clearNodes(), compileNodes(), getRoot(), isBoolean(), mapObjectNodes(), parse(), setRoot(), setTree(), toAST(), and updateTree().
|
protected |
Referenced by calculate(), clearNodes(), compileNodes(), CMathExpression::convertToInitialExpression(), mapObjectNodes(), parse(), and updateTree().
|
protected |
The type of the function
Referenced by getType(), CFunction::isReadOnly(), operator==(), parse(), and setType().
|
protected |
The last computed value of the tree;
Referenced by calculate(), CExpression::calcValue(), CFunction::calcValue(), CMassAction::calcValue(), clearNodes(), compileNodes(), initObjects(), mapObjectNodes(), parse(), updateTree(), and CMathExpression::value().
|
static |
The string representation of valid types of a function
|
static |
The string representation of valid types of a function
Referenced by FunctionHandler::processStart(), and CCopasiXML::saveFunctionList().