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

#include <CTrajectoryProblem.h>

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

Public Member Functions

 CTrajectoryProblem (const CCopasiContainer *pParent=NULL)
 
 CTrajectoryProblem (const CTrajectoryProblem &src, const CCopasiContainer *pParent=NULL)
 
virtual bool elevateChildren ()
 
const bool & getContinueSimultaneousEvents () const
 
const C_FLOAT64getDuration () const
 
const bool & getOutputEvent () const
 
const C_FLOAT64getOutputStartTime () const
 
const unsigned C_INT32getStepNumber () const
 
const C_FLOAT64getStepSize () const
 
void load (CReadConfig &configBuffer, CReadConfig::Mode mode=CReadConfig::NEXT)
 
void setContinueSimultaneousEvents (const bool &continueSimultaneousEvents)
 
void setDuration (const C_FLOAT64 &duration)
 
void setOutputEvent (const bool &outputEvent)
 
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
 
 ~CTrajectoryProblem ()
 
- 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 void printResult (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 ()
 

Protected Attributes

bool * mpContinueSimultaneousEvents
 
C_FLOAT64mpDuration
 
bool * mpOutputEvent
 
C_FLOAT64mpOutputStartTime
 
unsigned C_INT32mpStepNumber
 
C_FLOAT64mpStepSize
 
bool * mpTimeSeriesRequested
 
bool mStepNumberSetLast
 
- 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
 

Private Member Functions

void initializeParameter ()
 
void initObjects ()
 
bool sync ()
 

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)
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

CTrajectoryProblem class. This class describes the trajectory problem, i.e., it allows to specify for example initial conditions and number of steps.

Created for Copasi by Stefan Hoops 2002

Definition at line 31 of file CTrajectoryProblem.h.

Constructor & Destructor Documentation

CTrajectoryProblem::CTrajectoryProblem ( const CCopasiContainer pParent = NULL)

Default constructor.

Parameters
constCCopasiContainer * pParent (default: NULL)

CTrajectoryProblem class. This class describes the trajectory problem, i.e., it allows to specify for example initial conditions and number of steps.

Created for COPASI by Stefan Hoops 2002 Default constructor.

Definition at line 37 of file CTrajectoryProblem.cpp.

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

37  :
39  mpDuration(NULL),
40  mpStepSize(NULL),
41  mpStepNumber(NULL),
43  mpOutputStartTime(NULL),
44  mpOutputEvent(NULL),
46  mStepNumberSetLast(true)
47 {
49  initObjects();
51 }
unsigned C_INT32 * mpStepNumber
C_FLOAT64 * mpOutputStartTime
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CTrajectoryProblem::CTrajectoryProblem ( const CTrajectoryProblem src,
const CCopasiContainer pParent = NULL 
)

Copy constructor.

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

Copy constructor.

Parameters
const CTrajectoryProblem &src

Definition at line 57 of file CTrajectoryProblem.cpp.

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

58  :
59  CCopasiProblem(src, pParent),
60  mpDuration(NULL),
61  mpStepSize(NULL),
62  mpStepNumber(NULL),
64  mpOutputStartTime(NULL),
65  mpOutputEvent(NULL),
68 {
70  initObjects();
72 }
unsigned C_INT32 * mpStepNumber
C_FLOAT64 * mpOutputStartTime
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CTrajectoryProblem::~CTrajectoryProblem ( )

Destructor.

Definition at line 77 of file CTrajectoryProblem.cpp.

References DESTRUCTOR_TRACE.

#define DESTRUCTOR_TRACE
Definition: copasi.h:206

Member Function Documentation

bool CTrajectoryProblem::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 CTrajectoryProblem.cpp.

References C_FLOAT64, mpDuration, mpStepNumber, mpStepSize, 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  return true;
106 }
void setDuration(const C_FLOAT64 &duration)
unsigned C_INT32 * mpStepNumber
#define C_FLOAT64
Definition: copasi.h:92
const bool & CTrajectoryProblem::getContinueSimultaneousEvents ( ) const

Retrieve whether to continue on simultaneous events.

Returns
const bool & continueSimultaneousEvents

Definition at line 210 of file CTrajectoryProblem.cpp.

