COPASI API  4.16.103
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CTSSAProblem Class Reference

#include <CTSSAProblem.h>

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

Public Member Functions

 CTSSAProblem (const CCopasiContainer *pParent=NULL)
 
 CTSSAProblem (const CTSSAProblem &src, const CCopasiContainer *pParent=NULL)
 
virtual bool elevateChildren ()
 
const C_FLOAT64getDuration () const
 
const C_FLOAT64getOutputStartTime () const
 
const unsigned C_INT32getStepNumber () const
 
const C_FLOAT64getStepSize () const
 
void setDuration (const C_FLOAT64 &duration)
 
void setOutputStartTime (const C_FLOAT64 &endTime)
 
void setStepNumber (const unsigned C_INT32 &stepNumber)
 
void setStepSize (const C_FLOAT64 &stepSize)
 
void setTimeSeriesRequested (bool flag)
 
bool timeSeriesRequested () const
 
 ~CTSSAProblem ()
 
- Public Member Functions inherited from CCopasiProblem
 CCopasiProblem (const CCopasiProblem &src, const CCopasiContainer *pParent=NULL)
 
CModelgetModel () const
 
const CCopasiTask::TypegetType () const
 
virtual bool initialize ()
 
virtual void print (std::ostream *ostream) const
 
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 ()
 
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 ()
 

Private Member Functions

void initializeParameter ()
 
void initObjects ()
 
void printResult (std::ostream *ostream) const
 
bool sync ()
 

Private Attributes

C_FLOAT64mpDuration
 
C_FLOAT64mpOutputStartTime
 
unsigned C_INT32mpStepNumber
 
C_FLOAT64mpStepSize
 
bool * mpTimeSeriesRequested
 
bool mStepNumberSetLast
 

Additional Inherited Members

- 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
 
- 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 inherited from CCopasiParameter
static const std::string TypeName []
 
static const char * XMLType []
 
- Static Public Attributes inherited from CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 
- 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

CTSSAProblem class. This class describes the time scale separation analysis problem, i.e., it allows to specify for example initial conditions and number of steps.

Definition at line 32 of file CTSSAProblem.h.

Constructor & Destructor Documentation

CTSSAProblem::CTSSAProblem ( const CCopasiContainer pParent = NULL)

Default constructor.

Parameters
constCCopasiContainer * pParent (default: NULL)

CTSSAProblem class. This class describes the time scale separation analysis problem, i.e., it allows to specify for example initial conditions and number of steps. Default constructor.

Definition at line 45 of file CTSSAProblem.cpp.

References CONSTRUCTOR_TRACE, initializeParameter(), and initObjects().

45  :
47  mpDuration(NULL),
48  mpStepSize(NULL),
49  mpStepNumber(NULL),
51  mpOutputStartTime(NULL),
52  mStepNumberSetLast(true)
53 {
55  initObjects();
57 }
unsigned C_INT32 * mpStepNumber
Definition: CTSSAProblem.h:49
void initObjects()
C_FLOAT64 * mpStepSize
Definition: CTSSAProblem.h:44
C_FLOAT64 * mpOutputStartTime
Definition: CTSSAProblem.h:59
void initializeParameter()
bool * mpTimeSeriesRequested
Definition: CTSSAProblem.h:54
C_FLOAT64 * mpDuration
Definition: CTSSAProblem.h:39
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
bool mStepNumberSetLast
Definition: CTSSAProblem.h:64
CTSSAProblem::CTSSAProblem ( const CTSSAProblem src,
const CCopasiContainer pParent = NULL 
)

Copy constructor.

Parameters
constCTSSAProblem & src CCopasiContainer * pParent (default: NULL)

Copy constructor.

Parameters
const CTSSAProblem &src

Definition at line 63 of file CTSSAProblem.cpp.

References CONSTRUCTOR_TRACE, initializeParameter(), and initObjects().

