COPASI API
4.16.103
|
#include <CModel.h>
Public Member Functions | |
bool | appendDependentModelObjects (const std::set< const CCopasiObject * > &candidates, std::set< const CCopasiObject * > &dependentReactions, std::set< const CCopasiObject * > &dependentMetabolites, std::set< const CCopasiObject * > &dependentCompartments, std::set< const CCopasiObject * > &dependentModelValues, std::set< const CCopasiObject * > &dependentEvents) const |
bool | appendDependentReactions (std::set< const CCopasiObject * > candidates, std::set< const CCopasiObject * > &dependents) const |
void | applyActiveParameterSet () |
void | applyInitialValues () |
bool | buildDependencyGraphs () |
std::vector< Refresh * > | buildInitialRefreshSequence (std::set< const CCopasiObject * > &changedObjects) |
void | buildLinkZero () |
void | buildMoieties () |
void | buildRedStoi () |
void | buildStoi () |
void | calculateDerivatives (C_FLOAT64 *derivatives) |
void | calculateDerivativesX (C_FLOAT64 *derivativesX) |
C_FLOAT64 | calculateDivergence () const |
void | calculateElasticityMatrix (const C_FLOAT64 &factor, const C_FLOAT64 &resolution) |
void | calculateJacobian (CMatrix< C_FLOAT64 > &jacobian, const C_FLOAT64 &derivationFactor, const C_FLOAT64 &resolution) |
void | calculateJacobianX (CMatrix< C_FLOAT64 > &jacobianX, const C_FLOAT64 &derivationFactor, const C_FLOAT64 &resolution) |
void | calculateRootDerivatives (CVector< C_FLOAT64 > &rootDerivatives) |
CModel (CCopasiContainer *pParent) | |
bool | compileIfNecessary (CProcessReport *pProcessReport) |
bool | convert2NonReversible () |
CCompartment * | createCompartment (const std::string &name, const C_FLOAT64 &volume=1.0) |
CEvent * | createEvent (const std::string &name) |
CMetab * | createMetabolite (const std::string &name, const std::string &compartment, const C_FLOAT64 &iconc=1.0, const CModelEntity::Status &status=CModelEntity::REACTIONS) |
CModelValue * | createModelValue (const std::string &name, const C_FLOAT64 &value=0.0) |
CReaction * | createReaction (const std::string &name) |
void | evaluateRoots (CVectorCore< C_FLOAT64 > &rootValues, const bool &ignoreDiscrete) |
size_t | findMetabByName (const std::string &Target) const |
size_t | findMoiety (const std::string &Target) const |
bool | forceCompile (CProcessReport *pProcessReport) |
CModel::AreaUnit | getAreaUnitEnum () const |
std::string | getAreaUnitName () const |
std::string | getAreaUnitsDisplayString () const |
const C_FLOAT64 & | getAvogadro () const |
virtual std::string | getChildObjectUnits (const CCopasiObject *pObject) const |
CCopasiVectorNS< CCompartment > & | getCompartments () |
const CCopasiVectorNS < CCompartment > & | getCompartments () const |
std::string | getConcentrationRateUnitsDisplayString () const |
std::string | getConcentrationUnitsDisplayString () const |
CCopasiObject * | getCorrespondingTransientObject (const CCopasiObject *pObject) const |
CCopasiVectorN< CEvent > & | getEvents () |
const CCopasiVectorN< CEvent > & | getEvents () const |
std::string | getFrequencyUnitsDisplayString () const |
const CState & | getInitialState () const |
const C_FLOAT64 & | getInitialTime () const |
bool | getInitialUpdateSequence (const CMath::SimulationContextFlag &context, const CCopasiObject::DataObjectSet &changedObjects, const CCopasiObject::DataObjectSet &requestedObjects, CCopasiObject::DataUpdateSequence &updateSequence) const |
const std::string & | getKey () const |
const CLinkMatrixView & | getL () const |
const CLinkMatrix & | getL0 () const |
CModel::LengthUnit | getLengthUnitEnum () const |
std::string | getLengthUnitName () const |
std::string | getLengthUnitsDisplayString () const |
const std::vector< Refresh * > & | getListOfConstantRefreshes () const |
const std::vector< Refresh * > & | getListOfInitialRefreshes () const |
const std::vector< Refresh * > & | getListOfNonSimulatedRefreshes () const |
const std::vector< Refresh * > & | getListOfSimulatedRefreshes () const |
const CMathModel * | getMathModel () const |
CMathModel * | getMathModel () |
const CCopasiVector< CMetab > & | getMetabolites () const |
CCopasiVector< CMetab > & | getMetabolites () |
const CCopasiVector< CMetab > & | getMetabolitesX () const |
CCopasiVector< CMetab > & | getMetabolitesX () |
const CModelParameterSet & | getModelParameterSet () const |
CModelParameterSet & | getModelParameterSet () |
const CCopasiVectorN < CModelParameterSet > & | getModelParameterSets () const |
CCopasiVectorN < CModelParameterSet > & | getModelParameterSets () |
const ModelType & | getModelType () const |
const CCopasiVectorN < CModelValue > & | getModelValues () const |
CCopasiVectorN< CModelValue > & | getModelValues () |
const CCopasiVector< CMoiety > & | getMoieties () const |
size_t | getNumAssignmentMetabs () const |
const C_FLOAT64 & | getNumber2QuantityFactor () const |
size_t | getNumDependentReactionMetabs () const |
size_t | getNumIndependentReactionMetabs () const |
size_t | getNumMetabs () const |
size_t | getNumModelValues () const |
size_t | getNumODEMetabs () const |
size_t | getNumRoots () const |
size_t | getNumVariableMetabs () const |
const CVector< C_FLOAT64 > & | getParticleFlux () const |
const C_FLOAT64 & | getProcessQueueExecutionTime () const |
const C_FLOAT64 & | getQuantity2NumberFactor () const |
std::string | getQuantityRateUnitsDisplayString () const |
CModel::QuantityUnit | getQuantityUnitEnum () const |
std::string | getQuantityUnitName () const |
std::string | getQuantityUnitOldXMLName () const |
std::string | getQuantityUnitsDisplayString () const |
CCopasiVectorNS< CReaction > & | getReactions () |
const CCopasiVectorNS < CReaction > & | getReactions () const |
const CMatrix< C_FLOAT64 > & | getRedStoi () const |
const CVector < CMathTrigger::CRootFinder * > & | getRootFinders () const |
const CState & | getState () const |
const CStateTemplate & | getStateTemplate () const |
CStateTemplate & | getStateTemplate () |
const CMatrix< C_FLOAT64 > & | getStoi () const |
const C_FLOAT64 & | getTime () const |
CModel::TimeUnit | getTimeUnitEnum () const |
std::string | getTimeUnitName () const |
std::string | getTimeUnitsDisplayString () const |
size_t | getTotSteps () const |
bool | getTransientUpdateSequence (const CMath::SimulationContextFlag &context, const CCopasiObject::DataObjectSet &changedObjects, const CCopasiObject::DataObjectSet &requestedObjects, CCopasiObject::DataUpdateSequence &updateSequence) const |
std::vector< const CEvaluationTree * > | getTreesWithDiscontinuities () const |
const std::set< const CCopasiObject * > & | getUptoDateObjects () const |
std::string | getVolumeRateUnitsDisplayString () const |
CModel::VolumeUnit | getVolumeUnitEnum () const |
std::string | getVolumeUnitName () const |
std::string | getVolumeUnitsDisplayString () const |
bool | hasReversibleReaction () const |
CVector< C_FLOAT64 > | initializeAtolVector (const C_FLOAT64 &baseTolerance, const bool &reducedModel) const |
void | initializeMetabolites () |
const bool & | isAutonomous () const |
bool | isStateVariable (const CCopasiObject *pObject) const |
C_INT32 | load (CReadConfig &configBuffer) |
std::string | printParameterOverview () |
bool | processQueue (const C_FLOAT64 &time, const bool &equality, CProcessQueue::resolveSimultaneousAssignments pResolveSimultaneousAssignments) |
void | processRoots (const C_FLOAT64 &time, const bool &equality, const bool &correct, const CVector< C_INT > &roots) |
void | refreshActiveParameterSet () |
bool | removeCompartment (const size_t index, const bool &recursive=true) |
bool | removeCompartment (const std::string &key, const bool &recursive=true) |
bool | removeCompartment (const CCompartment *pCompartment, const bool &recursive=true) |
void | removeDependentModelObjects (const std::set< const CCopasiObject * > &deletedObjects) |
bool | removeEvent (const size_t index, const bool &recursive=true) |
bool | removeEvent (const std::string &key, const bool &recursive=true) |
bool | removeEvent (const CEvent *pEvent, const bool &recursive=true) |
bool | removeLocalReactionParameter (const std::string &key, const bool &recursive=true) |
bool | removeMetabolite (const std::string &key, const bool &recursive=true) |
bool | removeMetabolite (const size_t index, const bool &recursive=true) |
bool | removeMetabolite (const CMetab *pMetabolite, const bool &recursive=true) |
bool | removeModelValue (const CModelValue *pModelValue, const bool &recursive=true) |
bool | removeModelValue (const std::string &key, const bool &recursive=true) |
bool | removeModelValue (const size_t index, const bool &recursive=true) |
bool | removeReaction (const CReaction *pReaction, const bool &recursive=true) |
bool | removeReaction (const std::string &key, const bool &recursive=true) |
bool | removeReaction (const size_t index, const bool &recursive=true) |
bool | setAreaUnit (const std::string &name) |
bool | setAreaUnit (const CModel::AreaUnit &unit) |
void | setAvogadro (const C_FLOAT64 &avogadro) |
void | setCompileFlag (bool flag=true) |
void | setInitialState (const CState &state) |
void | setInitialTime (const C_FLOAT64 &time) |
bool | setLengthUnit (const std::string &name) |
bool | setLengthUnit (const CModel::LengthUnit &unit) |
void | setModelType (const ModelType &modelType) |
bool | setQuantityUnit (const std::string &name) |
bool | setQuantityUnit (const CModel::QuantityUnit &unit) |
void | setState (const CState &state) |
void | setTime (const C_FLOAT64 &time) |
bool | setTimeUnit (const std::string &name) |
bool | setTimeUnit (const CModel::TimeUnit &unit) |
bool | setVolumeUnit (const std::string &name) |
bool | setVolumeUnit (const CModel::VolumeUnit &unit) |
std::string | suitableForStochasticSimulation () const |
bool | updateInitialValues () |
void | updateInitialValues (std::set< const CCopasiObject * > &changedObjects) |
void | updateInitialValues (const CCopasiObject *changedObject) |
void | updateNonSimulatedValues (void) |
void | updateSimulatedValues (const bool &updateMoieties) |
~CModel () | |
![]() | |
virtual void | calculate () |
CModelEntity (const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const std::string &type="ModelEntity", const unsigned C_INT32 &flag=CCopasiObject::Container|CCopasiObject::ValueDbl) | |
CModelEntity (const CModelEntity &src, const CCopasiContainer *pParent=NULL) | |
virtual std::set< const CCopasiObject * > | getDeletedObjects () const |
std::string | getExpression () const |
const CExpression * | getExpressionPtr () const |
CExpression * | getExpressionPtr () |
std::string | getInitialExpression () const |
const CExpression * | getInitialExpressionPtr () const |
CExpression * | getInitialExpressionPtr () |
const C_FLOAT64 & | getInitialValue () const |
CCopasiObject * | getInitialValueReference () const |
const C_FLOAT64 & | getRate () const |
CCopasiObject * | getRateReference () const |
const std::string & | getSBMLId () const |
const CModelEntity::Status & | getStatus () const |
const C_FLOAT64 & | getValue () const |
virtual const CCopasiObject * | getValueObject () const |
virtual void * | getValuePointer () const |
CCopasiObject * | getValueReference () const |
bool | isFixed () const |
const bool & | isUsed () const |
virtual bool | mustBeDeleted (const DataObjectSet &deletedObjects) const |
virtual void | refreshInitialValue () |
bool | setExpression (const std::string &expression) |
bool | setExpressionPtr (CExpression *pExpression) |
bool | setInitialExpression (const std::string &expression) |
bool | setInitialExpressionPtr (CExpression *pExpression) |
virtual void | setInitialValue (const C_FLOAT64 &initialValue) |
void | setInitialValuePtr (C_FLOAT64 *pInitialValue) |
virtual bool | setObjectParent (const CCopasiContainer *pParent) |
void | setRate (const C_FLOAT64 &rate) |
void | setSBMLId (const std::string &id) |
virtual void | setStatus (const CModelEntity::Status &status) |
void | setUsed (const bool &used) |
virtual void | setValue (const C_FLOAT64 &value) |
void | setValuePtr (C_FLOAT64 *pValue) |
~CModelEntity () | |
![]() | |
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 const CObjectInterface * | getObject (const CCopasiObjectName &cn) const |
virtual const objectMap & | getObjects () const |
virtual std::string | getUnits () 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 |
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 |
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 void | print (std::ostream *ostream) const |
void | removeDirectDependency (const CCopasiObject *pObject) |
void | setDirectDependencies (const DataObjectSet &directDependencies) |
bool | setObjectName (const std::string &name) |
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 () |
![]() | |
bool | addUnsupportedAnnotation (const std::string &name, const std::string &xml) |
CAnnotation () | |
CAnnotation (const CAnnotation &src) | |
const std::string & | getMiriamAnnotation () const |
const std::string & | getNotes () const |
UnsupportedAnnotation & | getUnsupportedAnnotations () |
const UnsupportedAnnotation & | getUnsupportedAnnotations () const |
bool | operator== (const CAnnotation &rhs) const |
bool | removeUnsupportedAnnotation (const std::string &name) |
bool | replaceUnsupportedAnnotation (const std::string &name, const std::string &xml) |
void | setMiriamAnnotation (const std::string &miriamAnnotation, const std::string &newId, const std::string &oldId) |
void | setNotes (const std::string ¬es) |
virtual | ~CAnnotation () |
Static Public Attributes | |
static const char * | AreaUnitNames [] |
static const char * | LengthUnitNames [] |
static const char * | ModelTypeNames [] |
static const char * | QuantityUnitNames [] |
static const char * | QuantityUnitOldXMLNames [] |
static const char * | TimeUnitNames [] |
static const char * | VolumeUnitNames [] |
![]() | |
static const std::string | StatusName [] |
static const char * | XMLStatus [] |
![]() | |
static const std::vector < CCopasiContainer * > | EmptyList |
Additional Inherited Members | |
![]() | |
static std::vector< Refresh * > | buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet()) |
static void | setRenameHandler (CRenameHandler *rh) |
![]() | |
static CAnnotation * | castObject (CCopasiObject *pObject) |
static const CAnnotation * | castObject (const CCopasiObject *pObject) |
![]() | |
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 } |
![]() | |
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) | |
![]() | |
CExpression * | mpExpression |
CExpression * | mpInitialExpression |
C_FLOAT64 * | mpIValue |
CCopasiObjectReference < C_FLOAT64 > * | mpIValueReference |
CModel * | mpModel |
CCopasiObjectReference < C_FLOAT64 > * | mpRateReference |
C_FLOAT64 * | mpValue |
CCopasiObjectReference < C_FLOAT64 > * | mpValueReference |
C_FLOAT64 | mRate |
std::string | mSBMLId |
![]() | |
objectMap | mObjects |
![]() | |
std::string | mKey |
![]() | |
static CRenameHandler * | smpRenameHandler = NULL |
enum CModel::AreaUnit |
Enum of valid area units
Enumerator | |
---|---|
dimensionlessArea | |
m2 | |
dm2 | |
cm2 | |
mm2 | |
microm2 | |
nm2 | |
pm2 | |
fm2 |
Definition at line 66 of file CModel.h.
Enumerator | |
---|---|
initial | |
transient | |
physical |
Definition at line 119 of file CModel.h.
enum CModel::LengthUnit |
Enum of valid length units
Enumerator | |
---|---|
dimensionlessLength | |
m | |
dm | |
cm | |
mm | |
microm | |
nm | |
pm | |
fm |
Definition at line 76 of file CModel.h.
enum CModel::ModelType |
Enum of valid model types.
Enumerator | |
---|---|
deterministic | |
stochastic |
Definition at line 112 of file CModel.h.
enum CModel::QuantityUnit |
Enum of valid quantity units
Enumerator | |
---|---|
dimensionlessQuantity | |
Mol | |
mMol | |
microMol | |
nMol | |
pMol | |
fMol | |
number | |
OldXML |
Definition at line 96 of file CModel.h.
enum CModel::TimeUnit |
Enum of valid time units
Enumerator | |
---|---|
dimensionlessTime | |
d | |
h | |
min | |
s | |
ms | |
micros | |
ns | |
ps | |
fs | |
OldMinute |
Definition at line 86 of file CModel.h.
enum CModel::VolumeUnit |
Enum of valid volume units
Enumerator | |
---|---|
dimensionlessVolume | |
m3 | |
l | |
ml | |
microl | |
nl | |
pl | |
fl |
Definition at line 56 of file CModel.h.
|
private |
Copy constructor
const CModel & | src |
CModel::CModel | ( | CCopasiContainer * | pParent | ) |
constructor
Definition at line 90 of file CModel.cpp.
References compile(), CONSTRUCTOR_TRACE, forceCompile(), initializeMetabolites(), initObjects(), CModelEntity::mpIValue, CModelEntity::mpValue, mQuantityUnit, mSteps, mVolumeUnit, setQuantityUnit(), CModelEntity::setStatus(), CModelEntity::setUsed(), setVolumeUnit(), CCopasiVector< T >::size(), and CModelEntity::TIME.
CModel::~CModel | ( | ) |
Destructor
Definition at line 227 of file CModel.cpp.
References DESTRUCTOR_TRACE, CCopasiRootContainer::getKeyFactory(), CAnnotation::mKey, CModelEntity::mpIValue, mpLinkMatrixAnnotation, mpRedStoiAnnotation, mpStoiAnnotation, CModelEntity::mpValue, pdelete, and CKeyFactory::remove().
|
private |
Appends pointers to compartments which are dependent on the candidates to the list.
std::set< | const CCopasiObject * > candidates |
std::set< | const CCopasiObject * > & dependents |
Definition at line 2538 of file CModel.cpp.
References CCopasiVector< T >::begin(), compileIfNecessary(), CCopasiVector< T >::end(), and mCompartments.
Referenced by appendDependentModelObjects(), convert2NonReversible(), and determineIsAutonomous().
|
private |
Appends a pointers to events which are dependent on the candidates to the list.
std::set< | const CCopasiObject * > candidates |
std::set< | const CCopasiObject * > & dependents |
Definition at line 2593 of file CModel.cpp.
References CCopasiVector< T >::begin(), compileIfNecessary(), CCopasiVector< T >::end(), and mEvents.
Referenced by appendDependentModelObjects(), convert2NonReversible(), and determineIsAutonomous().
|
private |
Appends pointers to metabolites which are dependent on the candidates to the list.
std::set< | const CCopasiObject * > candidates |
std::set< | const CCopasiObject * > & dependents |
Definition at line 2501 of file CModel.cpp.
References CCopasiVector< T >::begin(), CCopasiVector< CType >::begin(), compileIfNecessary(), CCopasiVector< CType >::end(), CCopasiVector< T >::end(), and mCompartments.
Referenced by appendDependentModelObjects(), convert2NonReversible(), and determineIsAutonomous().
bool CModel::appendDependentModelObjects | ( | const std::set< const CCopasiObject * > & | candidates, |
std::set< const CCopasiObject * > & | dependentReactions, | ||
std::set< const CCopasiObject * > & | dependentMetabolites, | ||
std::set< const CCopasiObject * > & | dependentCompartments, | ||
std::set< const CCopasiObject * > & | dependentModelValues, | ||
std::set< const CCopasiObject * > & | dependentEvents | ||
) | const |
Appends pointers to all model objects, which are dependent on the candidates to appropriate lists.
const | std::set< const CCopasiObject * > & candidates |
std::set< | const CCopasiObject * > & dependentReactions |
std::set< | const CCopasiObject * > & dependentMetabolites |
std::set< | const CCopasiObject * > & dependentCompartments |
std::set< | const CCopasiObject * > & dependentModelValues |
std::set< | const CCopasiObject * > & dependentEvents |
Definition at line 2364 of file CModel.cpp.
References appendDependentCompartments(), appendDependentEvents(), appendDependentMetabolites(), appendDependentModelValues(), appendDependentReactions(), CCompartment::getDeletedObjects(), CReaction::getDeletedObjects(), CModelEntity::getDeletedObjects(), and CMetab::getDeletedObjects().
Referenced by CQMessageBox::confirmDelete(), CModelExpansion::SetOfModelElements::fillDependencies(), CFunctionDB::getUsedFunctions(), FunctionWidget1::leave(), and removeDependentModelObjects().
|
private |
Appends a pointers to model values which are dependent on the candidates to the list.
std::set< | const CCopasiObject * > candidates |
std::set< | const CCopasiObject * > & dependents |
Definition at line 2566 of file CModel.cpp.
References CCopasiVector< T >::begin(), compileIfNecessary(), CCopasiVector< T >::end(), and mValues.
Referenced by appendDependentModelObjects(), convert2NonReversible(), and determineIsAutonomous().
bool CModel::appendDependentReactions | ( | std::set< const CCopasiObject * > | candidates, |
std::set< const CCopasiObject * > & | dependents | ||
) | const |
Appends pointers to reactions which are dependent on the candidates to the list.
std::set< | const CCopasiObject * > candidates |
std::set< | const CCopasiObject * > & dependents |
Definition at line 2472 of file CModel.cpp.
References CCopasiVector< T >::begin(), compileIfNecessary(), CCopasiVector< T >::end(), and mSteps.
Referenced by appendDependentModelObjects(), determineIsAutonomous(), CQSpeciesDetail::loadReactionTable(), and CQSpeciesDetail::slotSwitchToReaction().
void CModel::applyActiveParameterSet | ( | ) |
Update the model initial values from the active parameter set.
Definition at line 1082 of file CModel.cpp.
References CModelParameterSet::createFromModel(), CKeyFactory::get(), CModelParameterSet::getKey(), CCopasiRootContainer::getKeyFactory(), mActiveParameterSetKey, mParameterSet, and CModelParameterSet::updateModel().
void CModel::applyInitialValues | ( | ) |
initialize all values of the model with their initial values
Definition at line 1236 of file CModel.cpp.
References CMathModel::applyInitialValues(), mApplyInitialValuesRefreshes, mInitialState, mpMathModel, setState(), and updateSimulatedValues().
Referenced by CSensTask::process(), CLNATask::process(), CScanTask::process(), CLyapTask::process(), CMCATask::process(), CSteadyStateTask::process(), CTSSATask::processStart(), CTrajectoryTask::processStart(), CCrossSectionTask::processStart(), and CopasiUI3Window::slotApplyInitialState().
|
private |
Build the update sequence used by applyInitialValues to update values.
Definition at line 1627 of file CModel.cpp.
References CModelEntity::ASSIGNMENT, CStateTemplate::beginIndependent(), CCopasiObject::buildUpdateSequence(), CStateTemplate::endFixed(), mApplyInitialValuesRefreshes, mStateTemplate, and CModelEntity::ODE.
Referenced by buildSimulatedSequence(), and compile().
bool CModel::buildDependencyGraphs | ( | ) |
Definition at line 547 of file CModel.cpp.
References CMathDependencyGraph::addObject(), CCopasiVector< T >::begin(), CStateTemplate::beginIndependent(), CMathDependencyGraph::clear(), CCopasiVector< T >::end(), CStateTemplate::endFixed(), CMathDependencyGraph::exportDOTFormat(), CMetab::getConcentrationReference(), CMetab::getInitialConcentrationReference(), mInitialDependencies, mMoieties, mPhysicalDependencies, mStateTemplate, mTransientDependencies, CModelEntity::ODE, and CModelEntity::REACTIONS.
Referenced by compile().
std::vector< Refresh * > CModel::buildInitialRefreshSequence | ( | std::set< const CCopasiObject * > & | changedObjects | ) |
Build the update sequence used to calculate all initial values depending on the changed objects. For metabolites the initial particle number is updated by default unless itself is in the list of changed objects. In that case the initial concentration is updated.
std::set< | const CCopasiObject * > & changedObjects |
Definition at line 4164 of file CModel.cpp.
References CArrayAnnotation::appendElementReferences(), CModelEntity::ASSIGNMENT, CCopasiVector< T >::begin(), CStateTemplate::beginIndependent(), CCopasiVector< T >::end(), CStateTemplate::endFixed(), CCopasiMessage::EXCEPTION, CCopasiObject::getDirectDependencies(), CMetab::getInitialConcentrationReference(), CModelEntity::getInitialExpression(), CModelEntity::getInitialValueReference(), CCopasiParameterGroup::getParameter(), CModelEntity::getStatus(), CMetab::isInitialConcentrationChangeAllowed(), MCObject, mMoieties, mpLinkMatrixAnnotation, mpRedStoiAnnotation, mpStoiAnnotation, mStateTemplate, mSteps, CCopasiParameterGroup::size(), and sortObjectsByDependency().
Referenced by DataModelGUI::buildChangedObjects(), buildInitialSequence(), test000097::createModel(), CScanMethod::init(), CFitProblem::initialize(), CSensMethod::initialize(), COptProblem::initialize(), COptProblem::restoreModel(), SBMLImporter::setInitialValues(), CSlider::setSliderObject(), test000058::test_bug1025_10(), test000058::test_bug1025_6(), test000058::test_bug1025_7(), test000058::test_bug1025_8(), test000058::test_bug1025_9(), test000060::test_bug_1026(), test000059::test_unique_id_11(), test000059::test_unique_id_12(), test000059::test_unique_id_13(), test000059::test_unique_id_14(), test000059::test_unique_id_15(), test000059::test_unique_id_16(), and updateInitialValues().
|
private |
Build the update sequence used by updateInitialValues to update all initial values.
Definition at line 1395 of file CModel.cpp.
References CArrayAnnotation::appendElementReferences(), CModelEntity::ASSIGNMENT, CCopasiVector< T >::begin(), CStateTemplate::beginIndependent(), buildInitialRefreshSequence(), CCopasiVector< T >::end(), CStateTemplate::endFixed(), CCopasiContainer::getObject(), CCopasiParameterGroup::getParameter(), CCopasiParameter::getValueReference(), mBuildInitialSequence, mInitialRefreshes, mpLinkMatrixAnnotation, mpRedStoiAnnotation, mpStoiAnnotation, mStateTemplate, mSteps, and CCopasiParameterGroup::size().
Referenced by buildSimulatedSequence(), compile(), and updateInitialValues().
void CModel::buildLinkZero | ( | ) |
Build the core of the link matrix L
const | CMatrix< C_FLOAT64 > & LU |
Definition at line 3946 of file CModel.cpp.
References CLinkMatrix::build(), CLinkMatrix::doRowPivot(), CLinkMatrix::getNumIndependent(), mL, mNumMetabolitesReactionIndependent, mStoi, and mStoiInternal.
Referenced by compile().
void CModel::buildMoieties | ( | ) |
Build the moieties based on the LU decomposition
Definition at line 905 of file CModel.cpp.
References CMoiety::add(), CCopasiVector< T >::add(), CMatrix< CType >::array(), CCopasiVector< T >::begin(), C_FLOAT64, CCopasiVector< T >::cleanup(), mL, mMetabolitesX, mMoieties, mNumMetabolitesODE, MNumMetabolitesReactionDependent, mNumMetabolitesReactionIndependent, and updateMoietyValues().
Referenced by compile().
|
private |
Build the update sequence used by updateNonSimulatedValues.
Definition at line 1678 of file CModel.cpp.
References CCopasiVector< T >::begin(), CCopasiObject::buildUpdateSequence(), CCopasiVector< T >::end(), mCompartments, mMetabolites, mNonSimulatedRefreshes, mSimulatedUpToDateObjects, mSteps, mValues, CModelEntity::ODE, and CModelEntity::REACTIONS.
Referenced by compile().
void CModel::buildRedStoi | ( | ) |
Build the core of the link matrix L
const | CMatrix< C_FLOAT64 > & LU Build the Reduced Stoichiometry Matrix from the LU decomposition |
Definition at line 829 of file CModel.cpp.
References CLinkMatrix::applyRowPivot(), CVectorCore< CType >::array(), CCopasiVector< T >::begin(), mL, mMetabolitesX, mNumMetabolitesODE, mNumMetabolitesReaction, mNumMetabolitesReactionIndependent, mRedStoi, mStoi, CMatrix< CType >::numCols(), and CMatrix< CType >::resize().
Referenced by compile().
|
private |
Build the update sequence used by updateSimulatedValues.
Definition at line 1483 of file CModel.cpp.
References CModelEntity::ASSIGNMENT, CCopasiVector< T >::begin(), CStateTemplate::beginDependent(), CStateTemplate::beginIndependent(), buildApplyInitialValuesSequence(), buildInitialSequence(), CCopasiObject::buildUpdateSequence(), CModelEntity::compile(), CCopasiObject::dependsOn(), CCopasiVector< T >::end(), CStateTemplate::endDependent(), CStateTemplate::endFixed(), CStateTemplate::endIndependent(), CMetab::getConcentrationReference(), MNumMetabolitesReactionDependent, mNumMetabolitesReactionIndependent, mReorderNeeded, mSimulatedRefreshes, mSimulatedUpToDateObjects, mStateTemplate, mSteps, CStateTemplate::reorder(), and CStateTemplate::size().
Referenced by compile().
|
private |
Build the state template for the model.
Definition at line 1262 of file CModel.cpp.
References CModelEntity::ASSIGNMENT, CCopasiVector< T >::begin(), CStateTemplate::beginIndependent(), CModelEntity::compile(), CCopasiVector< T >::end(), CStateTemplate::endFixed(), mCompartments, mMetabolitesX, mReorderNeeded, mStateTemplate, mSteps, mValues, CModelEntity::ODE, CStateTemplate::reorder(), CModelEntity::setUsed(), and CCopasiVector< T >::size().
Referenced by compile().
void CModel::buildStoi | ( | ) |
Build the Stoichiometry Matrix from the chemical equations of the steps
Definition at line 642 of file CModel.cpp.
References CProcessReport::addItem(), CMatrix< CType >::array(), CCopasiVector< T >::begin(), C_FLOAT64, C_INT32, CCopasiVector< T >::end(), CCopasiMessage::ERROR, CProcessReport::finishItem(), handleUnusedMetabolites(), initializeMetabolites(), MCReaction, mMetabolitesX, mNumMetabolitesODE, mNumMetabolitesReaction, mParticleFluxes, mpCompileHandler, mSteps, mStoiInternal, CProcessReport::progressItem(), CMatrix< CType >::resize(), CVector< CType >::resize(), and CCopasiVector< T >::size().
Referenced by compile().
|
private |
Build the user order for the state template
Definition at line 1349 of file CModel.cpp.
References CVectorCore< CType >::array(), CCopasiVector< T >::begin(), CCopasiVector< T >::end(), CStateTemplate::getEntities(), CStateTemplate::getNumIndependent(), CStateTemplate::getUserOrder(), CModelEntity::isUsed(), mCompartments, mJacobianPivot, mMetabolites, MNumMetabolitesReactionDependent, mStateTemplate, mValues, CModelEntity::ODE, CModelEntity::REACTIONS, CVector< CType >::resize(), CStateTemplate::setUserOrder(), CVectorCore< CType >::size(), and CCopasiVector< T >::size().
Referenced by compile().
Calculate the changes of all model quantities determined by ODEs for the model in the current state. The parameter derivatives must at least provide space for state->getVariableNumberSize() double ¶m C_FLOAT64 * derivatives (output)
Definition at line 1903 of file CModel.cpp.
References CVectorCore< CType >::array(), CMatrix< CType >::array(), C_FLOAT64, C_INT, dgemm_(), CStateTemplate::getEntities(), CStateTemplate::getNumIndependent(), K, mNumMetabolitesReaction, mNumMetabolitesReactionIndependent, mParticleFluxes, mStateTemplate, mSteps, mStoi, and CCopasiVector< T >::size().
Referenced by CTSSAMethod::calculateDerivatives(), calculateJacobian(), CMathModel::calculateRootDerivatives(), CLyapWolfMethod::evalF(), CLsodaMethod::evalF(), CTrajectoryMethodDsaLsodar::evalF(), CTSSAMethod::evalF(), and CCSPMethod::step().
Calculate the changes of all model quantities determined by ODEs for the reduced model in the current state. The parameter derivatives must at least provide space for state->getDependentNumberSize() double ¶m C_FLOAT64 * derivatives (output)
Definition at line 1941 of file CModel.cpp.
References CVectorCore< CType >::array(), CMatrix< CType >::array(), C_FLOAT64, C_INT, dgemm_(), CStateTemplate::getEntities(), CStateTemplate::getNumIndependent(), K, mNumMetabolitesReactionIndependent, mParticleFluxes, mRedStoi, mStateTemplate, mSteps, and CCopasiVector< T >::size().
Referenced by CNewtonMethod::calculateDerivativesX(), CTSSAMethod::calculateDerivativesX(), calculateJacobianX(), CLyapWolfMethod::evalF(), CLsodaMethod::evalF(), CTrajectoryMethodDsaLsodar::evalF(), CTSSAMethod::evalF(), and CCSPMethod::step().
C_FLOAT64 CModel::calculateDivergence | ( | ) | const |
Calculates the divergence for the current state. calculateElasticityMatrix() needs to be called before. It makes only sense to use this method if the Jacobian is not also calculated. In this case it would be more efficient to use the trace of the Jacobian
Definition at line 2153 of file CModel.cpp.
References fatalError.
Calculates the elasticity matrix of the model for the current state and stores it in the provided matrix.
CMatrix< | C_FLOAT64 > & elasticityMatrix |
const | C_FLOAT64 & factor, |
const | C_FLOAT64 & resolution |
Definition at line 1968 of file CModel.cpp.
References CMatrix< CType >::array(), CCopasiVector< T >::begin(), CStateTemplate::beginIndependent(), C_FLOAT64, CCopasiVector< T >::end(), CStateTemplate::endDependent(), CMetab::getCompartment(), CMetab::getConcentration(), CModelEntity::getValue(), mElasticities, mStateTemplate, mSteps, and CMatrix< CType >::numCols().
void CModel::calculateJacobian | ( | CMatrix< C_FLOAT64 > & | jacobian, |
const C_FLOAT64 & | derivationFactor, | ||
const C_FLOAT64 & | resolution | ||
) |
Calculates the jacobian of the full model for the current state and stores it in the provided matrix. calculateElasticityMatrix() needs to be called before.
CMatrix< | C_FLOAT64 > & jacobian |
const | C_FLOAT64 & derivationFactor, |
const | C_FLOAT64 & resolution |
Definition at line 2006 of file CModel.cpp.
References CVectorCore< CType >::array(), CMatrix< CType >::array(), CState::beginIndependent(), C_FLOAT64, calculateDerivatives(), CState::getNumIndependent(), max, mCurrentState, MNumMetabolitesReactionDependent, CMatrix< CType >::resize(), and updateSimulatedValues().
Referenced by CSteadyStateMethod::doJacobian(), and CCSPMethod::step().
void CModel::calculateJacobianX | ( | CMatrix< C_FLOAT64 > & | jacobianX, |
const C_FLOAT64 & | derivationFactor, | ||
const C_FLOAT64 & | resolution | ||
) |
Calculates the Jacobian of the reduced model for the current state and stores it in the provided matrix. calculateElasticityMatrix() needs to be called before.
const | C_FLOAT64 & derivationFactor, |
const | C_FLOAT64 & resolution |
CMatrix< | C_FLOAT64 > & jacobianX |
Definition at line 2082 of file CModel.cpp.
References CVectorCore< CType >::array(), CMatrix< CType >::array(), CState::beginIndependent(), C_FLOAT64, calculateDerivativesX(), CState::getNumIndependent(), max, mCurrentState, CMatrix< CType >::resize(), and updateSimulatedValues().
Referenced by CLNAMethod::calculateCovarianceMatrixReduced(), CSteadyStateMethod::calculateJacobianX(), CSteadyStateMethod::doJacobian(), CLyapWolfMethod::evalF(), CILDMMethod::step(), CILDMModifiedMethod::step(), and CCSPMethod::step().
Calculate the time derivative of all roots
CVector< | C_FLOAT64 > & rootDerivatives |
Definition at line 4712 of file CModel.cpp.
References CMathModel::calculateRootDerivatives(), and mpMathModel.
Referenced by CLsodaMethod::createRootMask().
|
private |
Clear all references to moieties
Definition at line 1257 of file CModel.cpp.
References CCopasiVector< T >::clear(), and mMoieties.
Referenced by removeEvent(), removeMetabolite(), and removeReaction().
|
privatevirtual |
Compile the model value. This is only needed for status ASIGNMENT and ODE.
Reimplemented from CModelEntity.
Definition at line 381 of file CModel.cpp.
References CCopasiObject::addDirectDependency(), CProcessReport::addItem(), CCopasiVector< T >::begin(), buildApplyInitialValuesSequence(), buildDependencyGraphs(), buildInitialSequence(), buildLinkZero(), buildMoieties(), buildNonSimulatedSequence(), buildRedStoi(), buildSimulatedSequence(), buildStateTemplate(), buildStoi(), buildUserOrder(), C_INT32, CLinkMatrix::clearPivoting(), CMathModel::compile(), compileEvents(), CModelParameterSet::createFromModel(), determineIsAutonomous(), CCopasiVector< T >::end(), CProcessReport::finishItem(), mApplyInitialValuesRefreshes, mCompileIsNecessary, mInitialRefreshes, mIsAutonomous, mL, mMetabolitesX, mNonSimulatedRefreshes, mParameterSet, mpCompileHandler, mpMathModel, CModelEntity::mpValueReference, mSimulatedRefreshes, pdelete, CProcessReport::progressItem(), CRenameHandler::setEnabled(), CProcessReport::setName(), CCopasiObject::smpRenameHandler, and updateMatrixAnnotations().
Referenced by CModel(), compileIfNecessary(), and load().
|
private |
Compile the events
Definition at line 4116 of file CModel.cpp.
References CCopasiVector< T >::begin(), CCopasiVector< T >::end(), and mEvents.
Referenced by compile().
bool CModel::compileIfNecessary | ( | CProcessReport * | pProcessReport | ) |
Compile the model if necessary
CProcessReport* | pProcessReport |
Definition at line 612 of file CModel.cpp.
References compile(), mCompileIsNecessary, and mpCompileHandler.
Referenced by appendDependentCompartments(), appendDependentEvents(), appendDependentMetabolites(), appendDependentModelValues(), appendDependentReactions(), DataModelGUI::buildChangedObjects(), CCopasiDataModel::commonAfterLoad(), CModelExpansion::copyCompleteModel(), CCrossSectionTask::createEvent(), CModelExpansion::createLinearArray(), test000097::createModel(), CModelExpansion::createRectangularArray(), CCopasiDataModel::exportMathModel(), CCopasiDataModel::exportMathModelToString(), CCopasiDataModel::exportSBML(), CCopasiDataModel::exportSBMLToString(), forceCompile(), COscillationProblem::initialize(), CLNATask::initialize(), COptProblem::initialize(), CMCATask::initialize(), CCopasiTask::initialize(), CQUpdatesWidget::loadWidget(), CCopasiDataModel::saveModel(), SBMLImporter::setInitialValues(), CModelAdd::simpleCall(), CModelMerging::simpleCall(), CModelExpansion::simpleCall(), CopasiUI3Window::slotApplyInitialState(), CopasiUI3Window::slotUpdateInitialState(), CQSteadyStateResult::slotUpdateModel(), test000058::test_bug1025_10(), test000058::test_bug1025_6(), test000058::test_bug1025_7(), test000058::test_bug1025_8(), test000058::test_bug1025_9(), test000059::test_unique_id_11(), test000059::test_unique_id_12(), test000059::test_unique_id_13(), test000059::test_unique_id_14(), test000059::test_unique_id_15(), test000059::test_unique_id_16(), updateInitialValues(), and CSensTask::updateMatrices().
bool CModel::convert2NonReversible | ( | ) |
Converts the set of reactions to a set of reactions where all reactions are irreversible.
Definition at line 3205 of file CModel.cpp.
References CFunctionDB::addAndAdaptName(), CReaction::addModifier(), CReaction::addProduct(), CReaction::addSubstrate(), appendDependentCompartments(), appendDependentEvents(), appendDependentMetabolites(), appendDependentModelValues(), CModelEntity::ASSIGNMENT, CCopasiVector< T >::begin(), CReaction::compile(), createReaction(), CCopasiVector< T >::end(), CCopasiMessage::ERROR, findFunction(), CFunctionParameter::FLOAT64, CEvent::getAssignments(), CReaction::getChemEq(), CCopasiObject::getCN(), CEvent::getDelayExpression(), CCopasiObject::getDirectDependencies(), CModelEntity::getExpression(), CReaction::getFluxReference(), CReaction::getFunction(), CCopasiRootContainer::getFunctionList(), CReaction::getFunctionParameters(), CModelEntity::getInitialExpression(), CCopasiObject::getObjectName(), CCopasiParameterGroup::getParameter(), CReaction::getParameterMapping(), CReaction::getParameters(), CReaction::getParameterValue(), CReaction::getParticleFluxReference(), CEvent::getPriorityExpression(), CChemEq::getProducts(), getReactions(), CModelEntity::getStatus(), CChemEq::getSubstrates(), CEvent::getTriggerExpression(), CFunctionParameter::getType(), CFunctionParameter::getUsage(), CCopasiParameter::getValueReference(), CReaction::isLocalParameter(), mCompartments, MCReaction, mEvents, mMetabolitesX, CFunctionParameter::MODIFIER, mValues, CFunctionParameter::PARAMETER, pdelete, CFunctionParameter::PRODUCT, setCompileFlag(), CEvent::setDelayExpression(), CModelEntity::setExpression(), CReaction::setFunction(), CModelEntity::setInitialExpression(), CReaction::setParameterMapping(), CReaction::setParameterMappingVector(), CReaction::setParameterValue(), CEvent::setPriorityExpression(), CReaction::setReversible(), CEvent::setTriggerExpression(), CFunctionParameters::size(), CCopasiVector< T >::size(), CFunction::splitFunction(), stringReplace(), and CFunctionParameter::SUBSTRATE.
Referenced by CopasiUI3Window::slotConvertToIrreversible().
CCompartment * CModel::createCompartment | ( | const std::string & | name, |
const C_FLOAT64 & | volume = 1.0 |
||
) |
Add a compartment to the model
const | std::string &name |
const | C_FLOAT64 & volume (default 1.0) |
Definition at line 2698 of file CModel.cpp.
References CCopasiVectorN< CType >::add(), C_INVALID_INDEX, CCopasiVectorN< CType >::getIndex(), mCompartments, mCompileIsNecessary, and CModelEntity::setInitialValue().
Referenced by CModelAdd::addCompartments(), SBMLImporter::createCCompartmentFromCompartment(), test000097::createModel(), CChemEqInterface::createNonExistingMetabs(), CReactionInterface::createOtherObjects(), CModelExpansion::duplicateCompartment(), CQSpecieDM::insertRows(), CQSpeciesDetail::slotBtnNew(), and test000058::test_bug1025_7().
CEvent * CModel::createEvent | ( | const std::string & | name | ) |
Add a new event to the model
const | std::string &name |
Definition at line 2928 of file CModel.cpp.
References CCopasiVectorN< CType >::add(), C_INVALID_INDEX, CCopasiVectorN< CType >::getIndex(), mCompileIsNecessary, and mEvents.
Referenced by CModelAdd::addEvents(), CCrossSectionTask::createEvent(), CModelExpansion::duplicateEvent(), and SBMLImporter::importEvent().
CMetab * CModel::createMetabolite | ( | const std::string & | name, |
const std::string & | compartment, | ||
const C_FLOAT64 & | iconc = 1.0 , |
||
const CModelEntity::Status & | status = CModelEntity::REACTIONS |
||
) |
Add a metabolite to the model
const | std::string & name |
const | std::string & compartment |
const | C_FLOAT64 & iconc (default 1.0) |
const | CMetab::Status & status (default CMetab::METAB_VARIABL) |
Definition at line 2622 of file CModel.cpp.
References CCopasiVector< T >::add(), C_INVALID_INDEX, CCopasiVector< T >::getIndex(), CCopasiVectorN< CType >::getIndex(), getMetabolites(), mCompartments, mCompileIsNecessary, mMetabolites, CMetab::refreshInitialValue(), CMetab::setInitialConcentration(), CMetab::setStatus(), and CCopasiVector< T >::size().
Referenced by CModelAdd::addMetabolites(), SBMLImporter::createCMetabFromSpecies(), CChemEqInterface::createNonExistingMetabs(), CModelExpansion::duplicateMetab(), CQSpecieDM::insertRows(), CQSpeciesDetail::slotBtnNew(), test000058::test_bug1025_8(), and test000059::test_unique_id_11().