Solver per-iteration callback wrapper. More...
#include <roboptim/core/solver-callback.hh>
Public Types | |
| typedef S | solver_t |
| Solver type. More... | |
| typedef solver_t::problem_t | problem_t |
| Solver problem type. More... | |
| typedef solver_t::callback_t | callback_t |
| Per-iteration callback type. More... | |
| typedef solver_t::solverState_t | solverState_t |
| State of the solver. More... | |
Public Member Functions | |
| SolverCallback (const std::string &name="unnamed callback") | |
| Solver callback constructor. More... | |
| virtual | ~SolverCallback () |
| Destructor. More... | |
| const std::string & | name () const |
| Return the name of the callback. More... | |
| callback_t | callback () |
| Callback function. More... | |
| void | operator() (const problem_t &pb, solverState_t &state) |
| Evaluate the callback. More... | |
| virtual std::ostream & | print (std::ostream &o) const |
| Display the callback on the specified output stream. More... | |
Protected Member Functions | |
| virtual void | perIterationCallback (const problem_t &pb, solverState_t &state) |
| Wrapper around the callback function that catch exceptions. More... | |
| virtual void | perIterationCallbackUnsafe (const problem_t &pb, solverState_t &state)=0 |
| The actual callback function. More... | |
Solver per-iteration callback wrapper.
| S | solver type. |
| typedef solver_t::callback_t roboptim::SolverCallback< S >::callback_t |
Per-iteration callback type.
Callback parameters:
| typedef solver_t::problem_t roboptim::SolverCallback< S >::problem_t |
Solver problem type.
| typedef S roboptim::SolverCallback< S >::solver_t |
Solver type.
| typedef solver_t::solverState_t roboptim::SolverCallback< S >::solverState_t |
State of the solver.
| roboptim::SolverCallback< S >::SolverCallback | ( | const std::string & | name = "unnamed callback" | ) |
Solver callback constructor.
| name | name of the callback. |
|
virtual |
Destructor.
| SolverCallback< S >::callback_t roboptim::SolverCallback< S >::callback | ( | ) |
Callback function.
References roboptim::bind().
| const std::string & roboptim::SolverCallback< S >::name | ( | ) | const |
Return the name of the callback.
| void roboptim::SolverCallback< S >::operator() | ( | const problem_t & | pb, |
| solverState_t & | state | ||
| ) |
Evaluate the callback.
|
protectedvirtual |
Wrapper around the callback function that catch exceptions.
| pb | optimization problem. |
| state | state of the solver after an iteration. |
Reimplemented in roboptim::OptimizationLogger< T >.
|
protectedpure virtual |
The actual callback function.
The function may throw.
| pb | optimization problem. |
| state | state of the solver after an iteration. |
|
virtual |
Display the callback on the specified output stream.
| o | output stream used for display. |
Reimplemented in roboptim::OptimizationLogger< T >, and roboptim::callback::Multiplexer< S >.