roadrunner  2.6.0
Fast simulator for SBML models
RK45Integrator.h
Go to the documentation of this file.
1 // == PREAMBLE ================================================
2 
3 // * Licensed under the Apache License, Version 2.0; see README
4 
5 // == FILEDOC =================================================
6 
14 #ifndef RK45Integrator_H_
15 #define RK45Integrator_H_
16 
17 #include <Integrator.h>
18 #include <rrRoadRunnerOptions.h>
19 #include "Registrable.h"
20 
21 namespace rr
22 {
23 
24 
31  class RK45Integrator: public Integrator
32  {
33  public:
34 
35  using Integrator::Integrator;
36 
42 
47  virtual ~RK45Integrator();
48 
54  virtual void syncWithModel(ExecutableModel* m);
55 
56 
60  public:
61 
73  virtual double integrate(double t, double h);
74 
78  virtual void restart(double t0);
79 
80  // ** Meta Info ********************************************************
81 
87  std::string getName() const;
88 
93  static std::string getRK45Name();
94 
100  std::string getDescription() const;
101 
106  static std::string getRK45Description();
107 
113  std::string getHint() const;
114 
119  static std::string getRK45Hint();
120 
121  Solver* construct(ExecutableModel* executableModel) const;
122 
123  // ** Getters / Setters ************************************************
124 
125  virtual Setting getValue(std::string key);
126 
131  IntegrationMethod getIntegrationMethod() const;
132 
137  void resetSettings();
138 
139  // ** Listeners ********************************************************
140 
145  virtual void setListener(IntegratorListenerPtr);
146 
150  virtual IntegratorListenerPtr getListener();
151 
152 
153  private:
154 
155  unsigned stateVectorSize;
156 
160  double *k1, *k2, *k3, *k4, *y, *ytmp;
161 
162  // new scalars for RK45
163  double hCurrent, hmin, hmax;
164 
165  double *k5, *k6, *err;
166 
167  void testRootsAtInitialTime();
168  void applyEvents(double timeEnd, std::vector<unsigned char> &previousEventStatus);
169 
170  };
171 
172 } /* namespace rr */
173 
174 #endif /* RK45Integrator_H_ */
RoadRunner's Gillespie SSA integrator.
Base class for all code generation systems; allows compiling and evaluating the model.
Definition: rrExecutableModel.h:118
Integrator is an abstract base class that provides an interface to specific integrator class implemen...
Definition: Integrator.h:60
A Runge-Kutta Fehlberg method for roadrunner.
Definition: RK45Integrator.h:32
static std::string getRK45Hint()
Get the hint for this integrator.
Definition: RK45Integrator.cpp:298
static std::string getRK45Description()
Get the description for this integrator.
Definition: RK45Integrator.cpp:288
std::string getDescription() const
Get the description for this integrator.
Definition: RK45Integrator.cpp:284
RK45Integrator(ExecutableModel *m)
Constructor: takes an executable model, does not own the pointer.
Definition: RK45Integrator.cpp:22
void resetSettings()
Reset all integrator settings to their respective default values.
Definition: RK45Integrator.cpp:313
static std::string getRK45Name()
Get the name for this integrator.
Definition: RK45Integrator.cpp:280
virtual void setListener(IntegratorListenerPtr)
the integrator can hold a single listener.
Definition: RK45Integrator.cpp:269
virtual ~RK45Integrator()
Destructor.
Definition: RK45Integrator.cpp:68
virtual double integrate(double t, double h)
implement Integrator interface
Definition: RK45Integrator.cpp:83
virtual void restart(double t0)
Restarts the integrator.
Definition: RK45Integrator.cpp:248
virtual void syncWithModel(ExecutableModel *m)
Called whenever a new model is loaded to allow integrator to reset internal state.
Definition: RK45Integrator.cpp:32
IntegrationMethod getIntegrationMethod() const
Always deterministic for RK45.
Definition: RK45Integrator.cpp:309
std::string getHint() const
Get the hint for this integrator.
Definition: RK45Integrator.cpp:294
std::string getName() const
Get the name for this integrator.
Definition: RK45Integrator.cpp:276
virtual IntegratorListenerPtr getListener()
get the integrator listener
Definition: RK45Integrator.cpp:272
Solver * construct(ExecutableModel *executableModel) const
Constructs a new Solver of a given type.
Definition: RK45Integrator.cpp:333
Store a roadrunner option (or setting) as a Variant type.
Definition: Setting.h:78
Base class for all integrators and steady state solvers.
Definition: Solver.h:39