roboptim::DummySolverLastState Class Reference

Dummy solver which always fails, but returns the last state of the solver. More...

`#include <roboptim/core/plugin/dummy-laststate.hh>`

Inheritance diagram for roboptim::DummySolverLastState:

## Public Types

typedef Solver< Function, boost::mpl::vector< Function > > | parent_t
| Define parent's type. More...
Public Types inherited from roboptim::Solver< Function, boost::mpl::vector< Function > >
typedef Problem< Function, boost::mpl::vector< Function > > | problem_t
| Solver problem type. More...
typedef std::map< std::string, Parameter > | parameters_t
| Map of parameters. More...
Public Types inherited from roboptim::GenericSolver
enum | solutions { SOLVER_NO_SOLUTION, SOLVER_VALUE, SOLVER_VALUE_WARNINGS, SOLVER_ERROR }
| Define the kind of solution which has been found. More...
typedef Function::vector_t | vector_t
| Vector type imported from function class. More...
typedef boost::variant< NoSolution, Result, ResultWithWarnings, SolverError > | result_t
| Result type. More...

## Public Member Functions

| DummySolverLastState (const problem_t &problem) throw ()
| Build a solver from a problem. More...
virtual | ~DummySolverLastState () throw ()
virtual void | solve () throw ()
| Implement the solve algorithm. More...
Public Member Functions inherited from roboptim::Solver< Function, boost::mpl::vector< Function > >
| Solver (const problem_t &problem) throw ()
| Instantiate a solver from a problem. More...
| Solver (const Problem< F_, C_ > &problem) throw ()
| Instantiate a solver from a problem in a different problem class. More...
virtual | ~Solver () throw ()
const problem_t & | problem () const throw ()
| Retrieve the problem. More...
virtual std::ostream & | print (std::ostream &) const throw ()
| Display the solver on the specified output stream. More...
const parameters_t & | parameters () const throw ()
parameters_t & | parameters () throw ()
const T & | getParameter (const std::string &key) const
Public Member Functions inherited from roboptim::GenericSolver
void | reset () throw ()
| Force to restart the optimization. More...
const result_t & | minimum () throw ()
| Returns the function minimum This solves the problem automatically, if it has not yet been solved. More...
solutions | minimumType () throw ()
| Determine real minimum type. More...
template<typename T >
const T & | getMinimum () throw (boost::bad_get)
| Get real result. More...
| GenericSolver () throw ()
| GenericSolver (const GenericSolver &) throw ()
virtual | ~GenericSolver () throw ()

## Additional Inherited Members

Protected Attributes inherited from roboptim::Solver< Function, boost::mpl::vector< Function > >
const problem_t | problem_
| Problem that will be solved. More...
parameters_t | parameters_
| Solver parameters (run-time configuration). More...
Protected Attributes inherited from roboptim::GenericSolver
result_t | result_
| /brief Optimization result. More...
Static Protected Attributes inherited from roboptim::Solver< Function, boost::mpl::vector< Function > >
static log4cxx::LoggerPtr | logger
| Pointer to function logger (see log4cxx documentation). More...
Static Protected Attributes inherited from roboptim::GenericSolver
static log4cxx::LoggerPtr | logger
| Pointer to function logger (see log4cxx documentation). More...

## Detailed Description

Dummy solver which always fails, but returns the last state of the solver.

The SolverError generated contains a dummy state of the solver (x, constraints etc.). These values can be obtained thanks to SolverError::lastState.

This solver always fails but is always available as it does not rely on the plug-in mechanism.

It is also a good starting point for users that want to develop their own solver.

## Member Typedef Documentation

typedef Solver<Function, boost::mpl::vector<Function> > roboptim::DummySolverLastState::parent_t

Define parent's type.

## Constructor & Destructor Documentation

roboptim::DummySolverLastState::DummySolverLastState | ( | const problem_t & | problem | ) |
throw | ( |
| ) |  |

explicit

Build a solver from a problem.

Parameters

  problem | problem that will be solved

roboptim::DummySolverLastState::~DummySolverLastState | ( |  | ) |
throw | ( |
| ) |  |

virtual

## Member Function Documentation

void roboptim::DummySolverLastState::solve | ( |  | ) |
throw | ( |
| ) |  |

virtual

Implement the solve algorithm.

Implement the solve method as required by the GenericSolver class.

Implements roboptim::GenericSolver.

References roboptim::Result::constraints, roboptim::Result::lambda, roboptim::GenericSolver::result_, roboptim::Result::value, and roboptim::Result::x.