COPASI API
4.16.103
|
#include <CSensMethod.h>
Public Member Functions | |
CSensMethod (const CSensMethod &src, const CCopasiContainer *pParent=NULL) | |
size_t | getNumberOfSubtaskCalculations () |
bool | initialize (CSensProblem *problem) |
virtual bool | isValidProblem (const CCopasiProblem *pProblem) |
bool | process (CProcessReport *handler) |
bool | restore (const bool &updateModel) |
~CSensMethod () | |
![]() | |
CCopasiMethod (const CCopasiMethod &src, const CCopasiContainer *pParent=NULL) | |
const CCopasiMethod::SubType & | getSubType () const |
const CCopasiTask::Type & | getType () const |
virtual void | load (CReadConfig &configBuffer, CReadConfig::Mode mode=CReadConfig::SEARCH) |
virtual void | print (std::ostream *ostream) const |
virtual void | printResult (std::ostream *ostream) const |
virtual bool | setCallBack (CProcessReport *pCallBack) |
virtual | ~CCopasiMethod () |
![]() | |
bool | addGroup (const std::string &name) |
bool | addParameter (const CCopasiParameter ¶meter) |
bool | addParameter (const std::string &name, const CCopasiParameter::Type type) |
template<class CType > | |
bool | addParameter (const std::string &name, const CCopasiParameter::Type type, const CType &value) |
void | addParameter (CCopasiParameter *pParameter) |
CCopasiParameterGroup * | assertGroup (const std::string &name) |
template<class CType > | |
CCopasiParameter * | assertParameter (const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue) |
index_iterator | beginIndex () const |
name_iterator | beginName () const |
CCopasiParameterGroup (const CCopasiParameterGroup &src, const CCopasiContainer *pParent=NULL) | |
CCopasiParameterGroup (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &objectType="ParameterGroup") | |
void | clear () |
virtual bool | elevateChildren () |
index_iterator | endIndex () const |
name_iterator | endName () const |
CCopasiParameterGroup * | getGroup (const std::string &name) |
const CCopasiParameterGroup * | getGroup (const std::string &name) const |
CCopasiParameterGroup * | getGroup (const size_t &index) |
const CCopasiParameterGroup * | getGroup (const size_t &index) const |
size_t | getIndex (const std::string &name) const |
std::string | getKey (const std::string &name) const |
std::string | getKey (const size_t &index) const |
virtual const std::string & | getName (const size_t &index) const |
virtual const CObjectInterface * | getObject (const CCopasiObjectName &cn) const |
CCopasiParameter * | getParameter (const std::string &name) |
const CCopasiParameter * | getParameter (const std::string &name) const |
CCopasiParameter * | getParameter (const size_t &index) |
const CCopasiParameter * | getParameter (const size_t &index) const |
CCopasiParameter::Type | getType (const std::string &name) const |
CCopasiParameter::Type | getType (const size_t &index) const |
std::string | getUniqueParameterName (const CCopasiParameter *pParameter) const |
const CCopasiParameter::Value & | getValue (const std::string &name) const |
const CCopasiParameter::Value & | getValue (const size_t &index) const |
CCopasiParameter::Value & | getValue (const std::string &name) |
CCopasiParameter::Value & | getValue (const size_t &index) |
CCopasiParameterGroup & | operator= (const CCopasiParameterGroup &rhs) |
bool | removeParameter (const std::string &name) |
bool | removeParameter (const size_t &index) |
template<class CType > | |
bool | setValue (const std::string &name, const CType &value) |
template<class CType > | |
bool | setValue (const size_t &index, const CType &value) |
size_t | size () const |
bool | swap (const size_t &iFrom, const size_t &iTo) |
bool | swap (index_iterator &from, index_iterator &to) |
virtual | ~CCopasiParameterGroup () |
![]() | |
CCopasiParameter (const CCopasiParameter &src, const CCopasiContainer *pParent=NULL) | |
CCopasiParameter (const std::string &name, const Type &type, const void *pValue=NULL, const CCopasiContainer *pParent=NULL, const std::string &objectType="Parameter") | |
virtual CCopasiObjectName | getCN () const |
virtual const std::string & | getKey () const |
virtual std::string | getObjectDisplayName (bool regular=true, bool richtext=false) const |
const CCopasiParameter::Type & | getType () const |
const Value & | getValue () const |
Value & | getValue () |
virtual void * | getValuePointer () const |
CCopasiObject * | getValueReference () const |
bool | isValidValue (const C_FLOAT64 &value) const |
bool | isValidValue (const C_INT32 &value) const |
bool | isValidValue (const unsigned C_INT32 &value) const |
bool | isValidValue (const bool &value) const |
bool | isValidValue (const std::string &value) const |
bool | isValidValue (const CCopasiObjectName &value) const |
bool | isValidValue (const std::vector< CCopasiParameter * > &value) const |
CCopasiParameter & | operator= (const CCopasiParameter &rhs) |
template<class CType > | |
bool | setValue (const CType &value) |
bool | setValue (const std::vector< CCopasiParameter * > &value) |
virtual | ~CCopasiParameter () |
![]() | |
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 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 const DataObjectSet & | getDirectDependencies (const DataObjectSet &context=DataObjectSet()) const |
CCopasiContainer * | getObjectAncestor (const std::string &type) const |
CCopasiDataModel * | getObjectDataModel () |
const CCopasiDataModel * | getObjectDataModel () 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 bool | mustBeDeleted (const DataObjectSet &deletedObjects) 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 CSensMethod * | createMethod (CCopasiMethod::SubType subType=CCopasiMethod::sensMethod) |
![]() | |
static std::vector< Refresh * > | buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet()) |
static void | setRenameHandler (CRenameHandler *rh) |
Protected Member Functions | |
void | calculate_difference (size_t level, const C_FLOAT64 &delta, CCopasiArray &result, CCopasiArray::index_type &resultindex) |
bool | calculate_one_level (size_t level, CCopasiArray &result) |
CSensMethod (CCopasiMethod::SubType subType, const CCopasiContainer *pParent=NULL) | |
void | do_collapsing () |
C_FLOAT64 | do_collapsing_innerloop (CCopasiArray::index_type &fullindex) |
void | do_scaling () |
bool | do_target_calculation (CCopasiArray &result, bool first) |
C_FLOAT64 | do_variation (CCopasiObject *variable) |
void | scaling_targetfunction (const C_FLOAT64 &factor, CCopasiArray::index_type &resultindex) |
void | scaling_variables (size_t level, const C_FLOAT64 &factor, CCopasiArray::index_type &resultindex) |
void | setValue (CCopasiObject *variable, C_FLOAT64 value) |
![]() | |
CCopasiMethod (const CCopasiTask::Type &taskType, const SubType &subType, const CCopasiContainer *pParent=NULL) | |
![]() | |
CCopasiParameterGroup () | |
![]() | |
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< Refresh * > | mInitialRefreshes |
std::vector< CSensMethodLocalData > | mLocalData |
C_FLOAT64 * | mpDeltaFactor |
C_FLOAT64 * | mpMinDelta |
CSensProblem * | mpProblem |
CCopasiTask * | mpSubTask |
bool | mStoreSubtasktUpdateFlag |
stores the update model flag of the subtask More... | |
std::vector< CCopasiObject * > | mTargetfunctionPointers |
![]() | |
CProcessReport * | mpCallBack |
![]() | |
std::string | mKey |
CCopasiObject * | mpValueReference |
size_t | mSize |
Value | mValue |
![]() | |
objectMap | mObjects |
Private Member Functions | |
CSensMethod () | |
Private Attributes | |
size_t | mCounter |
size_t | mFailedCounter |
unsigned C_INT32 | mProgress |
size_t | mProgressHandler |
Definition at line 49 of file CSensMethod.h.
|
private |
Default constructor.
Referenced by createMethod().
|
explicitprotected |
Specific constructor.
CCopasiMethod::SubType | subType |
const | CCopasiContainer * pParent (default: NULL) |
Default constructor.
Definition at line 55 of file CSensMethod.cpp.
References CCopasiParameterGroup::addParameter(), C_FLOAT64, CONSTRUCTOR_TRACE, CCopasiParameter::getValue(), mpDeltaFactor, mpMinDelta, CCopasiParameter::Value::pUDOUBLE, and CCopasiParameter::UDOUBLE.
CSensMethod::CSensMethod | ( | const CSensMethod & | src, |
const CCopasiContainer * | pParent = NULL |
||
) |
Copy constructor.
const CTSSMethod & | src |
const | CCopasiContainer * pParent (default: NULL) |
Copy constructor.
const CSensMethod & | src |
Definition at line 86 of file CSensMethod.cpp.
References CONSTRUCTOR_TRACE.
CSensMethod::~CSensMethod | ( | ) |
|
protected |
Definition at line 213 of file CSensMethod.cpp.
References C_INVALID_INDEX, and mLocalData.
Referenced by calculate_one_level().
|
protected |
Definition at line 269 of file CSensMethod.cpp.
References C_FLOAT64, calculate_difference(), do_target_calculation(), do_variation(), CCopasiParameter::getValuePointer(), mLocalData, CCopasiArray::resize(), and setValue().
Referenced by process().
|
static |
Create a trajectory method. Note: the returned object has to be released after use with delete
CSensMethod class.
Definition at line 34 of file CSensMethod.cpp.
References CSensMethod(), fatalError, CCopasiMethod::sensMethod, and CCopasiMethod::unset.
Referenced by SensitivitiesWidget::createMethod(), and CSensTask::createMethod().
|
protected |
collapse the first dimension of the scaled result (by calculating the 2-norm over the target functions)
Definition at line 437 of file CSensMethod.cpp.
References C_INVALID_INDEX, CSensProblem::collapsRequested(), do_collapsing_innerloop(), CSensProblem::getCollapsedResult(), CSensProblem::getScaledResult(), mpProblem, and CCopasiArray::size().
Referenced by process().
|
protected |
Definition at line 413 of file CSensMethod.cpp.
References C_FLOAT64, CSensProblem::getScaledResult(), max, mpProblem, and CCopasiArray::size().
Referenced by do_collapsing().
|
protected |
calculate the scaled sensitivities. Calls scaling_variables(). It is assumed that the scaled result array is already of the correct size (this is done in initialize()).
Definition at line 404 of file CSensMethod.cpp.
References CCopasiArray::dimensionality(), CSensProblem::getResult(), mLocalData, mpProblem, and scaling_variables().
Referenced by process().
|
protected |
Definition at line 111 of file CSensMethod.cpp.
References C_FLOAT64, CCopasiProblem::getModel(), CCopasiParameter::getValuePointer(), mCounter, mFailedCounter, mInitialRefreshes, CCopasiMethod::mpCallBack, mpProblem, mProgress, mProgressHandler, mpSubTask, mTargetfunctionPointers, CCopasiTask::process(), CProcessReport::progressItem(), CCopasiArray::resize(), CModel::updateNonSimulatedValues(), and CModel::updateSimulatedValues().
Referenced by calculate_one_level().
|
protected |
Definition at line 183 of file CSensMethod.cpp.
References C_FLOAT64, CCopasiObject::getValuePointer(), mpDeltaFactor, mpMinDelta, and setValue().
Referenced by calculate_one_level().
size_t CSensMethod::getNumberOfSubtaskCalculations | ( | ) |
estimate how many calls to the subtask are necessary. Works only after initialize() was called.
Definition at line 686 of file CSensMethod.cpp.
References mLocalData.
Referenced by process().
bool CSensMethod::initialize | ( | CSensProblem * | problem | ) |
initializes the subtask, creates the internal data structures of the method, resizes the result arrays and creates the array annotations
Definition at line 501 of file CSensMethod.cpp.
References CModel::buildInitialRefreshSequence(), C_INVALID_INDEX, CSensProblem::collapsRequested(), CSensProblem::CrossSection, CSensProblem::Evaluation, CCopasiParameter::getCN(), CSensProblem::getCollapsedResult(), CSensProblem::getCollapsedResultAnnotated(), CSensItem::getListTypeDisplayName(), CCopasiProblem::getModel(), CSensProblem::getNumberOfVariables(), CCopasiObject::getObjectDataModel(), CCopasiTask::getProblem(), CSensProblem::getResult(), CSensProblem::getResultAnnotated(), CSensProblem::getScaledResult(), CSensProblem::getScaledResultAnnotated(), CSensProblem::getSubTaskType(), CSensProblem::getTargetFunctions(), CCopasiDataModel::getTaskList(), CSensProblem::getVariables(), CSensItem::getVariablesPointerList(), CCopasiTask::initialize(), CCopasiTask::isUpdateModel(), mInitialRefreshes, mLocalData, mpProblem, mpSubTask, mStoreSubtasktUpdateFlag, mTargetfunctionPointers, CCopasiTask::NO_OUTPUT, CSensProblem::Optimization, CSensProblem::ParameterEstimation, CCopasiArray::resize(), CArrayAnnotation::resize(), CArrayAnnotation::setAnnotationCN(), CCopasiTask::setCallBack(), CArrayAnnotation::setDimensionDescription(), CCopasiProblem::setModel(), CCopasiTask::setUpdateModel(), CSensProblem::SteadyState, and CSensProblem::TimeSeries.
Referenced by CSensTask::updateMatrices().
|
virtual |
Check if the method is suitable for this problem
Reimplemented from CCopasiMethod.
Definition at line 738 of file CSensMethod.cpp.
References CCopasiMessage::EXCEPTION, and CCopasiMethod::isValidProblem().
bool CSensMethod::process | ( | CProcessReport * | handler | ) |
Definition at line 699 of file CSensMethod.cpp.
References CProcessReport::addItem(), C_INT32, calculate_one_level(), do_collapsing(), do_scaling(), CProcessReport::finishItem(), getNumberOfSubtaskCalculations(), CSensProblem::getResult(), max, MCCopasiTask, mCounter, mFailedCounter, mLocalData, CCopasiMethod::mpCallBack, mpProblem, mProgress, mProgressHandler, mpSubTask, CCopasiTask::setCallBack(), CProcessReport::setName(), and CCopasiMessage::WARNING.
Referenced by CSensTask::process().
bool CSensMethod::restore | ( | const bool & | updateModel | ) |
Do all necessary restore procedures so that the model is in the same state as before
const | bool & updateModel |
Definition at line 672 of file CSensMethod.cpp.
References mpSubTask, mStoreSubtasktUpdateFlag, CCopasiTask::restore(), and CCopasiTask::setUpdateModel().
Referenced by CSensTask::restore().
|
protected |
This contains the loop over the target functions for scaling the sensitivities
Definition at line 326 of file CSensMethod.cpp.
References C_INVALID_INDEX, CSensProblem::getResult(), CSensProblem::getScaledResult(), mLocalData, and mpProblem.
Referenced by scaling_variables().
|
protected |
This contains the loop over the variables for scaling the sensitivities. Works recursively and calls scaling_targetfunction() in the end.
Definition at line 378 of file CSensMethod.cpp.
References C_FLOAT64, CCopasiParameter::getValuePointer(), mLocalData, and scaling_targetfunction().
Referenced by do_scaling().
|
protected |
wraps the CCopasiObject::setObjectValue() method so we can add special treatment of concentrations
Definition at line 197 of file CSensMethod.cpp.
References CCopasiObject::getObjectAncestor(), CCopasiObject::getObjectName(), CMetab::refreshNumber(), CMetab::setConcentration(), and CCopasiObject::setObjectValue().
Referenced by calculate_one_level(), and do_variation().
|
private |
Definition at line 188 of file CSensMethod.h.
Referenced by do_target_calculation(), and process().
|
private |
Definition at line 189 of file CSensMethod.h.
Referenced by do_target_calculation(), and process().
|
protected |
Definition at line 176 of file CSensMethod.h.
Referenced by do_target_calculation(), and initialize().
|
protected |
Definition at line 170 of file CSensMethod.h.
Referenced by calculate_difference(), calculate_one_level(), do_scaling(), getNumberOfSubtaskCalculations(), initialize(), process(), scaling_targetfunction(), and scaling_variables().
|
protected |
Definition at line 178 of file CSensMethod.h.
Referenced by CSensMethod(), and do_variation().
|
protected |
Definition at line 179 of file CSensMethod.h.
Referenced by CSensMethod(), and do_variation().
|
protected |
A pointer to the sensitivities problem.
Definition at line 168 of file CSensMethod.h.
Referenced by do_collapsing(), do_collapsing_innerloop(), do_scaling(), do_target_calculation(), initialize(), process(), and scaling_targetfunction().
|
private |
Definition at line 186 of file CSensMethod.h.
Referenced by do_target_calculation(), and process().
|
private |
Definition at line 185 of file CSensMethod.h.
Referenced by do_target_calculation(), and process().
|
protected |
Definition at line 174 of file CSensMethod.h.
Referenced by do_target_calculation(), initialize(), process(), and restore().
|
protected |
stores the update model flag of the subtask
Definition at line 182 of file CSensMethod.h.
Referenced by initialize(), and restore().
|
protected |
Definition at line 172 of file CSensMethod.h.
Referenced by do_target_calculation(), and initialize().