C API Documentation
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
rr::Solver Class Referenceabstract

Base class for all integrators and steady state solvers. More...

#include <Solver.h>

Inheritance diagram for rr::Solver:
rr::Integrator rr::SteadyStateSolver rr::CVODEIntegrator rr::GillespieIntegrator rr::RK45Integrator rr::RK4Integrator rr::NLEQ1Solver rr::NLEQ2Solver

Public Member Functions

virtual std::string getName () const =0
 Get the name of this solver. More...
 
virtual std::string getDescription () const =0
 Get the description of this solver. More...
 
virtual std::string getHint () const =0
 Get a (user-readable) hint for this solver. More...
 
std::vector< std::string > getSettings () const
 Get a list of all settings for this solver. More...
 
virtual void resetSettings ()
 Reset all settings to their respective default values. More...
 
virtual Variant getValue (std::string key) const
 Get the value of an integrator setting. More...
 
virtual Variant hasValue (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 int getValueAsInt (std::string key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual unsigned int getValueAsUInt (std::string key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual long getValueAsLong (std::string key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual unsigned long getValueAsULong (std::string key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual float getValueAsFloat (std::string key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual double getValueAsDouble (std::string key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual std::vector< double > getValueAsDoubleVector (std::string key)
 Wrapper for getValue which converts output to a specific type.
 
virtual char getValueAsChar (std::string key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual unsigned char getValueAsUChar (std::string key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual std::string getValueAsString (std::string key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual bool getValueAsBool (std::string key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual void setValue (std::string key, const Variant &value)
 
const std::string & getDisplayName (std::string key) const
 Gets the hint associated with a given key. More...
 
const std::string & getHint (std::string key) const
 Gets the hint associated with a given key. More...
 
const std::string & getDescription (std::string key) const
 Gets the description associated with a given key. More...
 
const Variant::TypeId getType (std::string key)
 Gets the type associated with a given key. More...
 
std::string getSettingsRepr () const
 Get the solver settings as a string. More...
 
std::string settingsPyDictRepr () const
 Python dictionary-style string representation of settings. More...
 
virtual std::string toString () const
 Return a string representation of the solver. More...
 
virtual std::string toRepr () const
 Return string representation a la Python repr method. More...
 

Protected Types

typedef std::vector< std::string > SettingsList
 
typedef RR_UNORDERED_MAP< std::string, VariantSettingsMap
 
typedef RR_UNORDERED_MAP< std::string, std::string > DisplayNameMap
 
typedef RR_UNORDERED_MAP< std::string, std::string > HintMap
 
typedef RR_UNORDERED_MAP< std::string, std::string > DescriptionMap
 

Protected Member Functions

void addSetting (std::string name, Variant val, string display_name, std::string hint, std::string description)
 

Protected Attributes

SettingsList sorted_settings
 
SettingsMap settings
 
DisplayNameMap display_names_
 
HintMap hints
 
DescriptionMap descriptions
 

Detailed Description

Base class for all integrators and steady state solvers.

Author
JKM

Member Function Documentation

◆ getDescription() [1/2]

virtual std::string rr::Solver::getDescription ( ) const
pure virtual

Get the description of this solver.

Author
JKM

Implemented in rr::CVODEIntegrator, rr::RK4Integrator, rr::RK45Integrator, rr::NLEQ2Solver, rr::NLEQ1Solver, and rr::GillespieIntegrator.

◆ getDescription() [2/2]

const std::string& rr::Solver::getDescription ( std::string  key) const

Gets the description associated with a given key.

Author
WBC

◆ getDisplayName()

const std::string& rr::Solver::getDisplayName ( std::string  key) const

Gets the hint associated with a given key.

Author
WBC

◆ getHint() [1/2]

virtual std::string rr::Solver::getHint ( ) const
pure virtual

Get a (user-readable) hint for this solver.

Author
JKM

Implemented in rr::CVODEIntegrator, rr::RK4Integrator, rr::RK45Integrator, rr::NLEQ2Solver, rr::NLEQ1Solver, and rr::GillespieIntegrator.

◆ getHint() [2/2]

const std::string& rr::Solver::getHint ( std::string  key) const

Gets the hint associated with a given key.

Author
WBC

◆ getName()

virtual std::string rr::Solver::getName ( ) const
pure virtual

◆ getNumParams()

virtual size_t rr::Solver::getNumParams ( ) const
virtual

Get the number of parameters.

Author
JKM

◆ getParamDesc()

virtual std::string rr::Solver::getParamDesc ( int  n) const
virtual

Get the description of the parameter at index n.

Author
JKM

◆ getParamDisplayName()

virtual std::string rr::Solver::getParamDisplayName ( int  n) const
virtual

Get the display name of the parameter at index n.

Author
JKM

◆ getParamHint()

virtual std::string rr::Solver::getParamHint ( int  n) const
virtual

Get the hint of the parameter at index n.

Author
JKM

◆ getParamName()

virtual std::string rr::Solver::getParamName ( size_t  n) const
virtual

Get the name of the parameter at index n.

Author
JKM

◆ getSettings()

std::vector<std::string> rr::Solver::getSettings ( ) const

Get a list of all settings for this solver.

Author
JKM

◆ getSettingsRepr()

std::string rr::Solver::getSettingsRepr ( ) const

Get the solver settings as a string.

Author
JKM

◆ getType()

const Variant::TypeId rr::Solver::getType ( std::string  key)

Gets the type associated with a given key.

Author
WBC

◆ getValue()

virtual Variant rr::Solver::getValue ( std::string  key) const
virtual

Get the value of an integrator setting.

Author
JKM, WBC
Note
Use one of the type-concrete versions like getValueAsInt to avoid type conversion gotchas

◆ getValueAsBool()

virtual bool rr::Solver::getValueAsBool ( std::string  key)
virtual

Wrapper for getValue which converts output to a specific type.

Author
WBC, JKM

◆ getValueAsChar()

virtual char rr::Solver::getValueAsChar ( std::string  key)
virtual

Wrapper for getValue which converts output to a specific type.

Author
WBC, JKM

◆ getValueAsDouble()

virtual double rr::Solver::getValueAsDouble ( std::string  key)
virtual

Wrapper for getValue which converts output to a specific type.

Author
WBC, JKM

◆ getValueAsFloat()

virtual float rr::Solver::getValueAsFloat ( std::string  key)
virtual

Wrapper for getValue which converts output to a specific type.

Author
WBC, JKM

◆ getValueAsInt()

virtual int rr::Solver::getValueAsInt ( std::string  key)
virtual

Wrapper for getValue which converts output to a specific type.

Author
WBC, JKM

◆ getValueAsLong()

virtual long rr::Solver::getValueAsLong ( std::string  key)
virtual

Wrapper for getValue which converts output to a specific type.

Author
WBC, JKM

◆ getValueAsString()

virtual std::string rr::Solver::getValueAsString ( std::string  key)
virtual

Wrapper for getValue which converts output to a specific type.

Author
WBC, JKM

◆ getValueAsUChar()

virtual unsigned char rr::Solver::getValueAsUChar ( std::string  key)
virtual

Wrapper for getValue which converts output to a specific type.

Author
WBC, JKM

◆ getValueAsUInt()

virtual unsigned int rr::Solver::getValueAsUInt ( std::string  key)
virtual

Wrapper for getValue which converts output to a specific type.

Author
WBC, JKM

◆ getValueAsULong()

virtual unsigned long rr::Solver::getValueAsULong ( std::string  key)
virtual

Wrapper for getValue which converts output to a specific type.

Author
WBC, JKM

◆ hasValue()

virtual Variant rr::Solver::hasValue ( std::string  key) const
virtual

Return true if this setting is supported by the integrator.

Author
JKM

◆ resetSettings()

virtual void rr::Solver::resetSettings ( )
virtual

Reset all settings to their respective default values.

Author
JKM

Reimplemented in rr::CVODEIntegrator, rr::RK4Integrator, rr::RK45Integrator, rr::NLEQ2Solver, rr::NLEQ1Solver, and rr::GillespieIntegrator.

◆ settingsPyDictRepr()

std::string rr::Solver::settingsPyDictRepr ( ) const

Python dictionary-style string representation of settings.

Author
JKM

◆ toRepr()

virtual std::string rr::Solver::toRepr ( ) const
virtual

Return string representation a la Python repr method.

Author
JKM

Reimplemented in rr::SteadyStateSolver, and rr::Integrator.

◆ toString()

virtual std::string rr::Solver::toString ( ) const
virtual

Return a string representation of the solver.

Author
JKM

Reimplemented in rr::SteadyStateSolver, and rr::Integrator.


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