COPASI API  4.16.103
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
CSensProblem Class Reference

#include <CSensProblem.h>

Inheritance diagram for CSensProblem:
Inheritance graph
[legend]
Collaboration diagram for CSensProblem:
Collaboration graph
[legend]

Public Types

enum  SubTaskType {
  Evaluation, SteadyState, TimeSeries, ParameterEstimation,
  Optimization, CrossSection
}
 
- Public Types inherited from CCopasiParameterGroup
typedef parameterGroup::iterator index_iterator
 
typedef
CCopasiContainer::objectMap::iterator 
name_iterator
 
typedef std::vector
< CCopasiParameter * > 
parameterGroup
 
- Public Types inherited from CCopasiParameter
enum  Type {
  DOUBLE = 0, UDOUBLE, INT, UINT,
  BOOL, GROUP, STRING, CN,
  KEY, FILE, EXPRESSION, INVALID
}
 
- Public Types inherited from CCopasiContainer
typedef std::multimap
< std::string, CCopasiObject * > 
objectMap
 
- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 

Public Member Functions

void addVariables (const CSensItem &item)
 
void changeTargetFunctions (const CSensItem item)
 
bool changeVariables (size_t index, const CSensItem &item)
 
bool collapsRequested () const
 
 CSensProblem (const CCopasiContainer *pParent=NULL)
 
 CSensProblem (const CSensProblem &src, const CCopasiContainer *pParent=NULL)
 
CCopasiArraygetCollapsedResult ()
 
const CCopasiArraygetCollapsedResult () const
 
CArrayAnnotationgetCollapsedResultAnnotated ()
 
const CArrayAnnotationgetCollapsedResultAnnotated () const
 
size_t getNumberOfVariables () const
 
CCopasiArraygetResult ()
 
const CCopasiArraygetResult () const
 
CArrayAnnotationgetResultAnnotated ()
 
const CArrayAnnotationgetResultAnnotated () const
 
CCopasiArraygetScaledResult ()
 
const CCopasiArraygetScaledResult () const
 
CArrayAnnotationgetScaledResultAnnotated ()
 
const CArrayAnnotationgetScaledResultAnnotated () const
 
CSensProblem::SubTaskType getSubTaskType () const
 
CSensItem getTargetFunctions () const
 
CSensItem getVariables (size_t index) const
 
virtual void print (std::ostream *ostream) const
 
virtual void printResult (std::ostream *ostream) const
 
bool removeVariables (size_t index)
 
bool removeVariables ()
 
void setSubTaskType (const CSensProblem::SubTaskType &type)
 
virtual ~CSensProblem ()
 
- Public Member Functions inherited from CCopasiProblem
 CCopasiProblem (const CCopasiProblem &src, const CCopasiContainer *pParent=NULL)
 
CModelgetModel () const
 
const CCopasiTask::TypegetType () const
 
virtual bool initialize ()
 
virtual bool restore (const bool &updateModel)
 
virtual bool setCallBack (CProcessReport *pCallBack)
 
virtual bool setModel (CModel *pModel)
 
virtual ~CCopasiProblem ()
 
- Public Member Functions inherited from CCopasiParameterGroup
bool addGroup (const std::string &name)
 
bool addParameter (const CCopasiParameter &parameter)
 
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)
 
CCopasiParameterGroupassertGroup (const std::string &name)
 
