COPASI API
4.16.103
|
#include <CEvaluationTree.h>
Public Types | |
enum | Type { Function = 0, MassAction, PreDefined, UserDefined, Expression, MathExpression } |
![]() | |
typedef std::multimap < std::string, CCopasiObject * > | objectMap |
![]() | |
typedef std::set< const CCopasiObject * > | DataObjectSet |
typedef std::vector< Refresh * > | DataUpdateSequence |
![]() | |
typedef std::set< const CObjectInterface * > | ObjectSet |
typedef std::vector < CObjectInterface * > | UpdateSequence |
Public Member Functions | |
bool | calls (std::set< std::string > &list) const |
CEvaluationTree (const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const Type &type=Function) | |
CEvaluationTree (const CEvaluationTree &src, const CCopasiContainer *pParent=NULL) | |
virtual bool | compile () |
bool | dependsOnTree (const std::string &name) const |
CCopasiObject::DataObjectSet | getDeletedObjects () const |
std::string::size_type | getErrorPosition () const |
const std::string & | getInfix () const |
const std::vector < CEvaluationNode * > & | getNodeList () 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 | isUsable () const |
bool | operator== (const CEvaluationTree &rhs) const |
virtual bool | setInfix (const std::string &infix) |
virtual bool | setRoot (CEvaluationNode *pRootNode) |
bool | setTree (const ASTNode &pRootNode) |
virtual ASTNode * | toAST (const CCopasiDataModel *pDataModel) const |
bool | updateTree () |
virtual | ~CEvaluationTree () |
![]() | |
virtual bool | add (CCopasiObject *pObject, const bool &adopt=true) |
CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container) | |
CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL) | |
virtual std::string | getChildObjectUnits (const CCopasiObject *pObject) const |
virtual const CObjectInterface * | getObject (const CCopasiObjectName &cn) const |
virtual const objectMap & | getObjects () const |
virtual std::string | getUnits () const |
virtual const CCopasiObject * | getValueObject () const |
virtual bool | remove (CCopasiObject *pObject) |
virtual | ~CCopasiContainer () |
![]() | |
void | addDirectDependency (const CCopasiObject *pObject) |
CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL) | |
void | clearDirectDependencies () |
void | clearRefresh () |
bool | dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const |
void | getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const |
virtual CCopasiObjectName | getCN () const |
virtual const DataObjectSet & | getDirectDependencies (const DataObjectSet &context=DataObjectSet()) const |
virtual const std::string & | getKey () const |
CCopasiContainer * | getObjectAncestor (const std::string &type) const |
CCopasiDataModel * | getObjectDataModel () |
const CCopasiDataModel * | getObjectDataModel () const |
virtual std::string | getObjectDisplayName (bool regular=true, bool richtext=false) const |
const std::string & | getObjectName () const |
CCopasiContainer * | getObjectParent () const |
const std::string & | getObjectType () const |
virtual const CObjectInterface::ObjectSet & | getPrerequisites () const |
virtual Refresh * | getRefresh () const |
UpdateMethod * | getUpdateMethod () const |
virtual void * | getValuePointer () const |
bool | hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const |
bool | hasUpdateMethod () const |
bool | isArray () const |
bool | isContainer () const |
bool | isDataModel () const |
bool | isMatrix () const |
bool | isNameVector () const |
bool | isNonUniqueName () const |
virtual bool | isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const |
bool | isReference () const |
bool | isRoot () const |
bool | isSeparator () const |
bool | isStaticString () const |
bool | isValueBool () const |
bool | isValueDbl () const |
bool | isValueInt () const |
bool | isValueInt64 () const |
bool | isValueString () const |
bool | isVector () const |
virtual bool | mustBeDeleted (const DataObjectSet &deletedObjects) const |
virtual void | print (std::ostream *ostream) const |
void | removeDirectDependency (const CCopasiObject *pObject) |
void | setDirectDependencies (const DataObjectSet &directDependencies) |
bool | setObjectName (const std::string &name) |
virtual bool | setObjectParent (const CCopasiContainer *pParent) |
void | setObjectValue (const C_FLOAT64 &value) |
void | setObjectValue (const C_INT32 &value) |
void | setObjectValue (const bool &value) |
template<class CType > | |
void | setRefresh (CType *pType, void(CType::*method)(void)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const bool &)) |
virtual | ~CCopasiObject () |
![]() | |
CObjectInterface () | |
virtual | ~CObjectInterface () |
Static Public Member Functions | |
static CEvaluationTree * | copy (const CEvaluationTree &src) |
static CEvaluationTree * | create (CEvaluationTree::Type type) |
static CEvaluationNode * | fromAST (const ASTNode *pASTNode) |
![]() | |
static std::vector< Refresh * > | buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet()) |
static void | setRenameHandler (CRenameHandler *rh) |
Static Public Attributes | |
static const std::string | TypeName [] |
static const char * | XMLType [] |
![]() | |
static const std::vector < CCopasiContainer * > | EmptyList |
Protected Member Functions | |
void | buildCalculationSequence () |
void | calculate () |
bool | compileNodes () |
bool | parse () |
void | setType (const CEvaluationTree::Type &type) |
![]() | |
template<class CType > | |
CCopasiObject * | addMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
template<class CType > | |
CCopasiObject * | addObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
template<class CType > | |
CCopasiObject * | addVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
void | initObjects () |
![]() | |
CCopasiObject () | |
CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0) | |
Protected Attributes | |
std::vector< CEvaluationNode * > | mCalculationSequence |
std::string | mInfix |
std::vector< CEvaluationNode * > * | mpNodeList |
CEvaluationNode * | mpRoot |
CEvaluationTree::Type | mType |
bool | mUsable |
C_FLOAT64 | mValue |
![]() | |
objectMap | mObjects |
Private Member Functions | |
void | initObjects () |
Private Attributes | |
std::string::size_type | mErrorPosition |
Additional Inherited Members | |
![]() | |
enum | Flag { Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8, Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80, ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800, Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000, Root = 0x10000, Gui = 0x20000 } |
![]() | |
static CRenameHandler * | smpRenameHandler = NULL |
Definition at line 28 of file CEvaluationTree.h.
The valid types of a function
Enumerator | |
---|---|
Function | |
MassAction | |
PreDefined | |
UserDefined | |
Expression | |
MathExpression |
Definition at line 35 of file CEvaluationTree.h.
CEvaluationTree::CEvaluationTree | ( | const std::string & | name = "NoName" , |
const CCopasiContainer * | pParent = NULL , |
||
const Type & | type = Function |
||
) |
Default constructor
const | std::string & name (default: "NoName") |
const | CCopasiContainer * pParent (default: NULL) |
const | CEvaluationTree::Type & type (default: Function) |
Definition at line 129 of file CEvaluationTree.cpp.
References initObjects(), and setInfix().
CEvaluationTree::CEvaluationTree | ( | const CEvaluationTree & | src, |
const CCopasiContainer * | pParent = NULL |
||
) |
Copy constructor
const | CEvaluationTree & src |
const | CCopasiContainer * pParent (default: NULL) |
Definition at line 146 of file CEvaluationTree.cpp.
References initObjects(), mInfix, and setInfix().
|
virtual |
Destructor
Definition at line 162 of file CEvaluationTree.cpp.
References CEvaluationParserBase::freeNodeList(), and mpNodeList.
|
protected |
Build the sequence of calculations required to determine the value of the expression.
Definition at line 277 of file CEvaluationTree.cpp.
References CEvaluationNode::CONSTANT, CNodeContextIterator< Node, int >::end(), CEvaluationNode::getType(), mCalculationSequence, mpRoot, CNodeContextIterator< Node, int >::next(), CEvaluationNode::NUMBER, CEvaluationNode::OBJECT, and CEvaluationNode::type().
Referenced by CMathExpression::compile(), and compileNodes().
Calculate the value
Definition at line 394 of file CEvaluationTree.cpp.
References CEvaluationNode::getValue(), mCalculationSequence, mpRoot, 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 |
Definition at line 663 of file CEvaluationTree.cpp.
References CEvaluationNode::CALL, CCopasiObject::getObjectName(), and mpNodeList.
Referenced by CEvaluationNodeCall::calls(), and hasCircularDependency().
|
virtual |
Compile the evaluation tree.
Reimplemented in CMathExpression, and CMassAction.
Definition at line 263 of file CEvaluationTree.cpp.
References compileNodes().
Referenced by CMathEventN::CTrigger::allocate(), CExpression::CExpression(), CFunction::CFunction(), SBMLImporter::createCFunctionFromFunctionTree(), CCopasiXMLParser::ListOfFunctionsElement::end(), SBMLImporter::importFunctionDefinitions(), CCopasiRootContainer::initializeChildren(), CFunctionDB::load(), FunctionWidget1::saveToFunction(), CReaction::setFunctionFromExpressionTree(), FunctionWidget1::slotFcnDescriptionChanged(), CFunction::splitFunction(), test000058::test_bug1025_10(), test000058::test_bug1025_5(), test000059::test_unique_id_17(), test000059::test_unique_id_18(), test000059::test_unique_id_19(), test000059::test_unique_id_20(), test000059::test_unique_id_21(), and test000059::test_unique_id_21_2().
|
protected |
Compile the individual nodes.
Definition at line 297 of file CEvaluationTree.cpp.
References CCopasiObject::addDirectDependency(), buildCalculationSequence(), CEvaluationNode::CALL, CCopasiObject::clearDirectDependencies(), CEvaluationNode::compile(), CNodeContextIterator< Node, int >::end(), CCopasiMessage::ERROR, Expression, CMathObject::getDataObject(), CCopasiObject::getObjectName(), mCalculationSequence, MCFunction, mErrorPosition, mInfix, mpNodeList, mpRoot, mType, mUsable, CNodeContextIterator< Node, int >::next(), and CEvaluationNode::OBJECT.
Referenced by CExpression::compile(), compile(), and CFunction::setInfix().
|
static |
Copy an EvaluationTree of the specified type. Note: the returned object has to be released after use with delete.
const | EvaluationTree & src |
Definition at line 98 of file CEvaluationTree.cpp.
References Expression, fatalError, Function, getType(), MassAction, PreDefined, and UserDefined.
Referenced by FunctionWidget1::loadFromFunction().
|
static |
Create an EvaluationTree of the specified type. Note: the returned object has to be released after use with delete.
CEvaluationTree::Type | type |
Definition at line 62 of file CEvaluationTree.cpp.
References Expression, fatalError, Function, MassAction, PreDefined, setType(), and UserDefined.
Referenced by SBMLImporter::createExpressionFromFunction(), SBMLImporter::importEvent(), and CCopasiXMLParser::FunctionElement::start().
bool CEvaluationTree::dependsOnTree | ( | const std::string & | name | ) | const |
Checks whether the tree has a call node referring to the expression with the given name
const | std::string & name |
Definition at line 648 of file CEvaluationTree.cpp.
References CEvaluationNode::CALL, and mpNodeList.
|
static |
Converts an SBML ASTNode to the corresponding CEvaluationNode tree.
const | ASTNode * pASTNode |
Definition at line 472 of file CEvaluationTree.cpp.
References CNodeContextIterator< Node, Context >::context(), CNodeContextIterator< Node, Context >::end(), CCopasiMessage::EXCEPTION, CEvaluationNodeNumber::fromAST(), CEvaluationNodeDelay::fromAST(), CEvaluationNodeConstant::fromAST(), CEvaluationNodeChoice::fromAST(), CEvaluationNodeObject::fromAST(), CEvaluationNodeCall::fromAST(), CEvaluationNodeOperator::fromAST(), CEvaluationNodeLogical::fromAST(), CEvaluationNodeFunction::fromAST(), MCMathML, CNodeContextIterator< Node, Context >::next(), and CNodeContextIterator< Node, Context >::parentContextPtr().
Referenced by create_normalform(), create_simplified_normalform(), SBMLImporter::createCReactionFromReaction(), and setTree().
CCopasiObject::DataObjectSet CEvaluationTree::getDeletedObjects | ( | ) | const |
Retrieve the list of deleted objects.
Definition at line 626 of file CEvaluationTree.cpp.
References CCopasiContainer::getObject().
Referenced by FunctionWidget1::leave(), CQFunctionDM::removeRows(), and FunctionWidget1::slotBtnDelete().
std::string::size_type CEvaluationTree::getErrorPosition | ( | ) | const |
Retrieve the position of the error in the string description. std::string::npos indicates no error.
Definition at line 196 of file CEvaluationTree.cpp.
References mErrorPosition.
const std::string & CEvaluationTree::getInfix | ( | ) | const |
Retrieve the infix description of the tree
Definition at line 188 of file CEvaluationTree.cpp.
References mInfix.
Referenced by CMathEvent::calculateDelayedTime(), CModelEntity::compile(), CMathEvent::compile(), CMathObject::compileFlux(), CMetab::compileInitialValueDependencies(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), FunctionWidget1::copyFunctionContentsToFunction(), CModelAdd::copyInitialExpression(), CModelAdd::copyTriggerExpression(), CSBMLExporter::createEvent(), CQFunctionDM::data(), COptProblem::elevateChildren(), CSBMLExporter::exportEventAssignments(), CEvent::getDelayExpression(), CEventAssignment::getExpression(), CModelEntity::getExpression(), CReactionInterface::getFunctionDescription(), CModelParameter::getInitialExpression(), CModelEntity::getInitialExpression(), CEvent::getPriorityExpression(), CEvent::getTriggerExpression(), COptProblem::initialize(), FunctionWidget1::loadFromFunction(), CNormalTranslation::normAndSimplifyReptdly(), operator<<(), CMetab::refreshInitialConcentration(), CModelEntity::refreshInitialValue(), CCopasiXML::saveFunctionList(), CEvent::setDelayExpression(), CEventAssignment::setExpression(), CEvent::setPriorityExpression(), CEvent::setTriggerExpression(), and test_depth_first_iterator::test_dfi().
const std::vector< CEvaluationNode * > & CEvaluationTree::getNodeList | ( | ) | const |
Retrieve the list of nodes
Definition at line 199 of file CEvaluationTree.cpp.
References mpNodeList.
Referenced by CSBMLExporter::checkForUnsupportedObjectReferences(), CFunction::completeFunctionList(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), CModelAdd::copyInitialExpression(), CModelAdd::copyTriggerExpression(), CExpression::createInitialExpression(), CODEExporter::exportExpression(), CModelExpansion::expressionContainsObject(), CFindDimensions::findDimension(), CODEExporter::isModelEntityExpressionODEExporterCompatible(), CModelMerging::mergeInExpression(), CModelExpansion::replaceInExpression(), and CModelExpansion::updateExpression().
CEvaluationNode * CEvaluationTree::getRoot | ( | ) |
Returns the root node of the tree.
Definition at line 610 of file CEvaluationTree.cpp.
References mpRoot.
Referenced by CMathEventN::CTrigger::allocate(), SBMLImporter::applyStoichiometricExpressions(), SBMLImporter::areEqualFunctions(), CSBMLExporter::checkForPiecewiseFunctions(), CSBMLExporter::checkForUnsupportedFunctionCalls(), CFunctionAnalyzer::checkKineticFunction(), CMathExpression::CMathExpression(), CMathEventN::CTrigger::compile(), CMathTrigger::compile(), CMathTrigger::compileFUNCTION(), CMathExpression::copy(), CMathContainer::copyBranch(), SBMLImporter::createCFunctionFromFunctionTree(), SBMLImporter::createCReactionFromReaction(), CMathContainer::createDiscontinuityEvents(), CSBMLExporter::createEvent(), SBMLImporter::createExpressionFromFunction(), CSBMLExporter::createInitialAssignment(), CSBMLExporter::createRule(), CFunctionAnalyzer::evaluateNode(), expand_function_call(), CSBMLExporter::exportEventAssignments(), CODEExporter::exportKineticFunction(), CODEExporterC::exportKineticFunctionGroup(), CODEExporter::exportModelEntityExpression(), CODEExporter::exportModelValuesExpressions(), CODEExporterC::exportSingleFunction(), CODEExporter::exportSingleFunction(), SBMLImporter::findCorrespondingFunction(), SBMLImporter::findFunctionCalls(), CODEExporter::findFunctionsCalls(), CODEExporterBM::getDisplayExpressionString(), CODEExporterXPPAUT::getDisplayExpressionString(), CODEExporterC::getDisplayExpressionString(), CODEExporterBM::getDisplayFunctionString(), CODEExporterXPPAUT::getDisplayFunctionString(), SBMLImporter::importEvent(), SBMLImporter::importInitialAssignments(), SBMLImporter::importRuleForModelEntity(), SBMLImporter::isConstantFlux(), CSBMLExporter::isEventAssignmentSBMLCompatible(), CSBMLExporter::isEventSBMLCompatible(), CSBMLExporter::isExpressionSBMLCompatible(), SBMLImporter::isMassAction(), SBMLImporter::isMassActionFunction(), CSBMLExporter::isModelSBMLCompatible(), CMathObject::isPrerequisiteForContext(), CODEExporter::modifyTreeForMassAction(), stress_test::normalizeFunctionDB(), CNormalTranslation::normAndSimplifyReptdly(), operator<<(), CSBMLExporter::orderRules(), CODEExporterC::preprocess(), SBMLImporter::removeUnusedFunctions(), CODEExporterC::setExportNameOfFunction(), CReaction::setFunctionFromExpressionTree(), test_depth_first_iterator::test_dfi(), test000082::test_import_delayAssignment_1(), test000082::test_import_delayAssignment_2(), test000082::test_import_delayAssignment_3(), test000082::test_import_delayAssignment_4(), test000082::test_import_delayAssignment_5(), test000082::test_import_delayAssignment_6(), test000082::test_import_delayAssignment_7(), test000082::test_import_delayAssignment_8(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_1(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_2(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_3(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_4(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_5(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_6(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_7(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_8(), test000095::test_import_l3_event_1(), test000095::test_import_l3_event_2(), test000095::test_import_l3_event_3(), test000095::test_import_l3_event_4(), test000095::test_import_l3_event_5(), test000078::test_l2v4_import_unordered_functions(), test000087::test_simulate_reaction_flux_reference_1(), test_biomodels217_expression::test_term_den1(), test_biomodels217_expression::test_term_den12(), test_biomodels217_expression::test_term_den123(), test_biomodels217_expression::test_term_den1234(), test_biomodels217_expression::test_term_den12345(), test_biomodels217_expression::test_term_den123456(), test_biomodels217_expression::test_term_den1234567(), test_biomodels217_expression::test_term_den2(), test_biomodels217_expression::test_term_den3(), test_biomodels217_expression::test_term_den3456(), test_biomodels217_expression::test_term_den346(), test_biomodels217_expression::test_term_den356(), test_biomodels217_expression::test_term_den36(), test_biomodels217_expression::test_term_den4(), test_biomodels217_expression::test_term_den456(), test_biomodels217_expression::test_term_den5(), test_biomodels217_expression::test_term_den56(), test_biomodels217_expression::test_term_den6(), test_biomodels217_expression::test_term_den67(), test_biomodels217_expression::test_term_den7(), test_biomodels217_expression::test_term_num1(), test_biomodels217_expression::test_term_num2(), test_biomodels217_expression::test_term_num3(), test_biomodels217_expression::test_term_num4(), test_biomodels217_expression::test_term_num5(), test_biomodels217_expression::test_term_num6(), test_biomodels217_expression::test_term_num7(), and CModelParameter::updateModel().
const CEvaluationNode * CEvaluationTree::getRoot | ( | ) | const |
Returns the root node of the tree.
Definition at line 605 of file CEvaluationTree.cpp.
References mpRoot.
const CEvaluationTree::Type & CEvaluationTree::getType | ( | ) | const |
Retrieves the type of the function
Definition at line 167 of file CEvaluationTree.cpp.
References mType.
Referenced by CMathExpression::CMathExpression(), copy(), SBMLImporter::createCFunctionFromFunctionDefinition(), SBMLImporter::createCReactionFromReaction(), CSBMLExporter::createKineticExpression(), CKinFunction::createParameters(), CQFunctionDM::data(), CODEExporter::exportKineticFunction(), CODEExporterC::exportKineticFunctionGroup(), CODEExporterC::exportSingleFunction(), CODEExporter::findFunctionsCalls(), CQFunctionDM::isFunctionReadOnly(), SBMLImporter::isMassAction(), CODEExporterC::KineticFunction2ODEmember(), CQTabWidget::load(), CFunctionDB::load(), FunctionWidget1::loadFromFunction(), main(), CODEExporter::modifyTreeForMassAction(), CODEExporterC::preprocess(), SBMLImporter::restoreFunctionDB(), CCopasiXML::saveFunctionList(), CODEExporterC::setExportNameOfFunction(), and test000080::test_mass_action_recognition_bug().
|
virtual |
Retrieve the index to the value of the named variable.
const | std::string & name |
Reimplemented in CFunction.
Definition at line 207 of file CEvaluationTree.cpp.
References C_INVALID_INDEX.
Referenced by CEvaluationNodeVariable::compile().
|
virtual |
Retrieve the value of the indexed variable
const | size_t & index |
Reimplemented in CFunction.
Definition at line 210 of file CEvaluationTree.cpp.
References C_FLOAT64.
Referenced by CEvaluationNodeVariable::calculate().
bool CEvaluationTree::hasCircularDependency | ( | ) | const |
Check whether the the tree has circular dependencies.
Definition at line 641 of file CEvaluationTree.cpp.
References calls().
Referenced by parse().
bool CEvaluationTree::hasDiscontinuity | ( | ) | const |
Check whether tree may introduce discontinuities.
Definition at line 688 of file CEvaluationTree.cpp.
References CEvaluationNode::CALL, CEvaluationNodeFunction::CEIL, CEvaluationNode::CHOICE, CEvaluationNodeCall::EXPRESSION, CEvaluationNodeFunction::FLOOR, CEvaluationNodeCall::FUNCTION, CEvaluationNode::FUNCTION, CEvaluationNodeChoice::IF, CEvaluationNodeOperator::MODULUS, mpNodeList, and CEvaluationNode::OPERATOR.
|
private |
Initialize the contained CCopasiObjects
Definition at line 615 of file CEvaluationTree.cpp.
References CCopasiContainer::addObjectReference(), mValue, CCopasiObject::setDirectDependencies(), and CCopasiObject::ValueDbl.
Referenced by CEvaluationTree().
bool CEvaluationTree::isBoolean | ( | ) | const |
Check whether this function evaluates to a boolean value.
Definition at line 269 of file CEvaluationTree.cpp.
References CEvaluationNode::isBoolean(), and mpRoot.
Referenced by CEvaluationNodeCall::isBoolean(), and CExpression::setIsBoolean().
bool CEvaluationTree::isUsable | ( | ) | const |
Check whether this function is usable, i.e., properly defined
Definition at line 266 of file CEvaluationTree.cpp.
References mUsable.
Referenced by CModelEntity::compile(), CMetab::compileInitialValueDependencies(), and FunctionWidget1::loadFromFunction().
bool CEvaluationTree::operator== | ( | const CEvaluationTree & | rhs | ) | const |
Comparison operator
const | CEvaluationTree & rhs |
Definition at line 191 of file CEvaluationTree.cpp.
|
protected |
Parse the description
Definition at line 216 of file CEvaluationTree.cpp.
References CCopasiMessage::ERROR, CEvaluationParserBase::freeNodeList(), CEvaluationParserBase::getErrorPosition(), CEvaluationParserBase::getNodeList(), CEvaluationParserBase::getRootNode(), hasCircularDependency(), MassAction, MCFunction, mErrorPosition, mInfix, mpNodeList, mpRoot, mType, and CEvaluationParserBase::yyparse().
Referenced by setInfix().
|
virtual |
Set the infix description of the tree and compile it.
const | std::string & infix |
Reimplemented in CMassAction, CExpression, and CFunction.
Definition at line 175 of file CEvaluationTree.cpp.
References mInfix, mUsable, and parse().
Referenced by CEvaluationTree(), CSBMLExporter::createEvent(), CSBMLExporter::createRule(), CSBMLExporter::exportEventAssignments(), CNormalTranslation::normAndSimplifyReptdly(), CQFunctionDM::setData(), CExpression::setInfix(), CFunction::setInfix(), test_depth_first_iterator::test_dfi(), test_biomodels217_expression::test_term_den1(), test_biomodels217_expression::test_term_den12(), test_biomodels217_expression::test_term_den123(), test_biomodels217_expression::test_term_den1234(), test_biomodels217_expression::test_term_den12345(), test_biomodels217_expression::test_term_den123456(), test_biomodels217_expression::test_term_den1234567(), test_biomodels217_expression::test_term_den2(), test_biomodels217_expression::test_term_den3(), test_biomodels217_expression::test_term_den3456(), test_biomodels217_expression::test_term_den346(), test_biomodels217_expression::test_term_den356(), test_biomodels217_expression::test_term_den36(), test_biomodels217_expression::test_term_den4(), test_biomodels217_expression::test_term_den456(), test_biomodels217_expression::test_term_den5(), test_biomodels217_expression::test_term_den56(), test_biomodels217_expression::test_term_den6(), test_biomodels217_expression::test_term_den67(), test_biomodels217_expression::test_term_den7(), test_biomodels217_expression::test_term_num1(), test_biomodels217_expression::test_term_num2(), test_biomodels217_expression::test_term_num3(), test_biomodels217_expression::test_term_num4(), test_biomodels217_expression::test_term_num5(), test_biomodels217_expression::test_term_num6(), and test_biomodels217_expression::test_term_num7().
|
virtual |
Sets the root node of the tree.
CEvaluationNode* | root node of the tree |
Reimplemented in CMathExpression.
Definition at line 422 of file CEvaluationTree.cpp.
References CEvaluationParserBase::freeNodeList(), CCopasiNode< _Data >::getParent(), mpNodeList, mpRoot, and updateTree().
Referenced by CMathTrigger::compile(), CMathTrigger::compileGE(), CMathTrigger::compileGT(), CMathTrigger::compileLE(), CMathTrigger::compileLT(), SBMLImporter::createCFunctionFromFunctionTree(), CFunction::createCopy(), SBMLImporter::createCReactionFromReaction(), SBMLImporter::createExpressionFromFunction(), SBMLImporter::importEvent(), SBMLImporter::importInitialAssignments(), SBMLImporter::importRuleForModelEntity(), CReaction::setFunctionFromExpressionTree(), CMathExpression::setRoot(), setTree(), CFunction::splitFunction(), and test000055::test_bug1004().
bool CEvaluationTree::setTree | ( | const ASTNode & | pRootNode | ) |
Sets the complete tree from an SBML ASTNode.
const | ASTNode& root node of the tree |
Definition at line 467 of file CEvaluationTree.cpp.
References fromAST(), and setRoot().
Referenced by SBMLImporter::applyStoichiometricExpressions(), SBMLImporter::createCFunctionFromFunctionTree(), SBMLImporter::importEvent(), SBMLImporter::importInitialAssignments(), and SBMLImporter::importRuleForModelEntity().
|
protected |
Set the type of the function
const | CEvaluationTree::Type & type |
Definition at line 170 of file CEvaluationTree.cpp.
References mType.
Referenced by create(), and CFunction::load().
|
virtual |
Converts a CEvaluationTree to an ASTNode based tree.
Definition at line 636 of file CEvaluationTree.cpp.
References mpRoot, and CEvaluationNode::toAST().
bool CEvaluationTree::updateTree | ( | ) |
Updates the infix and the nodeList
Definition at line 438 of file CEvaluationTree.cpp.
References CEvaluationNode::buildInfix(), CEvaluationParserBase::freeNodeList(), mInfix, mpNodeList, and mpRoot.
Referenced by CMathExpression::compile(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), CModelAdd::copyInitialExpression(), CModelAdd::copyTriggerExpression(), SBMLImporter::createCFunctionFromFunctionTree(), CExpression::createInitialExpression(), CModelMerging::mergeInExpression(), and setRoot().
|
protected |
A vector of nodes which need to be calculated in sequence
Definition at line 332 of file CEvaluationTree.h.
Referenced by buildCalculationSequence(), calculate(), CMathExpression::compile(), and compileNodes().
|
private |
The error position in case the compilation fails. std::string::npos indicates no error.
Definition at line 311 of file CEvaluationTree.h.
Referenced by compileNodes(), getErrorPosition(), and parse().
|
protected |
The key of the function The infix representation of the expression
Definition at line 299 of file CEvaluationTree.h.
Referenced by CEvaluationTree(), CExpression::compile(), CMathExpression::compile(), compileNodes(), CMathExpression::convertToInitialExpression(), getInfix(), CFunction::initVariables(), operator==(), parse(), setInfix(), CExpression::updateInfix(), and updateTree().
|
protected |
A vector of nodes containing the result of parse.
Definition at line 317 of file CEvaluationTree.h.
Referenced by calls(), CMathExpression::compile(), compileNodes(), CMathExpression::convertToInitialExpression(), CKinFunction::createParameters(), dependsOnTree(), getNodeList(), hasDiscontinuity(), CFunction::initVariables(), parse(), CExpression::setInfix(), CFunction::setInfix(), setRoot(), CExpression::updateInfix(), updateTree(), and ~CEvaluationTree().
|
protected |
The root node of the tree.
Definition at line 322 of file CEvaluationTree.h.
Referenced by buildCalculationSequence(), calculate(), CMathExpression::CMathExpression(), CExpression::compile(), compileNodes(), CMathExpression::convertToInitialExpression(), CFunction::createCopy(), CKinFunction::createParameters(), CExpression::getBerkeleyMadonnaString(), CExpression::getCCodeString(), getRoot(), CExpression::getXPPString(), isBoolean(), parse(), CExpression::setInfix(), setRoot(), CFunction::splitFunction(), toAST(), CExpression::updateInfix(), updateTree(), CExpression::writeMathML(), and CFunction::writeMathML().
|
protected |
The type of the function
Definition at line 287 of file CEvaluationTree.h.
Referenced by compileNodes(), getType(), operator==(), parse(), and setType().
|
protected |
Value indicating whether this functions might be used in a model
Definition at line 304 of file CEvaluationTree.h.
Referenced by CMassAction::compile(), CMathExpression::compile(), compileNodes(), isUsable(), and setInfix().
|
protected |
The last computed value of the tree;
Definition at line 327 of file CEvaluationTree.h.
Referenced by calculate(), CMassAction::calcValue(), CExpression::calcValue(), CFunction::calcValue(), initObjects(), and CMathExpression::value().
|
static |
The string representation of valid types of a function
Definition at line 48 of file CEvaluationTree.h.
Referenced by CQFunctionDM::data().
|
static |
The string representation of valid types of a function
Definition at line 53 of file CEvaluationTree.h.
Referenced by CCopasiXML::saveFunctionList(), and CCopasiXMLParser::FunctionElement::start().