Dummy solver which always fails, but returns the last state of the solver. More...
#include <roboptim/core/plugin/dummy-laststate.hh>


Public Types | |
| typedef Solver< F, boost::mpl::vector< F > > | parent_t |
| Define parent's type. | |
| typedef parent_t::problem_t | problem_t |
| Problem type. | |
| typedef parent_t::callback_t | callback_t |
| Callback function type. | |
| typedef SolverState< problem_t > | solverState_t |
| Type of the state of the solver. | |
| Public Types inherited from roboptim::Solver< F, boost::mpl::vector< F > > | |
| typedef Problem< F, boost::mpl::vector< F > > | problem_t |
| Solver problem type. | |
| typedef F::vector_t | vector_t |
| Import vector type from cost function. | |
| typedef std::map< std::string, Parameter > | parameters_t |
| Map of parameters. | |
| typedef SolverState< problem_t > | solverState_t |
| State of the solver. | |
| typedef boost::function< void(const problem_t &problem, solverState_t &state)> | callback_t |
| Per-iteration callback type. | |
| 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 boost::variant< NoSolution, Result, ResultWithWarnings, SolverError > | result_t |
| Result type. | |
Public Member Functions | |
| GenericDummySolverLastState (const problem_t &problem) | |
| Build a solver from a problem. | |
| virtual | ~GenericDummySolverLastState () |
| virtual void | solve () |
| Implement the solve algorithm. | |
| virtual void | setIterationCallback (callback_t callback) |
| Set the per-iteration callback. | |
| const callback_t & | callback () const |
| Public Member Functions inherited from roboptim::Solver< F, boost::mpl::vector< F > > | |
| Solver (const problem_t &problem) | |
| Instantiate a solver from a problem. | |
| Solver (const Problem< F_, C_ > &problem) | |
| Instantiate a solver from a problem in a different problem class. | |
| virtual | ~Solver () |
| const problem_t & | problem () const |
| Retrieve the problem. | |
| virtual std::ostream & | print (std::ostream &) const |
| Display the solver on the specified output stream. | |
| const parameters_t & | parameters () const |
| parameters_t & | parameters () |
| const T & | getParameter (const std::string &key) const |
| const std::string & | pluginName () const |
| std::string & | pluginName () |
| Public Member Functions inherited from roboptim::GenericSolver | |
| void | reset () |
| Force to restart the optimization. | |
| const result_t & | minimum () |
| Returns the function minimum This solves the problem automatically, if it has not yet been solved. | |
| solutions | minimumType () |
| Determine real minimum type. | |
| template<typename T> | |
| const T & | getMinimum () |
| Get real result. | |
| GenericSolver () | |
| GenericSolver (const GenericSolver &) | |
| virtual | ~GenericSolver () |
Public Attributes | |
| callback_t | callback_ |
| Intermediate callback (called at each end of iteration). | |
| solverState_t | solverState_ |
| Current state of the solver (used by the callback function). | |
Additional Inherited Members | |
| Protected Attributes inherited from roboptim::Solver< F, boost::mpl::vector< F > > | |
| const problem_t | problem_ |
| Problem that will be solved. | |
| parameters_t | parameters_ |
| Solver parameters (run-time configuration). | |
| std::string | plugin_name_ |
| Plugin name. | |
| Protected Attributes inherited from roboptim::GenericSolver | |
| result_t | result_ |
| Optimization result. | |
| Static Protected Attributes inherited from roboptim::Solver< F, boost::mpl::vector< F > > | |
| static log4cxx::LoggerPtr | logger |
| Pointer to function logger (see log4cxx documentation). | |
| Static Protected Attributes inherited from roboptim::GenericSolver | |
| static log4cxx::LoggerPtr | logger |
| Pointer to function logger (see log4cxx documentation). | |
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.
| typedef parent_t::callback_t roboptim::GenericDummySolverLastState< F >::callback_t |
Callback function type.
| typedef Solver<F, boost::mpl::vector<F> > roboptim::GenericDummySolverLastState< F >::parent_t |
Define parent's type.
| typedef parent_t::problem_t roboptim::GenericDummySolverLastState< F >::problem_t |
Problem type.
| typedef SolverState<problem_t> roboptim::GenericDummySolverLastState< F >::solverState_t |
Type of the state of the solver.
|
explicit |
Build a solver from a problem.
| problem | problem that will be solved |
References callback_, roboptim::Solver< F, boost::mpl::vector< F > >::parameters_, and solverState_.
|
virtual |
|
inline |
|
inlinevirtual |
Set the per-iteration callback.
The per-iteration callback is a callback called each time one iteration of the optimization process is finished.
Not all the solvers support such a callback so this method may throw a std::runtime_error to let you know this feature is unsupported.
| std::runtime_error |
Reimplemented from roboptim::Solver< F, boost::mpl::vector< F > >.
|
virtual |
Implement the solve algorithm.
Implement the solve method as required by the GenericSolver class.
Implements roboptim::GenericSolver.
References callback_, roboptim::Result::constraints, roboptim::Result::lambda, roboptim::Solver< F, boost::mpl::vector< F > >::problem(), roboptim::GenericSolver::result_, solverState_, roboptim::Result::value, and roboptim::Result::x.
| callback_t roboptim::GenericDummySolverLastState< F >::callback_ |
Intermediate callback (called at each end of iteration).
Referenced by GenericDummySolverLastState(), and solve().
| solverState_t roboptim::GenericDummySolverLastState< F >::solverState_ |
Current state of the solver (used by the callback function).
Referenced by GenericDummySolverLastState(), and solve().