roadrunner  2.6.0
Fast simulator for SBML models
Public Member Functions | List of all members
rr::BasicNewtonIteration Class Reference

Solve for steady state using Kinsol's implementation of Newton Iteration. More...

#include <BasicNewtonIteration.h>

Inheritance diagram for rr::BasicNewtonIteration:
rr::NewtonIteration rr::KinsolSteadyStateSolver rr::SteadyStateSolver rr::Solver rr::Registrable

Public Member Functions

 BasicNewtonIteration (ExecutableModel *executableModel)
 
std::string getName () const override
 Get the name of this solver.
 
std::string getDescription () const override
 Get the description of this solver.
 
std::string getHint () const override
 Get a (user-readable) hint for this solver.
 
Solverconstruct (ExecutableModel *model) const override
 construct a new BasicNewtonIterator More...
 
double solve () override
 solve the currently defined problem
 
 NewtonIteration (ExecutableModel *executableModel)
 
- Public Member Functions inherited from rr::NewtonIteration
 NewtonIteration (ExecutableModel *executableModel)
 
std::string getName () const override
 Get the name of this solver.
 
std::string getDescription () const override
 Get the description of this solver.
 
std::string getHint () const override
 Get a (user-readable) hint for this solver.
 
void resetSettings () override
 reset settings back to default.
 
void getSolverStatsFromKinsol () override
 after solve() has been called, this method collects some details such as number of function evals
 
 KinsolSteadyStateSolver (ExecutableModel *executableModel)
 constructor for creating KinsolSteadyStateSolver from an executable model only. More...
 
 KinsolSteadyStateSolver ()=default
 The default constructor for constructing without a model. More...
 
- Public Member Functions inherited from rr::KinsolSteadyStateSolver
 KinsolSteadyStateSolver (ExecutableModel *executableModel)
 constructor for creating KinsolSteadyStateSolver from an executable model only. More...
 
 KinsolSteadyStateSolver ()=default
 The default constructor for constructing without a model. More...
 
 ~KinsolSteadyStateSolver () override=default
 virtual destructor
 
void syncWithModel (ExecutableModel *m) override
 implementation of Solver::syncWithModel. More...
 
void setFScale (double value)
 set all elements of the fscale variable to More...
 
void setFScale (const std::vector< double > &value)
 set elements of the fscale variable to More...
 
void setUScale (double value)
 set all elements of the uscale variable to More...
 
void setUScale (std::vector< double > value)
 set elements of the uscale variable to value. More...
 
double solveForSteadyState (KinsolSteadyStateSolver *solverInstance, int kinsolStrategy)
 Generic solver method. More...
 
void * getKinsolMemory () const
 getter for the underlying memory block that is used by kinsol. More...
 
std::unordered_map< std::string, Setting > & getSolverStats ()
 return a mapping containing solver statistics. More...
 
void printSolverStats ()
 display solver stats to console
 
- Public Member Functions inherited from rr::SteadyStateSolver
virtual void loadConfigSettings ()
 
std::string toString () const override
 Return a std::string representation of the solver. More...
 
std::string toRepr () const override
 Return std::string representation a la Python repr method. More...
 
void resetSettings () override
 Implements settings shared by all steady state solvers.
 
 Solver ()=default
 
 Solver (ExecutableModel *model)
 
- Public Member Functions inherited from rr::Solver
 Solver (ExecutableModel *model)
 
void updateSettings (Dictionary *inputSettings)
 Update settings values. More...
 
std::vector< std::string > getSettings () const
 Get a list of all settings for this solver. More...
 
std::unordered_map< std::string, Setting > & getSettingsMap ()
 get settings for this solver More...
 
virtual Setting getValue (const std::string &key) const
 Get the value of an integrator setting. More...
 
virtual Setting hasValue (const std::string &key) const
 Return true if this setting is supported by the integrator. More...
 
virtual size_t getNumParams () const
 Get the number of parameters. More...
 
virtual std::string getParamName (size_t n) const
 Get the name of the parameter at index n. More...
 
virtual std::string getParamDisplayName (int n) const
 Get the display name of the parameter at index n. More...
 
virtual std::string getParamHint (int n) const
 Get the hint of the parameter at index n. More...
 
virtual std::string getParamDesc (int n) const
 Get the description of the parameter at index n. More...
 
