Abstract interface satisfied by all solvers. More...
#include <roboptim/core/generic-solver.hh>
Public Types | |
| 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 | |
| void | reset () |
| Force to restart the optimization. | |
| virtual void | solve ()=0 |
| Solve the problem. | |
| const result_t & | minimum () |
| Returns the function minimum This solves the problem automatically, if it has not yet been solved. | |
| virtual std::ostream & | print (std::ostream &) const |
| Display the solver on the specified output stream. | |
| solutions | minimumType () |
| Determine real minimum type. | |
| template<typename T > | |
| const T & | getMinimum () |
| Get real result. | |
Constructors and destructors. | |
| GenericSolver () | |
| GenericSolver (const GenericSolver &) | |
| virtual | ~GenericSolver () |
Protected Attributes | |
| result_t | result_ |
| Optimization result. | |
Static Protected Attributes | |
| static log4cxx::LoggerPtr | logger |
| Pointer to function logger (see log4cxx documentation). | |
Abstract interface satisfied by all solvers.
| typedef boost::variant<NoSolution, Result, ResultWithWarnings, SolverError> roboptim::GenericSolver::result_t |
Result type.
Uses a Boost.Variant to represent the different possible results:
| roboptim::GenericSolver::GenericSolver | ( | ) | [explicit] |
| roboptim::GenericSolver::GenericSolver | ( | const GenericSolver & | solver | ) | [explicit] |
| roboptim::GenericSolver::~GenericSolver | ( | ) | [virtual] |
| const T& roboptim::GenericSolver::getMinimum | ( | ) | [inline] |
Get real result.
Optimization results is wrapped in a Boost.Variant class, this method has to be used to retrieve the real result type.
| boost::bad_get | if a wrong type is used. |
Returns the function minimum This solves the problem automatically, if it has not yet been solved.
References result_, solve(), and SOLVER_NO_SOLUTION.
| solutions roboptim::GenericSolver::minimumType | ( | ) | [inline] |
Determine real minimum type.
| std::ostream & roboptim::GenericSolver::print | ( | std::ostream & | o | ) | const [virtual] |
Display the solver on the specified output stream.
| o | output stream used for display |
Reimplemented in roboptim::Solver< F, C >, roboptim::Solver< F, boost::mpl::vector< F > >, roboptim::Solver< Function, boost::mpl::vector< Function > >, and roboptim::Solver< TwiceDifferentiableFunction, boost::mpl::vector< TwiceDifferentiableFunction > >.
Referenced by roboptim::operator<<().
| void roboptim::GenericSolver::reset | ( | ) |
| virtual void roboptim::GenericSolver::solve | ( | ) | [pure virtual] |
Solve the problem.
Called automatically by getMinimum if required.
Implemented in roboptim::GenericDummySolverLastState< F >, roboptim::DummySolverTd, and roboptim::DummySolver.
Referenced by minimum().
log4cxx::LoggerPtr roboptim::GenericSolver::logger [static, protected] |
Pointer to function logger (see log4cxx documentation).
Reimplemented in roboptim::Solver< F, C >, roboptim::Solver< F, boost::mpl::vector< F > >, roboptim::Solver< Function, boost::mpl::vector< Function > >, and roboptim::Solver< TwiceDifferentiableFunction, boost::mpl::vector< TwiceDifferentiableFunction > >.
Referenced by reset().
result_t roboptim::GenericSolver::result_ [protected] |
Optimization result.
Referenced by minimum(), reset(), roboptim::DummySolver::solve(), and roboptim::DummySolverTd::solve().