References mpContinueSimultaneousEvents.

Referenced by CTrajectoryTask::initialize(), CQTrajectoryWidget::loadTask(), and CQTrajectoryWidget::saveTask().

211 {
213 }
const C_FLOAT64 & CTrajectoryProblem::getDuration ( ) const
const bool & CTrajectoryProblem::getOutputEvent ( ) const

Retrieve whether to do additional output for events.

Definition at line 202 of file CTrajectoryProblem.cpp.

References mpOutputEvent.

Referenced by CQTrajectoryWidget::loadTask(), CTrajectoryTask::processStep(), and CQTrajectoryWidget::saveTask().

203 {return *mpOutputEvent;}
const C_FLOAT64 & CTrajectoryProblem::getOutputStartTime ( ) const
const unsigned C_INT32 & CTrajectoryProblem::getStepNumber ( ) const

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

Returns
"const unsigned C_INT32 &" stepNumber

Definition at line 138 of file CTrajectoryProblem.cpp.

References mpStepNumber.

Referenced by CSEDMLExporter::createTimeCourseTask(), CTrajectoryTask::initialize(), CQTrajectoryWidget::loadTask(), CQTrajectoryWidget::saveTask(), CQTrajectoryWidget::slotDuration(), and CQTrajectoryWidget::slotIntervalSize().

139 {return *mpStepNumber;}
unsigned C_INT32 * mpStepNumber
const C_FLOAT64 & CTrajectoryProblem::getStepSize ( ) const
void CTrajectoryProblem::initializeParameter ( )
private

Initialize the method parameter

Definition at line 80 of file CTrajectoryProblem.cpp.

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

Referenced by CTrajectoryProblem().

81 {
82  mpStepNumber =
83  assertParameter("StepNumber", CCopasiParameter::UINT, (unsigned C_INT32) 100)->getValue().pUINT;
84  mpStepSize =
86  mpDuration =
89  assertParameter("TimeSeriesRequested", CCopasiParameter::BOOL, (bool) true)->getValue().pBOOL;
93  assertParameter("Output Event", CCopasiParameter::BOOL, (bool) false)->getValue().pBOOL;
95  assertParameter("Continue on Simultaneous Events", CCopasiParameter::BOOL, (bool) false)->getValue().pBOOL;
96 }
#define C_INT32
Definition: copasi.h:90
unsigned C_INT32 * mpStepNumber
const Value & getValue() const
unsigned C_INT32 * pUINT
C_FLOAT64 * mpOutputStartTime
#define C_FLOAT64
Definition: copasi.h:92
CCopasiParameter * assertParameter(const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue)
void CTrajectoryProblem::initObjects ( )
private

Definition at line 108 of file CTrajectoryProblem.cpp.

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

Referenced by CTrajectoryProblem().