template<class CType >
CCopasiParameterassertParameter (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
 
CCopasiParameterGroupgetGroup (const std::string &name)
 
const CCopasiParameterGroupgetGroup (const std::string &name) const
 
CCopasiParameterGroupgetGroup (const size_t &index)
 
const CCopasiParameterGroupgetGroup (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 CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
CCopasiParametergetParameter (const std::string &name)
 
const CCopasiParametergetParameter (const std::string &name) const
 
CCopasiParametergetParameter (const size_t &index)
 
const CCopasiParametergetParameter (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::ValuegetValue (const std::string &name) const
 
const CCopasiParameter::ValuegetValue (const size_t &index) const
 
CCopasiParameter::ValuegetValue (const std::string &name)
 
CCopasiParameter::ValuegetValue (const size_t &index)
 
CCopasiParameterGroupoperator= (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 ()
 
- Public Member Functions inherited from CCopasiParameter
 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::TypegetType () const
 
const ValuegetValue () const
 
ValuegetValue ()
 
virtual voidgetValuePointer () const
 
CCopasiObjectgetValueReference () 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
 
CCopasiParameteroperator= (const CCopasiParameter &rhs)
 
template<class CType >
bool setValue (const CType &value)
 
bool setValue (const std::vector< CCopasiParameter * > &value)
 
virtual ~CCopasiParameter ()
 
- Public Member Functions inherited from CCopasiContainer
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 objectMapgetObjects () const
 
virtual std::string getUnits () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual bool remove (CCopasiObject *pObject)
 
virtual ~CCopasiContainer ()
 
- Public Member Functions inherited from CCopasiObject
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 DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
UpdateMethodgetUpdateMethod () 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 ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Static Public Member Functions

static std::vector
< CObjectLists::ListType
getPossibleTargetFunctions (CSensProblem::SubTaskType)
 
static std::vector
< CObjectLists::ListType
getPossibleVariables (CSensProblem::SubTaskType)
 
- Static Public Member Functions inherited from CCopasiObject
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 SubTaskName []
 
static const char * XMLSubTask []
 
- Static Public Attributes inherited from CCopasiParameter
static const std::string TypeName []
 
static const char * XMLType []
 
- Static Public Attributes inherited from CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 

Private Member Functions

void initDebugProblem ()
 
void initObjects ()
 

Static Private Member Functions

static void copyParameterGroupToSensItem (const CCopasiParameterGroup *pg, CSensItem *si)
 
static void copySensItemToParameterGroup (const CSensItem *si, CCopasiParameterGroup *pg)
 
static void createParametersInGroup (CCopasiParameterGroup *pg)
 

Private Attributes

CCopasiArray mCollapsedResult
 
CArrayAnnotationmpCollapsedResultAnnotation
 
CArrayAnnotationmpResultAnnotation
 
CArrayAnnotationmpScaledResultAnnotation
 
CSensProblem::SubTaskTypempSubTaskType
 
CCopasiParameterGroupmpTargetFunctions
 
CCopasiParameterGroupmpVariablesGroup
 
CCopasiArray mResult
 
CCopasiArray mScaledResult
 

Friends

std::ostream & operator<< (std::ostream &os, const CSensProblem &o)
 

Additional Inherited Members

- Protected Types inherited from CCopasiObject
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
}
 
- Protected Member Functions inherited from CCopasiProblem
 CCopasiProblem (const CCopasiTask::Type &type, const CCopasiContainer *pParent=NULL)
 
- Protected Member Functions inherited from CCopasiParameterGroup
 CCopasiParameterGroup ()
 
- Protected Member Functions inherited from CCopasiContainer
template<class CType >
CCopasiObjectaddMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
void initObjects ()
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Protected Attributes inherited from CCopasiProblem
CProcessReportmpCallBack
 
CModelmpModel
 
CReportmpReport
 
- Protected Attributes inherited from CCopasiParameter
std::string mKey
 
CCopasiObjectmpValueReference
 
size_t mSize
 
Value mValue
 
- Protected Attributes inherited from CCopasiContainer
objectMap mObjects
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

CSensProblem class.

Definition at line 64 of file CSensProblem.h.

Member Enumeration Documentation

this enumeration

Enumerator
Evaluation 
SteadyState 
TimeSeries 
ParameterEstimation 
Optimization 
CrossSection 

Definition at line 71 of file CSensProblem.h.

Constructor & Destructor Documentation

CSensProblem::CSensProblem ( const CCopasiContainer pParent = NULL)

Default constructor.

Parameters
constCCopasiContainer * pParent (default: NULL)

Default constructor.

Parameters
CModel *pModel

Definition at line 192 of file CSensProblem.cpp.

References CCopasiParameterGroup::addGroup(), CCopasiParameterGroup::addParameter(), addVariables(), CObjectLists::ALL_PARAMETER_VALUES, C_INT32, changeTargetFunctions(), CONSTRUCTOR_TRACE, createParametersInGroup(), CCopasiParameterGroup::getParameter(), CCopasiParameter::getValue(), initObjects(), mpSubTaskType, mpTargetFunctions, mpVariablesGroup, CObjectLists::NON_CONST_METAB_CONCENTRATIONS, CCopasiParameter::Value::pUINT, CSensItem::setListType(), setSubTaskType(), SteadyState, and CCopasiParameter::UINT.

192  :
194  mpSubTaskType(NULL),
195  mpTargetFunctions(NULL),
196  mpVariablesGroup(NULL),
197  mpResultAnnotation(NULL),
200 {
201  addParameter("SubtaskType", CCopasiParameter::UINT, (unsigned C_INT32) 0);
203 
204  //---------------------------------------------------
205  addGroup("TargetFunctions");
206  mpTargetFunctions = dynamic_cast<CCopasiParameterGroup*>(getParameter("TargetFunctions"));
208 
209  //---------------------------------------------------
210  addGroup("ListOfVariables");
211  mpVariablesGroup = dynamic_cast<CCopasiParameterGroup*>(getParameter("ListOfVariables"));
212 
213  //create a useful default problem
215 
216  CSensItem item;
217 
219  changeTargetFunctions(item);
220 
222  addVariables(item);
223 
224  // initDebugProblem();
225  initObjects();
227 }
CCopasiParameterGroup * mpTargetFunctions
Definition: CSensProblem.h:194
CArrayAnnotation * mpCollapsedResultAnnotation
Definition: CSensProblem.h:222
void changeTargetFunctions(const CSensItem item)
#define C_INT32
Definition: copasi.h:90
void initObjects()
static void createParametersInGroup(CCopasiParameterGroup *pg)
CCopasiParameterGroup * mpVariablesGroup
Definition: CSensProblem.h:201
bool addGroup(const std::string &name)
const Value & getValue() const
unsigned C_INT32 * pUINT
CArrayAnnotation * mpResultAnnotation
Definition: CSensProblem.h:208
CCopasiParameter * getParameter(const std::string &name)
bool addParameter(const CCopasiParameter &parameter)
void addVariables(const CSensItem &item)
void setListType(CObjectLists::ListType lt)
void setSubTaskType(const CSensProblem::SubTaskType &type)
CArrayAnnotation * mpScaledResultAnnotation
Definition: CSensProblem.h:215
CSensProblem::SubTaskType * mpSubTaskType
Definition: CSensProblem.h:192
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CSensProblem::CSensProblem ( const CSensProblem src,
const CCopasiContainer pParent = NULL 
)

Copy constructor.

Parameters
const CSensProblem &src CCopasiContainer * pParent (default: NULL)

Copy constructor.

Parameters
const CSensProblem &src

Definition at line 233 of file CSensProblem.cpp.

References CONSTRUCTOR_TRACE, CCopasiParameterGroup::getParameter(), CCopasiParameter::getValue(), initObjects(), mpSubTaskType, mpTargetFunctions, mpVariablesGroup, and CCopasiParameter::Value::pUINT.

234  :
235  CCopasiProblem(src, pParent),
236  mpSubTaskType(NULL),
237  mpTargetFunctions(NULL),
238  mpVariablesGroup(NULL),
239  mpResultAnnotation(NULL),
242 {
244  mpTargetFunctions = dynamic_cast<CCopasiParameterGroup*>(getParameter("TargetFunctions"));
245  mpVariablesGroup = dynamic_cast<CCopasiParameterGroup*>(getParameter("ListOfVariables"));
246 
247  initObjects();
249 }
CCopasiParameterGroup * mpTargetFunctions
Definition: CSensProblem.h:194
CArrayAnnotation * mpCollapsedResultAnnotation
Definition: CSensProblem.h:222
void initObjects()
CCopasiParameterGroup * mpVariablesGroup
Definition: CSensProblem.h:201
const Value & getValue() const
unsigned C_INT32 * pUINT
CArrayAnnotation * mpResultAnnotation
Definition: CSensProblem.h:208
CCopasiParameter * getParameter(const std::string &name)
CArrayAnnotation * mpScaledResultAnnotation
Definition: CSensProblem.h:215
CSensProblem::SubTaskType * mpSubTaskType
Definition: CSensProblem.h:192
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CSensProblem::~CSensProblem ( )
virtual

Destructor.

Definition at line 269 of file CSensProblem.cpp.

References DESTRUCTOR_TRACE.

#define DESTRUCTOR_TRACE
Definition: copasi.h:206

Member Function Documentation

void CSensProblem::addVariables ( const CSensItem item)

Definition at line 324 of file CSensProblem.cpp.

References CCopasiParameterGroup::addGroup(), copySensItemToParameterGroup(), createParametersInGroup(), getNumberOfVariables(), CCopasiParameterGroup::getParameter(), and mpVariablesGroup.

Referenced by changeVariables(), CSensProblem(), initDebugProblem(), and SensitivitiesWidget::saveTask().

325 {
326  //create parameter group corresponding to sens item
328  mpVariablesGroup->addGroup("Variables");
330 
332 
333  copySensItemToParameterGroup(&item, tmp);
334 }
size_t getNumberOfVariables() const
static void createParametersInGroup(CCopasiParameterGroup *pg)
CCopasiParameterGroup * mpVariablesGroup
Definition: CSensProblem.h:201
bool addGroup(const std::string &name)
CCopasiParameter * getParameter(const std::string &name)
static void copySensItemToParameterGroup(const CSensItem *si, CCopasiParameterGroup *pg)
void CSensProblem::changeTargetFunctions ( const CSensItem  item)

Definition at line 302 of file CSensProblem.cpp.

References copySensItemToParameterGroup(), and mpTargetFunctions.

Referenced by CSensProblem(), and SensitivitiesWidget::saveTask().

303 {
305 }
CCopasiParameterGroup * mpTargetFunctions
Definition: CSensProblem.h:194
static void copySensItemToParameterGroup(const CSensItem *si, CCopasiParameterGroup *pg)
bool CSensProblem::changeVariables ( size_t  index,
const CSensItem item 
)

Definition at line 351 of file CSensProblem.cpp.

References addVariables(), copySensItemToParameterGroup(), getNumberOfVariables(), CCopasiParameterGroup::getParameter(), and mpVariablesGroup.

352 {
353  size_t num = getNumberOfVariables();
354 
355  if (index > num)
356  return false;
357 
358  if (index == num)
359  addVariables(item);
360  else
361  {
362  CCopasiParameterGroup * tmp =
364  copySensItemToParameterGroup(&item, tmp);
365  }
366 
367  return true;
368 }
size_t getNumberOfVariables() const
CCopasiParameterGroup * mpVariablesGroup
Definition: CSensProblem.h:201
CCopasiParameter * getParameter(const std::string &name)
void addVariables(const CSensItem &item)
static void copySensItemToParameterGroup(const CSensItem *si, CCopasiParameterGroup *pg)
bool CSensProblem::collapsRequested ( ) const

Definition at line 430 of file CSensProblem.cpp.

References getTargetFunctions(), and CSensItem::isSingleObject().

Referenced by CSensMethod::do_collapsing(), CSensMethod::initialize(), and CQSensResultWidget::newResult().

431 {
433 }
CSensItem getTargetFunctions() const
bool isSingleObject() const
void CSensProblem::copyParameterGroupToSensItem ( const CCopasiParameterGroup pg,
CSensItem si 
)
staticprivate

Definition at line 166 of file CSensProblem.cpp.

References CCopasiParameterGroup::getValue(), CCopasiParameter::Value::pCN, CCopasiParameter::Value::pUINT, CSensItem::setListType(), and CSensItem::setSingleObjectCN().

Referenced by getTargetFunctions(), and getVariables().

167 {
168 
169  if (!pg) return; if (!si) return;
170 
171  CCopasiObjectName* pCN = pg->getValue("SingleObject").pCN;
172  CObjectLists::ListType* pLT = (CObjectLists::ListType*)pg->getValue("ObjectListType").pUINT;
173 
174  CCopasiObjectName cn("");
175 
176  if (pCN) cn = *pCN;
177 
179 
180  if (pLT) lt = *pLT;
181 
182  // if (cn != "")
183  si->setSingleObjectCN(cn);
184  // else
185  si->setListType(lt);
186 }
void setSingleObjectCN(const CCopasiObjectName &cn)
CRegisteredObjectName * pCN
unsigned C_INT32 * pUINT
const CCopasiParameter::Value & getValue(const std::string &name) const
void setListType(CObjectLists::ListType lt)
void CSensProblem::copySensItemToParameterGroup ( const CSensItem si,
CCopasiParameterGroup pg 
)
staticprivate

Definition at line 152 of file CSensProblem.cpp.

References C_INT32, CSensItem::getListType(), CSensItem::getSingleObjectCN(), CSensItem::isSingleObject(), and CCopasiParameterGroup::setValue().

Referenced by addVariables(), changeTargetFunctions(), and changeVariables().

153 {
154  CCopasiObjectName cn("");
155 
156  if (!pg) return; if (!si) return;
157 
158  if (si->isSingleObject())
159  cn = si->getSingleObjectCN();
160 
161  pg->setValue("SingleObject", cn);
162  pg->setValue("ObjectListType", (unsigned C_INT32)si->getListType());
163 }
#define C_INT32
Definition: copasi.h:90
bool isSingleObject() const
const CObjectLists::ListType & getListType() const
bool setValue(const std::string &name, const CType &value)
const CCopasiObjectName & getSingleObjectCN() const
void CSensProblem::createParametersInGroup ( CCopasiParameterGroup pg)
staticprivate

create the copasi parameters corresponding to the members of a CSensItem

Definition at line 143 of file CSensProblem.cpp.

References CCopasiParameterGroup::addParameter(), C_INT32, CCopasiParameter::CN, and CCopasiParameter::UINT.

Referenced by addVariables(), and CSensProblem().

144 {
145  if (!pg) return;
146 
147  pg->addParameter("SingleObject", CCopasiParameter::CN, CCopasiObjectName(""));
148  pg->addParameter("ObjectListType", CCopasiParameter::UINT, (unsigned C_INT32) 0);
149 }
#define C_INT32
Definition: copasi.h:90
bool addParameter(const CCopasiParameter &parameter)
CCopasiArray & CSensProblem::getCollapsedResult ( )

Definition at line 410 of file CSensProblem.cpp.

References mCollapsedResult.

Referenced by CSensMethod::do_collapsing(), and CSensMethod::initialize().

411 {
412  return mCollapsedResult;
413 }
CCopasiArray mCollapsedResult
Definition: CSensProblem.h:220
const CCopasiArray & CSensProblem::getCollapsedResult ( ) const

Definition at line 415 of file CSensProblem.cpp.

References mCollapsedResult.

416 {
417  return mCollapsedResult;
418 }
CCopasiArray mCollapsedResult
Definition: CSensProblem.h:220
CArrayAnnotation * CSensProblem::getCollapsedResultAnnotated ( )

Definition at line 420 of file CSensProblem.cpp.

References mpCollapsedResultAnnotation.

Referenced by CSensMethod::initialize(), and CQSensResultWidget::newResult().

421 {
423 }
CArrayAnnotation * mpCollapsedResultAnnotation
Definition: CSensProblem.h:222
const CArrayAnnotation * CSensProblem::getCollapsedResultAnnotated ( ) const

Definition at line 425 of file CSensProblem.cpp.

References mpCollapsedResultAnnotation.

426 {
428 }
CArrayAnnotation * mpCollapsedResultAnnotation
Definition: CSensProblem.h:222
size_t CSensProblem::getNumberOfVariables ( ) const

Definition at line 307 of file CSensProblem.cpp.

References mpVariablesGroup, and CCopasiParameterGroup::size().

Referenced by addVariables(), changeVariables(), CSensMethod::initialize(), SensitivitiesWidget::loadTask(), and operator<<().

308 {
309  return mpVariablesGroup->size();
310 }
CCopasiParameterGroup * mpVariablesGroup
Definition: CSensProblem.h:201
std::vector< CObjectLists::ListType > CSensProblem::getPossibleTargetFunctions ( CSensProblem::SubTaskType  type)
static

Definition at line 437 of file CSensProblem.cpp.

References CObjectLists::ALL_VARIABLES, CrossSection, Evaluation, CObjectLists::GLOBAL_PARAMETER_RATES, CObjectLists::METAB_CONC_RATES, CObjectLists::METAB_PART_RATES, CObjectLists::NON_CONST_GLOBAL_PARAMETER_VALUES, CObjectLists::NON_CONST_METAB_CONCENTRATIONS, CObjectLists::NON_CONST_METAB_NUMBERS, Optimization, ParameterEstimation, CObjectLists::REACTION_CONC_FLUXES, CObjectLists::REACTION_PART_FLUXES, CObjectLists::REDUCED_JACOBIAN_EV_IM, CObjectLists::REDUCED_JACOBIAN_EV_RE, CObjectLists::SINGLE_OBJECT, SteadyState, and TimeSeries.

Referenced by SensitivitiesWidget::updateComboBoxes().

438 {
439  std::vector<CObjectLists::ListType> list;
440 
441  //list.push_back(CObjectLists::EMPTY_LIST);
442 
443  // Add new functions here, under applicable SubTaskType case.
444  // Don't forget to provide for a string value in
445  // getTargetFunctionName()
446  switch (type)
447  {
449  list.push_back(CObjectLists::SINGLE_OBJECT);
450  list.push_back(CObjectLists::REACTION_CONC_FLUXES);
451  list.push_back(CObjectLists::REACTION_PART_FLUXES);
452  list.push_back(CObjectLists::METAB_CONC_RATES);
453  list.push_back(CObjectLists::METAB_PART_RATES);
454  list.push_back(CObjectLists::GLOBAL_PARAMETER_RATES);
455  break;
456 
458  list.push_back(CObjectLists::SINGLE_OBJECT);
459  list.push_back(CObjectLists::ALL_VARIABLES);
462  list.push_back(CObjectLists::METAB_CONC_RATES);
463  list.push_back(CObjectLists::METAB_PART_RATES);
465  list.push_back(CObjectLists::REACTION_CONC_FLUXES);
466  list.push_back(CObjectLists::REACTION_PART_FLUXES);
467  list.push_back(CObjectLists::REDUCED_JACOBIAN_EV_RE);
468  list.push_back(CObjectLists::REDUCED_JACOBIAN_EV_IM);
469  break;
470 
472  list.push_back(CObjectLists::SINGLE_OBJECT);
473  list.push_back(CObjectLists::ALL_VARIABLES);
476  list.push_back(CObjectLists::METAB_CONC_RATES);
477  list.push_back(CObjectLists::METAB_PART_RATES);
479  list.push_back(CObjectLists::REACTION_CONC_FLUXES);
480  list.push_back(CObjectLists::REACTION_PART_FLUXES);
481  //TODO all model variables
482  break;
483 
487  list.push_back(CObjectLists::SINGLE_OBJECT);
488  break;
489 
490  /*case (CSensProblem::LyapunovExp):
491  list.push_back(CObjectLists::SINGLE_OBJECT);
492  list.push_back(CObjectLists::NON_CONST_METAB_NUMBERS);
493  list.push_back(CObjectLists::NON_CONST_METAB_CONCENTRATIONS);
494  list.push_back(CObjectLists::REACTION_CONC_FLUXES);
495  list.push_back(CObjectLists::NON_CONST_METAB_PART_RATES);
496  break;*/
497  }
498 
499  return list;
500 }
std::vector< CObjectLists::ListType > CSensProblem::getPossibleVariables ( CSensProblem::SubTaskType  type)
static

Definition at line 504 of file CSensProblem.cpp.

References CObjectLists::ALL_LOCAL_PARAMETER_VALUES, CObjectLists::ALL_PARAMETER_AND_INITIAL_VALUES, CObjectLists::ALL_PARAMETER_VALUES, CrossSection, Evaluation, CObjectLists::GLOBAL_PARAMETER_VALUES, CObjectLists::METAB_CONCENTRATIONS, CObjectLists::METAB_INITIAL_CONCENTRATIONS, CObjectLists::NON_CONST_GLOBAL_PARAMETER_VALUES, CObjectLists::NON_CONST_METAB_CONCENTRATIONS, CObjectLists::NON_CONST_METAB_NUMBERS, Optimization, ParameterEstimation, CObjectLists::SINGLE_OBJECT, SteadyState, and TimeSeries.

Referenced by SensitivitiesWidget::updateComboBoxes().

505 {
506  std::vector<CObjectLists::ListType> list;
507 
508  // the 'unset' type, abusing CObjectLists::ALL_METABS
509  list.push_back((CObjectLists::ListType) 0);
510 
511  // Add new variables here, to applicable SubTaskType case.
512  // Don't forget to provide for a string value in
513  // getVariableName()
514  switch (type)
515  {
516  case (Evaluation):
517  list.push_back(CObjectLists::SINGLE_OBJECT);
519  list.push_back(CObjectLists::METAB_CONCENTRATIONS);
524  list.push_back(CObjectLists::ALL_PARAMETER_VALUES);
525  break;
526 
527  case (SteadyState):
528  list.push_back(CObjectLists::SINGLE_OBJECT);
530  list.push_back(CObjectLists::ALL_PARAMETER_VALUES);
532  //TODO all const values, all model parameters
533  break;
534 
535  case (TimeSeries):
536  list.push_back(CObjectLists::SINGLE_OBJECT);
538  list.push_back(CObjectLists::ALL_PARAMETER_VALUES);
541  //TODO all const values, all model parameters, all initial values
542  break;
543 
546  list.push_back(CObjectLists::SINGLE_OBJECT);
548  list.push_back(CObjectLists::ALL_PARAMETER_VALUES);
551  break;
552 
554  list.push_back(CObjectLists::SINGLE_OBJECT);
556  list.push_back(CObjectLists::ALL_PARAMETER_VALUES);
559  break;
560 
561  /*case (LyapunovExp):
562  list.push_back(CObjectLists::SINGLE_OBJECT);
563  list.push_back(CObjectLists::NON_CONST_METAB_CONCENTRATIONS);
564  list.push_back(CObjectLists::GLOBAL_PARAMETER_VALUES);
565  list.push_back(CObjectLists::ALL_LOCAL_PARAMETER_VALUES);
566  list.push_back(CObjectLists::ALL_PARAMETER_VALUES);
567  list.push_back(CObjectLists::ALL_PARAMETER_AND_INITIAL_VALUES);
568  break;*/
569  }
570 
571  return list;
572 }
CCopasiArray & CSensProblem::getResult ( )

Definition at line 370 of file CSensProblem.cpp.

References mResult.

Referenced by CSensMethod::do_scaling(), CSensMethod::initialize(), CSensMethod::process(), and CSensMethod::scaling_targetfunction().

371 {
372  return mResult;
373 }
CCopasiArray mResult
Definition: CSensProblem.h:206
const CCopasiArray & CSensProblem::getResult ( ) const

Definition at line 375 of file CSensProblem.cpp.

References mResult.

376 {
377  return mResult;
378 }
CCopasiArray mResult
Definition: CSensProblem.h:206
CArrayAnnotation * CSensProblem::getResultAnnotated ( )

Definition at line 380 of file CSensProblem.cpp.

References mpResultAnnotation.

Referenced by CQSensResultWidget::enterProtected(), CSensMethod::initialize(), and CQSensResultWidget::newResult().

381 {
382  return mpResultAnnotation;
383 }
CArrayAnnotation * mpResultAnnotation
Definition: CSensProblem.h:208
const CArrayAnnotation * CSensProblem::getResultAnnotated ( ) const

Definition at line 385 of file CSensProblem.cpp.

References mpResultAnnotation.

386 {
387  return mpResultAnnotation;
388 }
CArrayAnnotation * mpResultAnnotation
Definition: CSensProblem.h:208
CCopasiArray & CSensProblem::getScaledResult ( )
const CCopasiArray & CSensProblem::getScaledResult ( ) const

Definition at line 395 of file CSensProblem.cpp.

References mScaledResult.

396 {
397  return mScaledResult;
398 }
CCopasiArray mScaledResult
Definition: CSensProblem.h:213
CArrayAnnotation * CSensProblem::getScaledResultAnnotated ( )

Definition at line 400 of file CSensProblem.cpp.

References mpScaledResultAnnotation.

Referenced by CSensMethod::initialize(), and CQSensResultWidget::newResult().

401 {
403 }
CArrayAnnotation * mpScaledResultAnnotation
Definition: CSensProblem.h:215
const CArrayAnnotation * CSensProblem::getScaledResultAnnotated ( ) const

Definition at line 405 of file CSensProblem.cpp.

References mpScaledResultAnnotation.

406 {
408 }
CArrayAnnotation * mpScaledResultAnnotation
Definition: CSensProblem.h:215
CSensProblem::SubTaskType CSensProblem::getSubTaskType ( ) const

get the problem's SubTaskType:

Definition at line 282 of file CSensProblem.cpp.

References Evaluation, and mpSubTaskType.

Referenced by CSensMethod::initialize(), SensitivitiesWidget::loadTask(), and operator<<().

283 {
284  if (mpSubTaskType)
285  return *mpSubTaskType;
286  else
288 }
CSensProblem::SubTaskType * mpSubTaskType
Definition: CSensProblem.h:192
CSensItem CSensProblem::getTargetFunctions ( ) const

Definition at line 290 of file CSensProblem.cpp.

References copyParameterGroupToSensItem(), and mpTargetFunctions.

Referenced by collapsRequested(), CSensMethod::initialize(), SensitivitiesWidget::loadTask(), and operator<<().

291 {
292  CSensItem ret;
294 
296 
297  copyParameterGroupToSensItem(tmp, &ret);
298 
299  return ret;
300 }
CCopasiParameterGroup * mpTargetFunctions
Definition: CSensProblem.h:194
static void copyParameterGroupToSensItem(const CCopasiParameterGroup *pg, CSensItem *si)
CSensItem CSensProblem::getVariables ( size_t  index) const

Definition at line 312 of file CSensProblem.cpp.

References copyParameterGroupToSensItem(), CCopasiParameterGroup::getParameter(), and mpVariablesGroup.

Referenced by CSensMethod::initialize(), SensitivitiesWidget::loadTask(), and operator<<().

313 {
314  CSensItem ret;
316 
318 
319  copyParameterGroupToSensItem(tmp, &ret);
320 
321  return ret;
322 }
static void copyParameterGroupToSensItem(const CCopasiParameterGroup *pg, CSensItem *si)
CCopasiParameterGroup * mpVariablesGroup
Definition: CSensProblem.h:201
CCopasiParameter * getParameter(const std::string &name)
void CSensProblem::initDebugProblem ( )
private

this sets up a problem for debugging purposes

Definition at line 636 of file CSensProblem.cpp.

References addVariables(), CCopasiParameter::getCN(), CObjectLists::NON_CONST_METAB_CONCENTRATIONS, CSensItem::setListType(), and CSensItem::setSingleObjectCN().

637 {
638  CSensItem item;
639 
640  item.setSingleObjectCN(this->getCN());
641  addVariables(item);
642 
644  addVariables(item);
645 }
void setSingleObjectCN(const CCopasiObjectName &cn)
virtual CCopasiObjectName getCN() const
void addVariables(const CSensItem &item)
void setListType(CObjectLists::ListType lt)
void CSensProblem::initObjects ( )
private

Definition at line 251 of file CSensProblem.cpp.

References mCollapsedResult, mpCollapsedResultAnnotation, mpResultAnnotation, mpScaledResultAnnotation, mResult, mScaledResult, CArrayAnnotation::OBJECTS, CArrayAnnotation::setDescription(), and CArrayAnnotation::setMode().

Referenced by CSensProblem().

252 {
253  mpResultAnnotation = new CArrayAnnotation("Sensitivities array", this, &mResult, false);
256 
257  mpScaledResultAnnotation = new CArrayAnnotation("Scaled sensitivities array", this, &mScaledResult, false);
260 
261  mpCollapsedResultAnnotation = new CArrayAnnotation("Summarized sensitivities array", this, &mCollapsedResult, false);
264 }
CCopasiArray mScaledResult
Definition: CSensProblem.h:213
CArrayAnnotation * mpCollapsedResultAnnotation
Definition: CSensProblem.h:222
void setDescription(const std::string &s)
CCopasiArray mCollapsedResult
Definition: CSensProblem.h:220
CArrayAnnotation * mpResultAnnotation
Definition: CSensProblem.h:208
void setMode(size_t d, Mode m)
CCopasiArray mResult
Definition: CSensProblem.h:206
CArrayAnnotation * mpScaledResultAnnotation
Definition: CSensProblem.h:215
void CSensProblem::print ( std::ostream *  ostream) const
virtual

This is the output method for any object. It calls the insert operator<<

Parameters
std::ostream* ostream

Reimplemented from CCopasiProblem.

Definition at line 633 of file CSensProblem.cpp.

634 {*ostream << *this;}
void CSensProblem::printResult ( std::ostream *  ostream) const
virtual

This is the output method for any result of a problem. The default implementation provided with CCopasiProblem. Does only print "Not implemented." To overide this default behaviour one needs to reimplement the virtual printResult function.

Parameters
std::ostream* ostream

Reimplemented from CCopasiProblem.

Definition at line 574 of file CSensProblem.cpp.

References mpResultAnnotation, and mpScaledResultAnnotation.

575 {
576  std::ostream & os = *ostream;
577 
578  //os << "Sensitivities result." << std::endl;
579  if (mpResultAnnotation)
580  os << *mpResultAnnotation << std::endl;
581 
583  os << *mpScaledResultAnnotation << std::endl;
584 }
CArrayAnnotation * mpResultAnnotation
Definition: CSensProblem.h:208
CArrayAnnotation * mpScaledResultAnnotation
Definition: CSensProblem.h:215
bool CSensProblem::removeVariables ( size_t  index)

Definition at line 346 of file CSensProblem.cpp.

References mpVariablesGroup, and CCopasiParameterGroup::removeParameter().

Referenced by SensitivitiesWidget::saveTask().

347 {
348  return mpVariablesGroup->removeParameter(index);
349 }
bool removeParameter(const std::string &name)
CCopasiParameterGroup * mpVariablesGroup
Definition: CSensProblem.h:201
bool CSensProblem::removeVariables ( )

Definition at line 336 of file CSensProblem.cpp.

References mpVariablesGroup, CCopasiParameterGroup::removeParameter(), and CCopasiParameterGroup::size().

337 {
338  size_t imax = mpVariablesGroup->size();
339 
340  for (size_t i = 0; i < imax; ++i)
342 
343  return true;
344 }
bool removeParameter(const std::string &name)
CCopasiParameterGroup * mpVariablesGroup
Definition: CSensProblem.h:201
void CSensProblem::setSubTaskType ( const CSensProblem::SubTaskType type)

set the problem's SubTaskType:

Definition at line 276 of file CSensProblem.cpp.

References mpSubTaskType.

Referenced by CSensProblem(), and SensitivitiesWidget::saveTask().

277 {*mpSubTaskType = type;}
CSensProblem::SubTaskType * mpSubTaskType
Definition: CSensProblem.h:192

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CSensProblem o 
)
friend

Output stream operator. Prints description of the problem

Parameters
ostream& os
constProblem & A
Returns
ostream & os

Definition at line 612 of file CSensProblem.cpp.

613 {
614  os << "Function(s) to be derived:" << std::endl;
615  const CCopasiDataModel* pDataModel = o.getObjectDataModel();
616  assert(pDataModel != NULL);
617  os << o.getTargetFunctions().print(pDataModel) << std::endl << std::endl;
618 
619  os << "Calculation to perform: "
620  << CSensProblem::SubTaskName[o.getSubTaskType()] << std::endl << std::endl;
621 
622  size_t i, imax = o.getNumberOfVariables();
623 
624  for (i = 0; i < imax; ++i)
625  {
626  os << "Variable(s) for " << i + 1 << ". derivation:" << std::endl;
627  os << o.getVariables(i).print(pDataModel) << std::endl << std::endl;
628  }
629 
630  return os;
631 }
CCopasiDataModel * getObjectDataModel()
size_t getNumberOfVariables() const
CSensItem getVariables(size_t index) const
static const std::string SubTaskName[]
Definition: CSensProblem.h:82
CSensProblem::SubTaskType getSubTaskType() const
CSensItem getTargetFunctions() const
std::string print(const CCopasiDataModel *pDataModel) const

Member Data Documentation

CCopasiArray CSensProblem::mCollapsedResult
private

This holds the collapsed result

Definition at line 220 of file CSensProblem.h.

Referenced by getCollapsedResult(), and initObjects().

CArrayAnnotation* CSensProblem::mpCollapsedResultAnnotation
private

Definition at line 222 of file CSensProblem.h.

Referenced by getCollapsedResultAnnotated(), and initObjects().

CArrayAnnotation* CSensProblem::mpResultAnnotation
private

Definition at line 208 of file CSensProblem.h.

Referenced by getResultAnnotated(), initObjects(), and printResult().

CArrayAnnotation* CSensProblem::mpScaledResultAnnotation
private

Definition at line 215 of file CSensProblem.h.

Referenced by getScaledResultAnnotated(), initObjects(), and printResult().

CSensProblem::SubTaskType* CSensProblem::mpSubTaskType
private

Definition at line 192 of file CSensProblem.h.

Referenced by CSensProblem(), getSubTaskType(), and setSubTaskType().

CCopasiParameterGroup* CSensProblem::mpTargetFunctions
private

Definition at line 194 of file CSensProblem.h.

Referenced by changeTargetFunctions(), CSensProblem(), and getTargetFunctions().

CCopasiParameterGroup* CSensProblem::mpVariablesGroup
private

This holds the variables items

Definition at line 201 of file CSensProblem.h.

Referenced by addVariables(), changeVariables(), CSensProblem(), getNumberOfVariables(), getVariables(), and removeVariables().

CCopasiArray CSensProblem::mResult
private

This holds the result

Definition at line 206 of file CSensProblem.h.

Referenced by getResult(), and initObjects().

CCopasiArray CSensProblem::mScaledResult
private

This holds the scaled result

Definition at line 213 of file CSensProblem.h.

Referenced by getScaledResult(), and initObjects().

const std::string CSensProblem::SubTaskName
static
Initial value:
=
{
"Evaluation",
"Steady State",
"Time Series",
"Parameter Estimation",
"Optimization",
"Cross Section",
""
}

Definition at line 82 of file CSensProblem.h.

Referenced by SensitivitiesWidget::initCombos(), and operator<<().

const char * CSensProblem::XMLSubTask
static
Initial value:
=
{
"Evaluation",
"SteadyState",
"TimeSeries",
"ParameterEstimation",
"Optimization",
"CrossSection",
NULL
}

Definition at line 84 of file CSensProblem.h.


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