64  :
65  CCopasiProblem(src, pParent),
66  mpDuration(NULL),
67  mpStepSize(NULL),
68  mpStepNumber(NULL),
70  mpOutputStartTime(NULL),
72 {
74  initObjects();
76 }
unsigned C_INT32 * mpStepNumber
Definition: CTSSAProblem.h:49
void initObjects()
C_FLOAT64 * mpStepSize
Definition: CTSSAProblem.h:44
C_FLOAT64 * mpOutputStartTime
Definition: CTSSAProblem.h:59
void initializeParameter()
bool * mpTimeSeriesRequested
Definition: CTSSAProblem.h:54
C_FLOAT64 * mpDuration
Definition: CTSSAProblem.h:39
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
bool mStepNumberSetLast
Definition: CTSSAProblem.h:64
CTSSAProblem::~CTSSAProblem ( )

Destructor.

Definition at line 81 of file CTSSAProblem.cpp.

References DESTRUCTOR_TRACE.

#define DESTRUCTOR_TRACE
Definition: copasi.h:206

Member Function Documentation

bool CTSSAProblem::elevateChildren ( )
virtual

This methods must be called to elevate subgroups to derived objects. The default implementation does nothing.

Returns
bool success

Reimplemented from CCopasiParameterGroup.

Definition at line 98 of file CTSSAProblem.cpp.

References C_FLOAT64, mpDuration, mpStepNumber, mpStepSize, CCopasiParameterGroup::removeParameter(), and setDuration().

99 {
100  // If we have an old COPASI file "Duration" is not set
101  // but we can fix that.
102  if (*mpDuration == 1.0) // the default
104 
105  removeParameter("Deuflhard Tolerance");
106 
107  return true;
108 }
unsigned C_INT32 * mpStepNumber
Definition: CTSSAProblem.h:49
bool removeParameter(const std::string &name)
C_FLOAT64 * mpStepSize
Definition: CTSSAProblem.h:44
#define C_FLOAT64
Definition: copasi.h:92
void setDuration(const C_FLOAT64 &duration)
C_FLOAT64 * mpDuration
Definition: CTSSAProblem.h:39
const C_FLOAT64 & CTSSAProblem::getDuration ( ) const

Retrieve the end time.

Returns
"const C_FLOAT64 &" duration

Definition at line 180 of file CTSSAProblem.cpp.

References mpDuration.

Referenced by CQTSSAWidget::loadTask(), CTSSATask::process(), and CQTSSAWidget::saveTask().

181 {return *mpDuration;}
C_FLOAT64 * mpDuration
Definition: CTSSAProblem.h:39
const C_FLOAT64 & CTSSAProblem::getOutputStartTime ( ) const

Retrieve the end time.

Returns
"const C_FLOAT64 &" endTime

Definition at line 188 of file CTSSAProblem.cpp.

References mpOutputStartTime.

Referenced by CTSSATask::process().

189 {return *mpOutputStartTime;}
C_FLOAT64 * mpOutputStartTime
Definition: CTSSAProblem.h:59
const unsigned C_INT32 & CTSSAProblem::getStepNumber ( ) const

Retrieve the number of time steps the method should integrate.

Returns
"const unsigned C_INT32 &" stepNumber

Retrieve the number of time steps the trajectory method should integrate.

Returns
"const unsigned C_INT32 &" stepNumber

Definition at line 140 of file CTSSAProblem.cpp.

References mpStepNumber.

Referenced by CQTSSAResultSubWidget::displayResult(), CTSSATask::initialize(), CQTSSAWidget::loadTask(), CQTSSAWidget::saveTask(), CQTSSAWidget::slotDuration(), and CQTSSAWidget::slotIntervalSize().

141 {return *mpStepNumber;}
unsigned C_INT32 * mpStepNumber
Definition: CTSSAProblem.h:49
const C_FLOAT64 & CTSSAProblem::getStepSize ( ) const

Retrieve the size a integration step the method should do.

Returns
"const C_FLOAT64 &" stepSize

Retrieve the size a integration step the trajectory method should do.

