State of the solver. More...
#include <roboptim/core/solver-state.hh>
Public Types | |
typedef P | problem_t |
Problem type. More... | |
typedef P::function_t::argument_t | argument_t |
Import argument types from problem. More... | |
typedef P::value_type | value_type |
Import value type from problem. More... | |
typedef P::function_t | function_t |
Import function type from problem. More... | |
typedef std::map< std::string, StateParameter< function_t > > | parameters_t |
Map of parameters. More... | |
Public Member Functions | |
SolverState (const problem_t &problem) | |
Instantiate a solver from a problem. More... | |
virtual | ~SolverState () |
const argument_t & | x () const |
Retrieve the current optimization parameters. More... | |
argument_t & | x () |
const boost::optional < value_type > & | cost () const |
Retrieve the current cost. More... | |
boost::optional< value_type > & | cost () |
const boost::optional < value_type > & | constraintViolation () const |
Retrieve the current constraint violation. More... | |
boost::optional< value_type > & | constraintViolation () |
virtual std::ostream & | print (std::ostream &) const |
Display the solver state on the specified output stream. More... | |
Parameters | |
const parameters_t & | parameters () const |
parameters_t & | parameters () |
template<typename T > | |
const T & | getParameter (const std::string &key) const |
Get a parameter. More... | |
template<typename T > | |
T & | getParameter (const std::string &key) |
Get a parameter. More... | |
Protected Attributes | |
argument_t | x_ |
Current optimization parameters. More... | |
boost::optional< value_type > | cost_ |
Current cost. More... | |
boost::optional< value_type > | constraintViolation_ |
Current constraint violation. More... | |
parameters_t | parameters_ |
Solver state extra parameters (solver-specific parameters etc.). More... | |
State of the solver.
P | problem type. |
typedef P::function_t::argument_t roboptim::SolverState< P >::argument_t |
Import argument types from problem.
typedef P::function_t roboptim::SolverState< P >::function_t |
Import function type from problem.
typedef std::map<std::string, StateParameter<function_t> > roboptim::SolverState< P >::parameters_t |
Map of parameters.
typedef P roboptim::SolverState< P >::problem_t |
Problem type.
typedef P::value_type roboptim::SolverState< P >::value_type |
Import value type from problem.
|
explicit |
Instantiate a solver from a problem.
problem | problem that should be solved |
References roboptim::SolverState< P >::x_.
|
virtual |
const boost::optional< typename SolverState< P >::value_type > & roboptim::SolverState< P >::constraintViolation | ( | ) | const |
Retrieve the current constraint violation.
boost::optional< typename SolverState< P >::value_type > & roboptim::SolverState< P >::constraintViolation | ( | ) |
const boost::optional< typename SolverState< P >::value_type > & roboptim::SolverState< P >::cost | ( | ) | const |
Retrieve the current cost.
boost::optional< typename SolverState< P >::value_type > & roboptim::SolverState< P >::cost | ( | ) |
const T & roboptim::SolverState< P >::getParameter | ( | const std::string & | key | ) | const |
Get a parameter.
T | parameter type. |
key | parameter key. |
std::out_of_range |
T & roboptim::SolverState< P >::getParameter | ( | const std::string & | key | ) |
Get a parameter.
T | parameter type. |
key | parameter key. |
std::out_of_range |
const SolverState< P >::parameters_t & roboptim::SolverState< P >::parameters | ( | ) | const |
SolverState< P >::parameters_t & roboptim::SolverState< P >::parameters | ( | ) |
|
virtual |
Display the solver state on the specified output stream.
o | output stream used for display |
References roboptim::decindent(), roboptim::iendl(), roboptim::incindent(), and x_.
const SolverState< P >::argument_t & roboptim::SolverState< P >::x | ( | ) | const |
Retrieve the current optimization parameters.
Note: we do not use (const_)argument_ref here since this would return a reference to a local temporary variable when dealing with Eigen::Ref: const Eigen::Ref<const argument_t>&
References x_.
SolverState< P >::argument_t & roboptim::SolverState< P >::x | ( | ) |
References x_.
|
protected |
Current constraint violation.
The solver may not provide the constraint violation at each iteration, hence the use of boost::optional.
|
protected |
Current cost.
The solver may not provide the cost at each iteration, hence the use of boost::optional.
|
protected |
Solver state extra parameters (solver-specific parameters etc.).
|
protected |
Current optimization parameters.
Referenced by roboptim::SolverState< P >::SolverState().