109 {
110  getParameter("StepNumber")->getValueReference()
111  ->setUpdateMethod(this,
113 
114  getParameter("StepSize")->getValueReference()
116 
117  getParameter("Duration")->getValueReference()
119 }
CCopasiObject * getValueReference() const
void setDuration(const C_FLOAT64 &duration)
#define C_INT32
Definition: copasi.h:90
void setUpdateMethod(CType *pType, void(CType::*method)(const C_FLOAT64 &))
void setStepSize(const C_FLOAT64 &stepSize)
void setStepNumber(const unsigned C_INT32 &stepNumber)
CCopasiParameter * getParameter(const std::string &name)
void CTrajectoryProblem::load ( CReadConfig configBuffer,
CReadConfig::Mode  mode = CReadConfig::NEXT 
)

Load a trajectory problem

Parameters
CReadConfig &configBuffer
"CReadConfig::Modemode (Default: CReadConfig::NEXT)

Load a trajectory problem

Parameters
CReadConfig &configBuffer

Definition at line 219 of file CTrajectoryProblem.cpp.

References CCopasiDataModel::getModel(), CCopasiObject::getObjectDataModel(), CReadConfig::getVariable(), CReadConfig::getVersion(), CReadConfig::LOOP, mpDuration, CCopasiProblem::mpModel, mpStepNumber, mStepNumberSetLast, and sync().

221 {
222  if (configBuffer.getVersion() < "4.0")
223  {
224  CCopasiDataModel* pDataModel = getObjectDataModel();
225  assert(pDataModel != NULL);
226  mpModel = pDataModel->getModel();
227  configBuffer.getVariable("EndTime", "C_FLOAT64",
228  mpDuration,
230  configBuffer.getVariable("Points", "C_INT32",
231  mpStepNumber);
232  mStepNumberSetLast = true;
233 
234  sync();
235  }
236 }
CCopasiDataModel * getObjectDataModel()
std::string getVersion()
Definition: CReadConfig.cpp:76
unsigned C_INT32 * mpStepNumber
C_INT32 getVariable(const std::string &name, const std::string &type, void *pout, CReadConfig::Mode mode=CReadConfig::NEXT)
Definition: CReadConfig.cpp:81
CModel * mpModel
void CTrajectoryProblem::setContinueSimultaneousEvents ( const bool &  continueSimultaneousEvents)

Set whether to continue on simultaneous events

Parameters
constbool & continueSimultaneousEvents

Definition at line 205 of file CTrajectoryProblem.cpp.

References mpContinueSimultaneousEvents.

Referenced by CQTrajectoryWidget::saveTask(), and SEDMLImporter::updateCopasiTaskForSimulation().

206 {
207  *mpContinueSimultaneousEvents = continueSimultaneousEvents;
208 }
void CTrajectoryProblem::setDuration ( const C_FLOAT64 duration)

Set the end time.

Parameters
const C_FLOAT64 &duration bool success

Definition at line 166 of file CTrajectoryProblem.cpp.

References mpDuration, and sync().

Referenced by CNewtonMethod::doIntegration(), elevateChildren(), initObjects(), CQTrajectoryWidget::saveTask(), CQTrajectoryWidget::slotDuration(), test000087::test_simulate_reaction_flux_reference_1(), and SEDMLImporter::updateCopasiTaskForSimulation().

167 {
168  *mpDuration = duration;
169  sync();
170 
171  return;
172 }
void CTrajectoryProblem::setOutputEvent ( const bool &  outputEvent)

Set whether to output events in addition to the normal steps

Parameters
constbool & outputEvent

Definition at line 197 of file CTrajectoryProblem.cpp.

References mpOutputEvent.

Referenced by CQTrajectoryWidget::saveTask().

198 {
199  *mpOutputEvent = outputEvent;
200 }
void CTrajectoryProblem::setOutputStartTime ( const C_FLOAT64 endTime)
void CTrajectoryProblem::setStepNumber ( const unsigned C_INT32 stepNumber)

Set the number of time steps the trajectory 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 125 of file CTrajectoryProblem.cpp.

References mpStepNumber, mStepNumberSetLast, and sync().

Referenced by CNewtonMethod::doIntegration(), CNewtonMethod::initialize(), initObjects(), CQTrajectoryWidget::saveTask(), CQTrajectoryWidget::slotIntervals(), test000087::test_simulate_reaction_flux_reference_1(), and SEDMLImporter::updateCopasiTaskForSimulation().

126 {
127  *mpStepNumber = stepNumber;
128  mStepNumberSetLast = true;
129  sync();
130 
131  return;
132 }
unsigned C_INT32 * mpStepNumber
void CTrajectoryProblem::setStepSize ( const C_FLOAT64 stepSize)

Set the size a integration step the trajectory 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 145 of file CTrajectoryProblem.cpp.

References mpStepSize, mStepNumberSetLast, and sync().

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

146 {
147  *mpStepSize = stepSize;
148  mStepNumberSetLast = false;
149  sync();
150 
151  return;
152 }
void CTrajectoryProblem::setTimeSeriesRequested ( bool  flag)

Definition at line 189 of file CTrajectoryProblem.cpp.

References mpTimeSeriesRequested.

Referenced by CQTrajectoryWidget::saveTask(), and test000087::test_simulate_reaction_flux_reference_1().

190 {
192 }
long int flag
Definition: f2c.h:52
bool CTrajectoryProblem::sync ( )
private

This function synchronizes step size and number

Returns
bool success

This function synchronizes step size and number

Definition at line 241 of file CTrajectoryProblem.cpp.

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

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

242 {
243  bool success = true;
244 
246  return success;
247 
248  C_FLOAT64 Tmp = *mpDuration;
249  C_FLOAT64 StepSize = *mpStepSize;
250  C_FLOAT64 StepNumber = (C_FLOAT64) * mpStepNumber;
251 
252  if (mStepNumberSetLast)
253  {
254  StepSize = Tmp / (C_FLOAT64) * mpStepNumber;
255 
256  /* Assure that the step size is not to small for machine accuracy */
257  if (fabs(StepSize) < 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() * fabs(*mpDuration))
258  {
260  MCTrajectoryProblem + 3, StepSize);
261 
262  StepSize = 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() * fabs(*mpDuration);
263  /* Assure that the step size has the appropriate sign. */
264  StepSize = (Tmp < 0.0) ? - fabs(StepSize) : fabs(StepSize);
265  StepNumber = fabs(ceil(Tmp / StepSize));
266  }
267  }
268  else
269  {
270  if (fabs(StepSize) < 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() * fabs(*mpDuration))
271  {
273  MCTrajectoryProblem + 3, StepSize);
274 
275  StepSize = 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() * fabs(*mpDuration);
276 
277  /* Assure that the step size has the appropriate sign. */
278  StepSize = (Tmp < 0.0) ? - fabs(StepSize) : fabs(StepSize);
279  }
280 
281  StepNumber = fabs(ceil(Tmp / StepSize));
282 
283  /* Protect against overflow */
284  if ((C_FLOAT64) ULONG_MAX < StepNumber)
285  {
287  MCTrajectoryProblem + 2, StepNumber);
288 
289  StepNumber = (C_FLOAT64) ULONG_MAX;
290  StepSize = Tmp / StepNumber;
291  }
292 
293  /* Assure that the step size has the appropriate sign. */
294  StepSize = (Tmp < 0.0) ? - fabs(StepSize) : fabs(StepSize);
295  }
296 
297  *mpStepSize = StepSize;
298  *mpStepNumber = (unsigned C_INT32) StepNumber;
299 
300  return success;
301 }
#define C_INT32
Definition: copasi.h:90
unsigned C_INT32 * mpStepNumber
#define MCTrajectoryProblem
#define C_FLOAT64
Definition: copasi.h:92
#define min(a, b)
Definition: f2c.h:175
bool CTrajectoryProblem::timeSeriesRequested ( ) const