Returns
"const C_FLOAT64 &" stepSize

Definition at line 160 of file CTSSAProblem.cpp.

References mpStepSize.

Referenced by CQTSSAWidget::loadTask(), CTSSATask::process(), CQTSSAWidget::saveTask(), CQTSSAWidget::slotDuration(), CQTSSAWidget::slotIntervals(), and CQTSSAWidget::slotIntervalSize().

161 {return *mpStepSize;}
C_FLOAT64 * mpStepSize
Definition: CTSSAProblem.h:44
void CTSSAProblem::initializeParameter ( )
private

Intialize the method parameter

Definition at line 84 of file CTSSAProblem.cpp.

References CCopasiParameterGroup::assertParameter(), CCopasiParameter::BOOL, C_FLOAT64, C_INT32, CCopasiParameter::DOUBLE, CCopasiParameter::getValue(), mpDuration, mpOutputStartTime, mpStepNumber, mpStepSize, mpTimeSeriesRequested, CCopasiParameter::Value::pBOOL, CCopasiParameter::Value::pDOUBLE, CCopasiParameter::Value::pUINT, and CCopasiParameter::UINT.

Referenced by CTSSAProblem().

85 {
86  mpStepNumber =
87  assertParameter("StepNumber", CCopasiParameter::UINT, (unsigned C_INT32) 100)->getValue().pUINT;
88  mpStepSize =
90  mpDuration =
93  assertParameter("TimeSeriesRequested", CCopasiParameter::BOOL, (bool) true)->getValue().pBOOL;
96 }
unsigned C_INT32 * mpStepNumber
Definition: CTSSAProblem.h:49
#define C_INT32
Definition: copasi.h:90
const Value & getValue() const
unsigned C_INT32 * pUINT
C_FLOAT64 * mpStepSize
Definition: CTSSAProblem.h:44
C_FLOAT64 * mpOutputStartTime
Definition: CTSSAProblem.h:59
#define C_FLOAT64
Definition: copasi.h:92
bool * mpTimeSeriesRequested
Definition: CTSSAProblem.h:54
CCopasiParameter * assertParameter(const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue)
C_FLOAT64 * mpDuration
Definition: CTSSAProblem.h:39
void CTSSAProblem::initObjects ( )
private

Definition at line 110 of file CTSSAProblem.cpp.

References C_INT32, CCopasiParameterGroup::getParameter(), CCopasiParameter::getValueReference(), setDuration(), setStepNumber(), setStepSize(), and CCopasiObject::setUpdateMethod().

Referenced by CTSSAProblem().

111 {
112  getParameter("StepNumber")->getValueReference()
113  ->setUpdateMethod(this,
114  (void (CTSSAProblem::*)(const C_INT32 &)) &CTSSAProblem::setStepNumber);
115 
116  getParameter("StepSize")->getValueReference()
118 
119  getParameter("Duration")->getValueReference()
121 }
void setStepNumber(const unsigned C_INT32 &stepNumber)
CCopasiObject * getValueReference() const
#define C_INT32
Definition: copasi.h:90
void setUpdateMethod(CType *pType, void(CType::*method)(const C_FLOAT64 &))
CCopasiParameter * getParameter(const std::string &name)
void setStepSize(const C_FLOAT64 &stepSize)
void setDuration(const C_FLOAT64 &duration)
void CTSSAProblem::printResult ( std::ostream *  ostream) const
privatevirtual

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

Parameters
std::ostream* ostream

Reimplemented from CCopasiProblem.

Definition at line 265 of file CTSSAProblem.cpp.

References CCopasiTask::getMethod(), CCopasiObject::getObjectDataModel(), CCopasiProblem::print(), and CCopasiMethod::printResult().

