COPASI API  4.40.278
CMathDependencyGraph Class Reference

#include <CMathDependencyGraph.h>

Public Types

typedef NodeMap::const_iterator const_iterator
 
typedef NodeMap::iterator iterator
 
typedef std::map< const CObjectInterface *, CMathDependencyNode * > NodeMap
 

Public Member Functions

iterator addObject (const CObjectInterface *pObject)
 
bool appendAllDependents (const CObjectInterface::ObjectSet &changedObjects, CObjectInterface::ObjectSet &dependentObjects, const CObjectInterface::ObjectSet &ignoredObjects=CObjectInterface::ObjectSet()) const
 
bool appendDirectDependents (const CObjectInterface::ObjectSet &changedObjects, CObjectInterface::ObjectSet &dependentObjects) const
 
void clear ()
 
 CMathDependencyGraph (CMathContainer *pContainer=NULL)
 
 CMathDependencyGraph (const CMathDependencyGraph &src, CMathContainer *pContainer=NULL)
 
bool dependsOn (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface *pChangedObject) const
 
bool dependsOn (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
void exportDOTFormat (std::ostream &os, const std::string &name) const
 
bool getUpdateSequence (CCore::CUpdateSequence &updateSequence, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects, const CObjectInterface::ObjectSet &requestedObjects, const CObjectInterface::ObjectSet &calculatedObjects=CObjectInterface::ObjectSet()) const
 
bool hasCircularDependencies (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface *pChangedObject) const
 
void relocate (const CMathContainer *pContainer, const std::vector< CMath::sRelocate > &relocations)
 
void removeObject (const CObjectInterface *pObject)
 
void removePrerequisite (const CObjectInterface *pObject, const CObjectInterface *pPrerequisite)
 
 ~CMathDependencyGraph ()
 

Private Member Functions

std::string getDOTNodeId (const CObjectInterface *pObject) const
 

Private Attributes

std::map< const CObjectInterface *, size_t > mObject2Index
 
NodeMap mObjects2Nodes
 
CMathContainermpContainer
 

Member Typedef Documentation

◆ const_iterator

typedef NodeMap::const_iterator CMathDependencyGraph::const_iterator

◆ iterator

typedef NodeMap::iterator CMathDependencyGraph::iterator

◆ NodeMap

Constructor & Destructor Documentation

◆ CMathDependencyGraph() [1/2]

CMathDependencyGraph::CMathDependencyGraph ( CMathContainer pContainer = NULL)

Constructor

◆ CMathDependencyGraph() [2/2]

CMathDependencyGraph::CMathDependencyGraph ( const CMathDependencyGraph src,
CMathContainer pContainer = NULL 
)

Copy constructor

References mObjects2Nodes.

◆ ~CMathDependencyGraph()

CMathDependencyGraph::~CMathDependencyGraph ( )

Destructor

References clear().

Member Function Documentation

◆ addObject()

CMathDependencyGraph::iterator CMathDependencyGraph::addObject ( const CObjectInterface pObject)

Add an object and all its prerequisites to the tree

Parameters
constCObjectInterface * pObject
Returns
std::map< const CObjectInterface *, CMathDependencyNode * >::iterator itObject

References CObjectInterface::getPrerequisites(), and mObjects2Nodes.

Referenced by CMathContainer::addAnalysisEvent(), CMathContainer::addAnalysisObject(), CModel::buildDependencyGraphs(), CMathContainer::createDependencyGraphs(), and COptProblem::initialize().

◆ appendAllDependents()

bool CMathDependencyGraph::appendAllDependents ( const CObjectInterface::ObjectSet changedObjects,
CObjectInterface::ObjectSet dependentObjects,
const CObjectInterface::ObjectSet ignoredObjects = CObjectInterface::ObjectSet() 
) const

Append all objects which depend on the given changed objects

Parameters
constCObjectInterface::ObjectSet & changedObjects
CObjectInterface::ObjectSet& dependentObjects
Returns
bool objectsAppendee

References CCore::Default, exportDOTFormat(), and mObjects2Nodes.

Referenced by CModel::appendAllDependents(), CFunctionDB::appendDependentFunctions(), and CMathContainer::createUpdateSimulationValuesSequence().

◆ appendDirectDependents()

bool CMathDependencyGraph::appendDirectDependents ( const CObjectInterface::ObjectSet changedObjects,
CObjectInterface::ObjectSet dependentObjects 
) const

Append all objects which directly depend on the given changed objects

Parameters
constCObjectInterface::ObjectSet & changedObjects
CObjectInterface::ObjectSet& dependentObjects
Returns
bool objectsAppendee

References mObjects2Nodes.

Referenced by CModel::appendDirectDependents(), and CModel::functionDefinitionChanged().

◆ clear()

void CMathDependencyGraph::clear ( )

◆ dependsOn() [1/2]

bool CMathDependencyGraph::dependsOn ( const CObjectInterface pObject,
const CCore::SimulationContextFlag context,
const CObjectInterface pChangedObject 
) const

Check whether the given object depends on the changed object in given context

Parameters
constCObjectInterface * pObject
constCCore::SimulationContextFlag & context
constCObjectInterface * pChangedObject
Returns
bool dependsOn

References CMathUpdateSequence::empty(), getUpdateSequence(), and CMathUpdateSequence::insert().

Referenced by CHybridMethod::setupDependencyGraph().

◆ dependsOn() [2/2]

bool CMathDependencyGraph::dependsOn ( const CObjectInterface pObject,
const CCore::SimulationContextFlag context,
const CObjectInterface::ObjectSet changedObjects 
) const

Check whether the given object depends on any of the changed objects in given context

Parameters
constCObjectInterface * pObject
constCCore::SimulationContextFlag & context
constCObjectInterface::ObjectSet & changedObjects
Returns
bool dependsOn

References CMathUpdateSequence::empty(), getUpdateSequence(), and CMathUpdateSequence::insert().

◆ exportDOTFormat()

void CMathDependencyGraph::exportDOTFormat ( std::ostream &  os,
const std::string &  name 
) const

◆ getDOTNodeId()

◆ getUpdateSequence()

bool CMathDependencyGraph::getUpdateSequence ( CCore::CUpdateSequence updateSequence,
const CCore::SimulationContextFlag context,
const CObjectInterface::ObjectSet changedObjects,
const CObjectInterface::ObjectSet requestedObjects,
const CObjectInterface::ObjectSet calculatedObjects = CObjectInterface::ObjectSet() 
) const

Construct a update sequence for the given context. Please note the calculated objects must be calculated based on the same changed values and context.

Parameters
constCCore::SimulationContextFlag & context
CCore::CUpdateSequence& updateSequence
constCObjectInterface::ObjectSet & changedObjects
constCObjectInterface::ObjectSet & requestedObjects
constCObjectInterface::ObjectSet & calculatedObjects (default: none)
Returns
bool success

References CMathUpdateSequence::begin(), CMathUpdateSequence::end(), exportDOTFormat(), CMathContainer::getRandomObject(), mObjects2Nodes, mpContainer, and CMathUpdateSequence::setMathContainer().

Referenced by CMathContainer::analyzeRoots(), ResultData::applyToModelStateFromOptTask(), CMathContainer::areObjectsConstant(), CModel::buildInitialRefreshSequence(), CMathContainer::calculateElasticityDependencies(), CMathContainer::calculateJacobianDependencies(), CMathContainer::compile(), CExperiment::compile(), COutputHandler::compileUpdateSequence(), CMathContainer::createApplyInitialValuesSequence(), CMathContainer::createSynchronizeInitialValuesSequence(), CMathContainer::createUpdateAllTransientDataValuesSequence(), CMathDelay::createUpdateSequences(), CMathEvent::createUpdateSequences(), CMathContainer::createUpdateSimulationValuesSequence(), dependsOn(), hasCircularDependencies(), CScanMethod::init(), COptProblem::initialize(), CFitProblem::initialize(), CNewtonMethod::initialize(), CSensMethod::initialize(), CTimeSensMethod::initializeDerivativesCalculations(), CMCAMethod::isValidProblem(), CHybridMethodODE45::partitionSystem(), CHybridMethod::setupDependencyGraph(), CStochasticRungeKuttaRI5::start(), CStochDirectMethod::start(), CStochMethod::start(), CTrajAdaptiveSA::start(), and CTrajectoryMethodDsaLsodar::start().

◆ hasCircularDependencies()

bool CMathDependencyGraph::hasCircularDependencies ( const CObjectInterface pObject,
const CCore::SimulationContextFlag context,
const CObjectInterface pChangedObject 
) const

Check whether the given object depends on the changed object in given context

Parameters
constCCore::SimulationContextFlag & context
constCObjectInterface * pChangedObject
Returns
bool dependsOn

References CCopasiMessage::getLastMessage(), getUpdateSequence(), CMathUpdateSequence::insert(), and CCopasiMessage::size().

Referenced by CMathContainer::createValueChangeProhibited().

◆ relocate()

void CMathDependencyGraph::relocate ( const CMathContainer pContainer,
const std::vector< CMath::sRelocate > &  relocations 
)

Relocate the objects in the nodes of the graph.

Parameters
constCMathContainer * pContainer
std::vector<CMath::sRelocate > & relocations

References mObjects2Nodes, CMathContainer::relocateObject(), and removeObject().

Referenced by CMathContainer::relocate().

◆ removeObject()

void CMathDependencyGraph::removeObject ( const CObjectInterface pObject)

Remove an object and all its prerequisites to the tree

Parameters
constCObjectInterface * pObject

References mObjects2Nodes.

Referenced by relocate(), CMathContainer::removeAnalysisEvent(), CMathContainer::removeAnalysisObject(), CMathContainer::removeDataObject(), and CModel::removeDataObject().

◆ removePrerequisite()

void CMathDependencyGraph::removePrerequisite ( const CObjectInterface pObject,
const CObjectInterface pPrerequisite 
)

Remove a prerequisite of an object

Parameters
constCObjectInterface * pObject
constCObjectInterface * pPrerequisite

References mObjects2Nodes.

Referenced by CMathContainer::createValueChangeProhibited().

Member Data Documentation

◆ mObject2Index

std::map< const CObjectInterface *, size_t > CMathDependencyGraph::mObject2Index
mutableprivate

Referenced by exportDOTFormat(), and getDOTNodeId().

◆ mObjects2Nodes

◆ mpContainer

CMathContainer* CMathDependencyGraph::mpContainer
private

Referenced by getUpdateSequence().


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