class Gambit::ModelParameters

[No description available]

Public Functions

Name
ModelParameters()
Default constructor.
ModelParameters(const std::vector< std::string > & paramlist)
Constructor using vector of strings.
ModelParameters(const char ** paramlist)
Constructor using array of char arrays.
doublegetValue(std::string const & inkey) const
Get value of named parameter.
boolhas(const std::string & inkey) const
Check if a parameter exists in this object.
const std::map< std::string, double > &getValues() const
Get values of all parameters.
std::map< std::string, double >::const_iteratorbegin() const
Get a const iterator to the first parameter map entry.
std::map< std::string, double >::const_iteratorend() const
Get a const iterator to the last parameter map entry.
intgetNumberOfPars() const
Get number of parameters stored in this object.
const double &operator[](std::string const & inkey) const
Get parameter value using bracket operator.
const double &at(std::string const & inkey) const
Get parameter value using ‘at’ syntax.
voidsetValue(std::string const & inkey, double const & value)
Set single parameter value.
voidsetValues(std::map< std::string, double > const & params_map, bool missing_is_error =true)
Set many parameter values using a map.
voidsetValues(ModelParameters const & donor, bool missing_is_error =true)
Set many parameter values using another ModelParameters object.
std::vector< std::string >getKeys() const
Get parameter keys (names), probably for external iteration.
voidprint() const
Dump parameter names and values to stdout (should be for debugging only)
void_definePar(const std::string & newkey)
Define a parameter with name, value (i.e. add to internal map). Value is initialised to zero.
void_definePars(const std::vector< std::string > & v)
Define many new parameters at once via a vector of names.
void_definePars(const char ** array)
Define many new parameters at once via an array of char arrays.
std::stringgetModelName() const
Getters/setters for model and output names.
std::stringgetOutputName() const
voidsetModelName(const std::string & in)
voidsetOutputName(const std::string & in)

Protected Functions

Name
voidassert_contains(std::string inkey) const
Checks if this model container holds a parameter match the supplied name.

Friends

Name
std::ostream &operator«(std::ostream & strm, const ModelParameters & me)
Dump parameter names and values to stream (again for debugging only I think)

Public Functions Documentation

function ModelParameters

ModelParameters()

Default constructor.

function ModelParameters

ModelParameters(
    const std::vector< std::string > & paramlist
)

Constructor using vector of strings.

function ModelParameters

ModelParameters(
    const char ** paramlist
)

Constructor using array of char arrays.

function getValue

double getValue(
    std::string const & inkey
) const

Get value of named parameter.

function has

bool has(
    const std::string & inkey
) const

Check if a parameter exists in this object.

function getValues

const std::map< std::string, double > & getValues() const

Get values of all parameters.

function begin

std::map< std::string, double >::const_iterator begin() const

Get a const iterator to the first parameter map entry.

function end

std::map< std::string, double >::const_iterator end() const

Get a const iterator to the last parameter map entry.

function getNumberOfPars

int getNumberOfPars() const

Get number of parameters stored in this object.

function operator[]

const double & operator[](
    std::string const & inkey
) const

Get parameter value using bracket operator.

function at

const double & at(
    std::string const & inkey
) const

Get parameter value using ‘at’ syntax.

Get parameter value using ‘at’ operator This is no different to the bracket operator method, since keys cannot be added with the bracket method anyhow, but for people who are used to maps it is nice to have.

function setValue

void setValue(
    std::string const & inkey,
    double const & value
)

Set single parameter value.

function setValues

void setValues(
    std::map< std::string, double > const & params_map,
    bool missing_is_error =true
)

Set many parameter values using a map.

function setValues

void setValues(
    ModelParameters const & donor,
    bool missing_is_error =true
)

Set many parameter values using another ModelParameters object.

function getKeys

std::vector< std::string > getKeys() const

Get parameter keys (names), probably for external iteration.

function print

void print() const

Dump parameter names and values to stdout (should be for debugging only)

function _definePar

void _definePar(
    const std::string & newkey
)

Define a parameter with name, value (i.e. add to internal map). Value is initialised to zero.

function _definePars

void _definePars(
    const std::vector< std::string > & v
)

Define many new parameters at once via a vector of names.

function _definePars

void _definePars(
    const char ** array
)

Define many new parameters at once via an array of char arrays.

function getModelName

std::string getModelName() const

Getters/setters for model and output names.

function getOutputName

std::string getOutputName() const

function setModelName

void setModelName(
    const std::string & in
)

function setOutputName

void setOutputName(
    const std::string & in
)

Protected Functions Documentation

function assert_contains

void assert_contains(
    std::string inkey
) const

Checks if this model container holds a parameter match the supplied name.

ModelParameters class member function definitions.

Checks if this model container holds a parameter matching the supplied name

Friends

friend operator«

friend std::ostream & operator<<(
    std::ostream & strm,

    const ModelParameters & me
);

Dump parameter names and values to stream (again for debugging only I think)


Updated on 2024-07-18 at 13:53:30 +0000