266 {
267  std::ostream & os = *ostream;
268 
269  const CCopasiDataModel* pDataModel = getObjectDataModel();
270  assert(pDataModel != NULL);
271  const CCopasiTask* mpTask =
272  dynamic_cast<const CTSSATask *>((*const_cast<CCopasiDataModel*>(pDataModel)->getTaskList())["Time Scale Separation Analysis"]);
273 
274  if (!mpTask) return;
275 
276  const CCopasiMethod* mpMethod = mpTask->getMethod();
277 
278  this->print(&os);
279 
280  mpMethod->printResult(&os);
281 }
CCopasiDataModel * getObjectDataModel()
virtual void printResult(std::ostream *ostream) const
virtual void print(std::ostream *ostream) const
CCopasiMethod * getMethod()
void CTSSAProblem::setDuration ( const C_FLOAT64 duration)

Set the end time.

Parameters
const C_FLOAT64 &duration bool success

Definition at line 168 of file CTSSAProblem.cpp.

References mpDuration, and sync().

Referenced by elevateChildren(), initObjects(), CQTSSAWidget::saveTask(), and CQTSSAWidget::slotDuration().

169 {
170  *mpDuration = duration;
171  sync();
172 
173  return;
174 }
C_FLOAT64 * mpDuration
Definition: CTSSAProblem.h:39
void CTSSAProblem::setOutputStartTime ( const C_FLOAT64 endTime)

Set the end time.

Parameters
const C_FLOAT64 &endTime

Definition at line 183 of file CTSSAProblem.cpp.

References mpOutputStartTime.

184 {
185  *mpOutputStartTime = startTime;
186 }
C_FLOAT64 * mpOutputStartTime
Definition: CTSSAProblem.h:59
void CTSSAProblem::setStepNumber ( const unsigned C_INT32 stepNumber)

Set the number of time steps the method should integrate.

Parameters
const unsigned C_INT32 &stepNumber bool success

Set the number of time steps the trajectory method should integrate.

Parameters
const unsigned C_INT32 &stepNumber

Definition at line 127 of file CTSSAProblem.cpp.

References mpStepNumber, mStepNumberSetLast, and sync().

Referenced by initObjects(), CQTSSAWidget::saveTask(), and CQTSSAWidget::slotIntervals().

128 {
129  *mpStepNumber = stepNumber;
130  mStepNumberSetLast = true;
131  sync();
132 
133  return;
134 }
unsigned C_INT32 * mpStepNumber
Definition: CTSSAProblem.h:49
bool mStepNumberSetLast
Definition: CTSSAProblem.h:64
void CTSSAProblem::setStepSize ( const C_FLOAT64 stepSize)

Set the size a integration step the method should do.

Parameters
const C_FLOAT64 &stepSize bool success

Set the size a integration step the trajectory method should do.

Parameters
const C_FLOAT64 &stepSize

Definition at line 147 of file CTSSAProblem.cpp.

References mpStepSize, mStepNumberSetLast, and sync().

Referenced by initObjects(), CQTSSAWidget::saveTask(), and CQTSSAWidget::slotIntervalSize().

148 {
149  *mpStepSize = stepSize;
150  mStepNumberSetLast = false;
151  sync();
152 
153  return;
154 }
C_FLOAT64 * mpStepSize
Definition: CTSSAProblem.h:44
bool mStepNumberSetLast
Definition: CTSSAProblem.h:64
void CTSSAProblem::setTimeSeriesRequested ( bool  flag)

Definition at line 191 of file CTSSAProblem.cpp.

References mpTimeSeriesRequested.

192 {
194 }
long int flag
Definition: f2c.h:52
bool * mpTimeSeriesRequested
Definition: CTSSAProblem.h:54
bool CTSSAProblem::sync ( )
private

This function synchronizes step size and number bool success

This function synchronizes step size and number

Definition at line 202 of file CTSSAProblem.cpp.

References C_FLOAT64, C_INT32, MCTSSAProblem, mpDuration, mpStepNumber, mpStepSize, mStepNumberSetLast, and CCopasiMessage::WARNING.

Referenced by setDuration(), setStepNumber(), and setStepSize().

