roadrunner  2.6.0
Fast simulator for SBML models
NewtonIteration.h
1 //
2 // Created by Ciaran on 26/02/2021.
3 //
4 
5 #ifndef ROADRUNNER_NEWTONITERATION_H
6 #define ROADRUNNER_NEWTONITERATION_H
7 
8 #include "KinsolSteadyStateSolver.h"
9 #include <kinsol/kinsol.h> /* access to KINSOL func., consts. */
10 #include <nvector/nvector_serial.h> /* access to serial N_Vector */
11 #include <sundials/sundials_types.h> /* defs. of realtype, sunindextype */
12 
13 namespace rr {
14 
19  class RR_DECLSPEC NewtonIteration : public KinsolSteadyStateSolver {
20 
21  public:
22 
24 
25  ~NewtonIteration() override ;
26 
27  explicit NewtonIteration(ExecutableModel *executableModel);
28 
32  std::string getName() const override;
33 
37  std::string getDescription() const override;
38 
42  std::string getHint() const override;
43 
47  void resetSettings() override;
48 
49  void getSolverStatsFromKinsol() override;
50 
51  protected:
55  double solveNewtonIteration(const std::string& strategy);
56 
57  void createKinsol() override;
58 
59  void freeKinsol() override;
60 
61  void updateKinsol() override;
62 
66  SUNMatrix jac = nullptr;
67 
71  SUNLinearSolver linearSolver = nullptr;
72  };
73 
74 
75 }
76 
77 
78 #endif //ROADRUNNER_NEWTONITERATION_H
Base class for all code generation systems; allows compiling and evaluating the model.
Definition: rrExecutableModel.h:118
base class to steady state solvers from the Sundials package.
Definition: KinsolSteadyStateSolver.h:44
KinsolSteadyStateSolver()=default
The default constructor for constructing without a model.
Implementation of the newton iteration form of the kinsol steady state solver.
Definition: NewtonIteration.h:19