Loading...
Searching...
No Matches
roboptim::Solver< F, C > Class Template Reference

Solver for a specific problem class. More...

#include <roboptim/core/solver.hh>

Inheritance diagram for roboptim::Solver< F, C >:
Collaboration diagram for roboptim::Solver< F, C >:

Public Types

typedef Problem< F, C > problem_t
 Solver problem type.
typedef F::vector_t vector_t
 Import vector type from cost function.
typedef std::map< std::string, Parameterparameters_t
 Map of parameters.
typedef SolverState< problem_tsolverState_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, SolverErrorresult_t
 Result type.

Public Member Functions

 Solver (const problem_t &problem)
 Instantiate a solver from a problem.
template<typename F_, typename C_>
 Solver (const Problem< F_, C_ > &problem)
 Instantiate a solver from a problem in a different problem class.
virtual ~Solver ()
const problem_tproblem () const
 Retrieve the problem.
virtual void setIterationCallback (callback_t)
 Set the per-iteration callback.
virtual std::ostream & print (std::ostream &) const
 Display the solver on the specified output stream.
Parameters
const parameters_tparameters () const
parameters_tparameters ()
template<typename T>
const T & getParameter (const std::string &key) const
Plugin name
const std::string & pluginName () const
std::string & pluginName ()
Public Member Functions inherited from roboptim::GenericSolver
void reset ()
 Force to restart the optimization.
virtual void solve ()=0
 Solve the problem.
const result_tminimum ()
 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 ()

Protected Attributes

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

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).

Detailed Description

template<typename F, typename C>
class roboptim::Solver< F, C >

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.

Template Parameters
Fcost function type
Cconstraints functions type
Precondition
F is a subtype of Function