Member Data Documentation

bool* CTrajectoryProblem::mpContinueSimultaneousEvents
protected

Pointer to parameter value indicating whether to continue when simultaneous events are encountered

Definition at line 206 of file CTrajectoryProblem.h.

Referenced by getContinueSimultaneousEvents(), initializeParameter(), and setContinueSimultaneousEvents().

C_FLOAT64* CTrajectoryProblem::mpDuration
protected
bool* CTrajectoryProblem::mpOutputEvent
protected

Pointer to parameter value indicating whether events should be added to the output

Definition at line 200 of file CTrajectoryProblem.h.

Referenced by getOutputEvent(), initializeParameter(), and setOutputEvent().

C_FLOAT64* CTrajectoryProblem::mpOutputStartTime
protected

Pointer to parameter value for output start time

Definition at line 194 of file CTrajectoryProblem.h.

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

unsigned C_INT32* CTrajectoryProblem::mpStepNumber
protected

Pointer to parameter value for step number

Definition at line 183 of file CTrajectoryProblem.h.

Referenced by elevateChildren(), getStepNumber(), initializeParameter(), load(), setStepNumber(), and sync().

C_FLOAT64* CTrajectoryProblem::mpStepSize
protected

Pointer to parameter value for step size.

Definition at line 178 of file CTrajectoryProblem.h.

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

bool* CTrajectoryProblem::mpTimeSeriesRequested
protected

Pointer to parameter value indicating whether a time series needs to be stored in memory

Definition at line 189 of file CTrajectoryProblem.h.

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

bool CTrajectoryProblem::mStepNumberSetLast
protected

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

Definition at line 211 of file CTrajectoryProblem.h.

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


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