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 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 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). | |
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.
Reimplemented from roboptim::Solver< F, boost::mpl::vector< F > >.
| 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.
Reimplemented from roboptim::Solver< F, boost::mpl::vector< F > >.
| typedef SolverState<problem_t> roboptim::GenericDummySolverLastState< F >::solverState_t |
Type of the state of the solver.
Reimplemented from roboptim::Solver< F, boost::mpl::vector< F > >.
| roboptim::GenericDummySolverLastState< F >::GenericDummySolverLastState | ( | const problem_t & | problem | ) | [explicit] |
Build a solver from a problem.
| problem | problem that will be solved |
| roboptim::GenericDummySolverLastState< F >::~GenericDummySolverLastState | ( | ) | [virtual] |
| const callback_t& roboptim::GenericDummySolverLastState< F >::callback | ( | ) | const [inline] |
| virtual void roboptim::GenericDummySolverLastState< F >::setIterationCallback | ( | callback_t | ) | [inline, virtual] |
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 > >.
References roboptim::GenericDummySolverLastState< F >::callback(), and roboptim::GenericDummySolverLastState< F >::callback_.
| void roboptim::GenericDummySolverLastState< F >::solve | ( | ) | [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, result_, roboptim::Result::value, and roboptim::Result::x.
| callback_t roboptim::GenericDummySolverLastState< F >::callback_ |
Intermediate callback (called at each end of iteration).
Referenced by roboptim::GenericDummySolverLastState< F >::callback(), and roboptim::GenericDummySolverLastState< F >::setIterationCallback().
| solverState_t roboptim::GenericDummySolverLastState< F >::solverState_ |
Current state of the solver (used by the callback function).