virtual std::string getValueAsString (const std::string &key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual void setValue (const std::string &key, Setting value)
 
virtual std::string getSettingsRepr () const
 Get the solver settings as a std::string. More...
 
virtual std::string settingsPyDictRepr () const
 Python dictionary-style std::string representation of settings. More...
 
const std::string & getDisplayName (const std::string &key) const
 Gets the hint associated with a given key. More...
 
const std::string & getHint (const std::string &key) const
 Gets the hint associated with a given key. More...
 
const std::string & getDescription (const std::string &key) const
 Gets the description associated with a given key. More...
 
Setting::TypeId getType (const std::string &key) const
 Gets the type associated with a given key. More...
 
virtual ExecutableModelgetModel () const
 returns the pointer to the ExecutableModel
 
virtual std::string getName () const=0
 Gets the name associated with this Solver type. More...
 
virtual std::string getHint () const=0
 Gets the hint associated with this Solver type. More...
 
virtual std::string getDescription () const=0
 Gets the description associated with this Solver type. More...
 

Additional Inherited Members

- Public Types inherited from rr::Solver
using SettingsList = std::vector< std::string >
 
using SettingsMap = std::unordered_map< std::string, Setting >
 
using DisplayNameMap = std::unordered_map< std::string, std::string >
 
using HintMap = std::unordered_map< std::string, std::string >
 
using DescriptionMap = std::unordered_map< std::string, std::string >
 
- Static Public Member Functions inherited from rr::KinsolSteadyStateSolver
template<class KinsolSteadyStateSolverType >
static int kinsolDyDtFcn (N_Vector stateVecIn, N_Vector stateVecOut, void *userData)
 kinsol callback function that implements system equations More...
 
- Public Attributes inherited from rr::Solver
SettingsList sorted_settings
 
SettingsMap settings
 
DisplayNameMap display_names_
 
HintMap hints
 
DescriptionMap descriptions
 
- Protected Member Functions inherited from rr::NewtonIteration
double solveNewtonIteration (const std::string &strategy)
 solve the currently defined problem
 
void createKinsol () override
 Initialize kinsol objects. More...
 
void freeKinsol () override
 Destory kinsol objects. More...
 
void updateKinsol () override
 Calls methods for updating options in kinsol. More...
 
- Protected Member Functions inherited from rr::Solver
void addSetting (const std::string &name, const Setting &val, const std::string &display_name, const std::string &hint, const std::string &description)
 
- Protected Attributes inherited from rr::NewtonIteration
SUNMatrix jac = nullptr
 matrix for jacobian
 
SUNLinearSolver linearSolver = nullptr
 linear solver for newton methods
 
- Protected Attributes inherited from rr::KinsolSteadyStateSolver
void * mKinsol_Memory = nullptr
 Pointer to the kinsol memory block.
 
N_Vector mStateVector = nullptr
 a sundials N_Vector for storing system state variables
 
N_Vector fscale = nullptr
 std::vector containing diagonal elements of scaling matrix DF for F(u) chosen so that the components of D_F*F(u) (as a matrix multiplication) all have roughly the same magnitude when u is not too near a root of F(u). More...
 
N_Vector uscale = nullptr
 std::vector containing diagonal elements of scaling matrix Du for std::vector u chosen so that the components of D_u*u (as a matrix multiplication) all have roughly the same magnitude when u is close to a root of F(u). More...
 
N_Vector constraints = nullptr
 vector of constraints used to ensure positive solution. More...
 
long int numFuncEvals
 kinsol output variables. More...
 
long int numNolinSolvIters
 
long int numBetaCondFails
 
long int numBacktrackOps
 
double funcNorm
 
double stepLength
 
long int numJacEvals
 
long int numJtimesEvals
 
long int numLinConvFails
 
long int numLinFuncEvals
 
long int numLinIters
 
long int numNonlinSolvIters
 
long int numPrecEvals
 
long int numPrecSolves
 
long int nSolverIterations = 0
 stores the number of iterations required by the solver to converge. More...
 
std::unordered_map< std::string, SettingsolverStats
 
- Protected Attributes inherited from rr::Solver
ExecutableModelmModel = nullptr
 non-owning pointer to model
 

Detailed Description

Solve for steady state using Kinsol's implementation of Newton Iteration.

The kinsol docs refer to this algorithm as the "basic" newton iteration to differentiate it from the "linesearch" strategy which is a variant of the "basic" newton iteration.

See also
LinesearchNewtonIteration

Member Function Documentation

◆ construct()

Solver * rr::BasicNewtonIteration::construct ( ExecutableModel model) const
overridevirtual

construct a new BasicNewtonIterator

caller is responsible for deleting memory returned.

Implements rr::Registrable.


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