roadrunner  2.6.0
Fast simulator for SBML models
rrNLEQ1Interface.h
1 #ifndef rrNLEQ1InterfaceH
2 #define rrNLEQ1InterfaceH
3 #include <vector>
4 #include "rrExporter.h"
5 #include "rrExecutableModel.h"
6 #include "Dictionary.h"
7 
8 
9 using std::vector;
10 
11 namespace rr
12 {
13 
17 class RR_DECLSPEC NLEQ1Interface : public Dictionary
18 {
19 
20 public:
24  NLEQ1Interface(ExecutableModel *_model = NULL);
25 
26  ~NLEQ1Interface();
27 
33  double solve();
34 
35 
39 public:
40 
44  virtual void setItem(const std::string& key, const rr::Setting& value);
45 
49  virtual Setting getItem(const std::string& key) const;
50 
54  virtual bool hasKey(const std::string& key) const;
55 
59  virtual size_t deleteItem(const std::string& key);
60 
64  virtual std::vector<std::string> getKeys() const;
65 
69  static const Dictionary* getSteadyStateOptions();
70 
71 
72 private:
73  int nOpts;
74  long *IWK;
75  long LIWK;
76  long LRWK;
77  double *RWK;
78  double *XScal;
79  long ierr;
80  long *iopt;
81  ExecutableModel *model; // Model generated from the SBML. Static so we can access it from standalone function
82  long n;
83  void setup();
84 
85  bool isAvailable();
86 
87 public:
88  bool allowPreSim;
89  double preSimTolerance;
90  int preSimMaximumSteps;
91  double preSimTime;
92  bool allowApprox;
93  double approxTolerance;
94  int approxMaximumSteps;
95  double approxTime;
96  double relativeTolerance;
97  int maxIterations;
98  double minDamping;
99  int broyden;
100  int linearity;
101 
106  void setScalingFactors(const std::vector<double>& sx);
107 
112  int getNumberOfNewtonIterations();
113 
118  int getNumberOfCorrectorSteps();
119 
124  int getNumberOfModelEvaluations();
125 
130  int getNumberOfJacobianEvaluations();
131 
136  int getNumberOfModelEvaluationsForJacobian();
137 
138 
139  double computeSumsOfSquares();
140 
141  friend class NLEQ1Solver;
142 
143 };
145 }
146 
147 #endif
Store a roadrunner option (or setting) as a Variant type.
Definition: Setting.h:78
Base class for all code generators in RoadRunner.