203 {
204  bool success = true;
205 
206  C_FLOAT64 Tmp = *mpDuration;
207  C_FLOAT64 StepSize = *mpStepSize;
208  C_FLOAT64 StepNumber = (C_FLOAT64) * mpStepNumber;
209 
210  if (mStepNumberSetLast)
211  {
212  StepSize = Tmp / (C_FLOAT64) * mpStepNumber;
213 
214  /* Assure that the step size is not to small for machine accuracy */
215  if (fabs(StepSize) < 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() * fabs(*mpDuration))
216  {
218  MCTSSAProblem + 3, StepSize);
219 
220  StepSize = 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() * fabs(*mpDuration);
221  /* Assure that the step size has the appropriate sign. */
222  StepSize = (Tmp < 0.0) ? - fabs(StepSize) : fabs(StepSize);
223  StepNumber = fabs(ceil(Tmp / StepSize));
224  }
225  }
226  else
227  {
228  if (fabs(StepSize) < 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() * fabs(*mpDuration))
229  {
231  MCTSSAProblem + 3, StepSize);
232 
233  StepSize = 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() * fabs(*mpDuration);
234 
235  /* Assure that the step size has the appropriate sign. */
236  StepSize = (Tmp < 0.0) ? - fabs(StepSize) : fabs(StepSize);
237  }
238 
239  StepNumber = fabs(ceil(Tmp / StepSize));
240 
241  /* Protect against overflow */
242  if ((C_FLOAT64) ULONG_MAX < StepNumber)
243  {
245  MCTSSAProblem + 2, StepNumber);
246 
247  StepNumber = (C_FLOAT64) ULONG_MAX;
248  StepSize = Tmp / StepNumber;
249 
250  success = false;
251  }
252 
253  /* Assure that the step size has the appropriate sign. */
254  StepSize = (Tmp < 0.0) ? - fabs(StepSize) : fabs(StepSize);
255  }
256 
257  *mpStepSize = StepSize;
258  *mpStepNumber = (unsigned C_INT32) StepNumber;
259 
260  if (!success) throw 1;
261 
262  return success;
263 }
unsigned C_INT32 * mpStepNumber
Definition: CTSSAProblem.h:49
#define C_INT32
Definition: copasi.h:90
#define MCTSSAProblem
C_FLOAT64 * mpStepSize
Definition: CTSSAProblem.h:44
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 * mpDuration
Definition: CTSSAProblem.h:39
bool mStepNumberSetLast
Definition: CTSSAProblem.h:64
bool CTSSAProblem::timeSeriesRequested ( ) const

Definition at line 196 of file CTSSAProblem.cpp.

References mpTimeSeriesRequested.

Referenced by CTSSATask::initialize().

197 {return *mpTimeSeriesRequested;}
bool * mpTimeSeriesRequested
Definition: CTSSAProblem.h:54

Member Data Documentation

C_FLOAT64* CTSSAProblem::mpDuration
private

Definition at line 39 of file CTSSAProblem.h.

Referenced by elevateChildren(), getDuration(), initializeParameter(), setDuration(), and sync().

C_FLOAT64* CTSSAProblem::mpOutputStartTime
private

Definition at line 59 of file CTSSAProblem.h.

Referenced by getOutputStartTime(), initializeParameter(), and setOutputStartTime().

unsigned C_INT32* CTSSAProblem::mpStepNumber
private
C_FLOAT64* CTSSAProblem::mpStepSize
private

Definition at line 44 of file CTSSAProblem.h.

Referenced by elevateChildren(), getStepSize(), initializeParameter(), setStepSize(), and sync().

bool* CTSSAProblem::mpTimeSeriesRequested
private

Definition at line 54 of file CTSSAProblem.h.

Referenced by initializeParameter(), setTimeSeriesRequested(), and timeSeriesRequested().

bool CTSSAProblem::mStepNumberSetLast
private

Indicate whether the step number or step size was set last.

Definition at line 64 of file CTSSAProblem.h.

Referenced by setStepNumber(), setStepSize(), and sync().


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