COPASI API
4.40.278
|
#include <CMathDependencyGraph.h>
Public Types | |
typedef NodeMap::const_iterator | const_iterator |
typedef NodeMap::iterator | iterator |
typedef std::map< const CObjectInterface *, CMathDependencyNode * > | NodeMap |
Private Member Functions | |
std::string | getDOTNodeId (const CObjectInterface *pObject) const |
Private Attributes | |
std::map< const CObjectInterface *, size_t > | mObject2Index |
NodeMap | mObjects2Nodes |
CMathContainer * | mpContainer |
typedef NodeMap::const_iterator CMathDependencyGraph::const_iterator |
typedef NodeMap::iterator CMathDependencyGraph::iterator |
typedef std::map< const CObjectInterface *, CMathDependencyNode * > CMathDependencyGraph::NodeMap |
CMathDependencyGraph::CMathDependencyGraph | ( | CMathContainer * | pContainer = NULL | ) |
Constructor
CMathDependencyGraph::CMathDependencyGraph | ( | const CMathDependencyGraph & | src, |
CMathContainer * | pContainer = NULL |
||
) |
Copy constructor
References mObjects2Nodes.
CMathDependencyGraph::~CMathDependencyGraph | ( | ) |
Destructor
References clear().
CMathDependencyGraph::iterator CMathDependencyGraph::addObject | ( | const CObjectInterface * | pObject | ) |
Add an object and all its prerequisites to the tree
const | CObjectInterface * pObject |
References CObjectInterface::getPrerequisites(), and mObjects2Nodes.
Referenced by CMathContainer::addAnalysisEvent(), CMathContainer::addAnalysisObject(), CModel::buildDependencyGraphs(), CMathContainer::createDependencyGraphs(), and COptProblem::initialize().
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
const | CObjectInterface::ObjectSet & changedObjects |
CObjectInterface::ObjectSet | & dependentObjects |
References CCore::Default, exportDOTFormat(), and mObjects2Nodes.
Referenced by CModel::appendAllDependents(), CFunctionDB::appendDependentFunctions(), and CMathContainer::createUpdateSimulationValuesSequence().
bool CMathDependencyGraph::appendDirectDependents | ( | const CObjectInterface::ObjectSet & | changedObjects, |
CObjectInterface::ObjectSet & | dependentObjects | ||
) | const |
Append all objects which directly depend on the given changed objects
const | CObjectInterface::ObjectSet & changedObjects |
CObjectInterface::ObjectSet | & dependentObjects |
References mObjects2Nodes.
Referenced by CModel::appendDirectDependents(), and CModel::functionDefinitionChanged().
void CMathDependencyGraph::clear | ( | ) |
Clear the whole dependency tree
References mObjects2Nodes.
Referenced by CMathContainer::allocate(), CModel::buildDependencyGraphs(), CFunctionDB::cleanup(), CMathContainer::createDependencyGraphs(), and ~CMathDependencyGraph().
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
const | CObjectInterface * pObject |
const | CCore::SimulationContextFlag & context |
const | CObjectInterface * pChangedObject |
References CMathUpdateSequence::empty(), getUpdateSequence(), and CMathUpdateSequence::insert().
Referenced by CHybridMethod::setupDependencyGraph().
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
const | CObjectInterface * pObject |
const | CCore::SimulationContextFlag & context |
const | CObjectInterface::ObjectSet & changedObjects |
References CMathUpdateSequence::empty(), getUpdateSequence(), and CMathUpdateSequence::insert().
void CMathDependencyGraph::exportDOTFormat | ( | std::ostream & | os, |
const std::string & | name | ||
) | const |
References getDOTNodeId(), CObjectInterface::getObject(), mObject2Index, and mObjects2Nodes.
Referenced by appendAllDependents(), CModel::buildDependencyGraphs(), CMathContainer::createDependencyGraphs(), and getUpdateSequence().
|
private |
References CObjectInterface::DataObject(), CMath::DependentMass, CMath::Discontinuous, CMath::EventAssignment, CMath::EventDelay, CMath::EventPriority, CMath::EventRoot, CMath::EventRootState, CMath::EventTrigger, CMath::Flux, COptItem::getObject(), CDataObject::getObjectAncestor(), CObjectInterface::getObjectDisplayName(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CMathObject::getValueType(), mObject2Index, CMath::ParticleFlux, CMath::Propensity, CMath::Rate, CMath::TotalMass, CMath::Undefined, and CMath::Value.
Referenced by exportDOTFormat().
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.
const | CCore::SimulationContextFlag & context |
CCore::CUpdateSequence | & updateSequence |
const | CObjectInterface::ObjectSet & changedObjects |
const | CObjectInterface::ObjectSet & requestedObjects |
const | CObjectInterface::ObjectSet & calculatedObjects (default: none) |
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().
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
const | CCore::SimulationContextFlag & context |
const | CObjectInterface * pChangedObject |
References CCopasiMessage::getLastMessage(), getUpdateSequence(), CMathUpdateSequence::insert(), and CCopasiMessage::size().
Referenced by CMathContainer::createValueChangeProhibited().
void CMathDependencyGraph::relocate | ( | const CMathContainer * | pContainer, |
const std::vector< CMath::sRelocate > & | relocations | ||
) |
Relocate the objects in the nodes of the graph.
const | CMathContainer * pContainer |
std::vector< | CMath::sRelocate > & relocations |
References mObjects2Nodes, CMathContainer::relocateObject(), and removeObject().
Referenced by CMathContainer::relocate().
void CMathDependencyGraph::removeObject | ( | const CObjectInterface * | pObject | ) |
Remove an object and all its prerequisites to the tree
const | CObjectInterface * pObject |
References mObjects2Nodes.
Referenced by relocate(), CMathContainer::removeAnalysisEvent(), CMathContainer::removeAnalysisObject(), CMathContainer::removeDataObject(), and CModel::removeDataObject().
void CMathDependencyGraph::removePrerequisite | ( | const CObjectInterface * | pObject, |
const CObjectInterface * | pPrerequisite | ||
) |
Remove a prerequisite of an object
const | CObjectInterface * pObject |
const | CObjectInterface * pPrerequisite |
References mObjects2Nodes.
Referenced by CMathContainer::createValueChangeProhibited().
|
mutableprivate |
Referenced by exportDOTFormat(), and getDOTNodeId().
|
private |
|
private |
Referenced by getUpdateSequence().