Solver for a specific problem class. More...
#include <roboptim/core/solver.hh>
Public Types | |
typedef Problem< F, C > | problem_t |
Solver problem type. | |
Public Member Functions | |
Solver (const problem_t &problem) throw () | |
Instantiate a solver from a problem. | |
template<typename F_ , typename C_ > | |
Solver (const Problem< F_, C_ > &problem) throw () | |
Instantiate a solver from a problem in a different problem class. | |
virtual | ~Solver () throw () |
const problem_t & | problem () const throw () |
Retrieve the problem. | |
virtual std::ostream & | print (std::ostream &) const throw () |
Display the solver on the specified output stream. | |
Protected Attributes | |
const problem_t | problem_ |
Problem that will be solved. |
Solver for a specific problem class.
This class is parametrized by two types: the cost function type and the constraints type.
Solver classes are immutable, the problem can not be changed after the class instantiation.
F | cost function type | |
C | constraints functions type |
typedef Problem<F, C> roboptim::Solver< F, C >::problem_t |
Solver problem type.
The solver can solve problems of this type. If another kind of problem is given, a conversion will be required.
roboptim::Solver< F, C >::Solver | ( | const problem_t & | problem | ) | throw () [inline, explicit] |
Instantiate a solver from a problem.
problem | problem that should be solved |
roboptim::Solver< F, C >::Solver | ( | const Problem< F_, C_ > & | problem | ) | throw () [inline, explicit] |
Instantiate a solver from a problem in a different problem class.
This constructor is called when the problem cost function or/and constraints type does not match solver's types.
This is only possible if the problem provides too much information compared to the solver requirements: if the problem contains twice derivable function and the solver requires only derivable function, it will work however the opposite will fail. Problem compatibility is known at compile-time, so the failure will be at compile-time.
F_ | original cost function type | |
C_ | original constraints functions type |
problem | problem that should be solved |
roboptim::Solver< F, C >::~Solver | ( | ) | throw () [inline, virtual] |
std::ostream & roboptim::Solver< F, C >::print | ( | std::ostream & | o | ) | const throw () [inline, virtual] |
Display the solver on the specified output stream.
o | output stream used for display |
Reimplemented from roboptim::GenericSolver.
const Solver< F, C >::problem_t & roboptim::Solver< F, C >::problem | ( | ) | const throw () [inline] |
Retrieve the problem.
References roboptim::Solver< F, C >::problem_.
const problem_t roboptim::Solver< F, C >::problem_ [protected] |
Problem that will be solved.
Referenced by roboptim::Solver< F, C >::problem().