Optimization problem without constraints. More...
Classes | |
| struct | roboptim::detail::add_shared_ptr< CLIST > |
| Transform a types list into a types list of shared pointers. More... | |
| class | roboptim::Problem< F, boost::mpl::vector<> > |
| class | roboptim::Problem< F, C > |
| class | roboptim::ResultWithWarnings |
| Represents the solution of an optimization problem when errors occurred during the solving process. More... | |
| class | roboptim::Result |
| Represents the solution of an optimization problem. More... | |
| class | roboptim::SolverError |
| Base exception class for solving errors. More... | |
| class | roboptim::SolverFactory< T > |
| Define a solver factory that instanciate the plug-ins. More... | |
| class | roboptim::SolverWarning |
| Exception used for non-critical errors during optimization. More... | |
| struct | roboptim::Parameter |
| Parameters type. More... | |
| class | roboptim::Solver< F, C > |
| Solver for a specific problem class. More... | |
Typedefs | |
| typedef boost::mpl::transform < CLIST, typename boost::shared_ptr < boost::mpl::_1 > >::type | roboptim::detail::add_shared_ptr< CLIST >::type |
| Result. More... | |
| typedef F | roboptim::Problem< F, boost::mpl::vector<> >::function_t |
| Function type. More... | |
| typedef function_t::value_type | roboptim::Problem< F, boost::mpl::vector<> >::value_type |
| typedef boost::optional < Function::vector_t > | roboptim::Problem< F, boost::mpl::vector<> >::startingPoint_t |
| Optional vector defines a starting point. More... | |
| typedef Function::interval_t | roboptim::Problem< F, boost::mpl::vector<> >::interval_t |
| typedef Function::intervals_t | roboptim::Problem< F, boost::mpl::vector<> >::intervals_t |
| typedef std::vector< value_type > | roboptim::Problem< F, boost::mpl::vector<> >::scales_t |
| Scale vector. More... | |
| typedef CLIST | roboptim::Problem< F, C >::constraintsList_t |
| Constraints types list. More... | |
| typedef F | roboptim::Problem< F, C >::function_t |
| Function type. More... | |
| typedef boost::make_variant_over < typename detail::add_shared_ptr< CLIST > ::type >::type | roboptim::Problem< F, C >::constraint_t |
| Constraint's type. More... | |
| typedef function_t::value_type | roboptim::Problem< F, C >::value_type |
| typedef std::vector< constraint_t > | roboptim::Problem< F, C >::constraints_t |
| Constraints are represented as a vector of constraints. More... | |
| typedef boost::optional < Function::vector_t > | roboptim::Problem< F, C >::startingPoint_t |
| Optional vector defines a starting point. More... | |
| typedef Function::interval_t | roboptim::Problem< F, C >::interval_t |
| typedef Function::intervals_t | roboptim::Problem< F, C >::intervals_t |
| typedef std::vector< value_type > | roboptim::Problem< F, C >::scales_t |
| Scale vector. More... | |
| typedef std::vector< intervals_t > | roboptim::Problem< F, C >::intervalsVect_t |
| Vector of interval vectors. More... | |
| typedef std::vector< scales_t > | roboptim::Problem< F, C >::scalesVect_t |
| Vector of scale vectors. More... | |
Functions | |
| std::ostream & | roboptim::Problem< F, boost::mpl::vector<> >::print (std::ostream &o) const throw () |
| Display the problem on the specified output stream. More... | |
| std::ostream & | roboptim::Problem< F, C >::print (std::ostream &o) const throw () |
| Display the problem on the specified output stream. More... | |
| template<typename F > | |
| std::ostream & | roboptim::operator<< (std::ostream &o, const Problem< F, boost::mpl::vector<> > &pb) |
| Override operator<< to handle problem display. More... | |
| template<typename F , typename CLIST > | |
| std::ostream & | roboptim::operator<< (std::ostream &o, const Problem< F, CLIST > &pb) |
| Override operator<< to handle problem display. More... | |
| ROBOPTIM_DLLAPI std::ostream & | roboptim::operator<< (std::ostream &o, const Parameter ¶meter) |
| Override operator<< to display ``parameters'' objects. More... | |
Friends | |
| template<typename F_ , typename CLIST_ > | |
| class | roboptim::Problem< F, boost::mpl::vector<> >::Problem |
| template<typename F_ , typename CLIST_ > | |
| class | roboptim::Problem< F, C >::Problem |
Constructors and destructors. | |
| roboptim::Problem< F, boost::mpl::vector<> >::Problem (const function_t &) throw () | |
| roboptim::Problem< F, boost::mpl::vector<> >::Problem (const Problem< F, boost::mpl::vector<> > &) throw () | |
| Copy constructor. More... | |
| template<typename F_ > | |
| roboptim::Problem< F, boost::mpl::vector<> >::Problem (const Problem< F_, boost::mpl::vector<> > &) throw () | |
| Copy constructor (convert from another class of problem). More... | |
| roboptim::Problem< F, boost::mpl::vector<> >::~Problem () throw () | |
Cost function. | |
| const function_t & | roboptim::Problem< F, boost::mpl::vector<> >::function () const throw () |
| Retrieve cost function. More... | |
| intervals_t & | roboptim::Problem< F, boost::mpl::vector<> >::argumentBounds () throw () |
| Retrieve arguments bounds. More... | |
| const intervals_t & | roboptim::Problem< F, boost::mpl::vector<> >::argumentBounds () const throw () |
| Retrieve arguments bounds. More... | |
| scales_t & | roboptim::Problem< F, boost::mpl::vector<> >::argumentScales () throw () |
| Retrieve arguments scales. More... | |
| const scales_t & | roboptim::Problem< F, boost::mpl::vector<> >::argumentScales () const throw () |
| Retrieve arguments scales. More... | |
Starting point (initial guess). | |
| startingPoint_t & | roboptim::Problem< F, boost::mpl::vector<> >::startingPoint () throw () |
| Set the initial guess. More... | |
| const startingPoint_t & | roboptim::Problem< F, boost::mpl::vector<> >::startingPoint () const throw () |
| Get the initial guess. More... | |
Constructors and destructors. | |
| roboptim::Problem< F, C >::Problem (const function_t &) throw () | |
| roboptim::Problem< F, C >::Problem (const Problem< F, CLIST > &) throw () | |
| Copy constructor. More... | |
| template<typename F_ , typename CLIST_ > | |
| roboptim::Problem< F, C >::Problem (const Problem< F_, CLIST_ > &) throw () | |
| Copy constructor (convert from another class of problem). More... | |
| roboptim::Problem< F, C >::~Problem () throw () | |
Cost function. | |
| const function_t & | roboptim::Problem< F, C >::function () const throw () |
| Retrieve cost function. More... | |
| intervals_t & | roboptim::Problem< F, C >::argumentBounds () throw () |
| Retrieve arguments bounds. More... | |
| const intervals_t & | roboptim::Problem< F, C >::argumentBounds () const throw () |
| Retrieve arguments bounds. More... | |
| scales_t & | roboptim::Problem< F, C >::argumentScales () throw () |
| Retrieve arguments scales. More... | |
| const scales_t & | roboptim::Problem< F, C >::argumentScales () const throw () |
| Retrieve arguments scales. More... | |
Constraints. | |
| const constraints_t & | roboptim::Problem< F, C >::constraints () const throw () |
| Retrieve constraints. More... | |
| template<typename C > | |
| void | roboptim::Problem< F, C >::addConstraint (boost::shared_ptr< C > constraint, interval_t interval, value_type scale=1.) throw (std::runtime_error) |
| Add a constraint to the problem. More... | |
| template<typename C > | |
| void | roboptim::Problem< F, C >::addConstraint (boost::shared_ptr< C > constraint, intervals_t intervals, scales_t scales) throw (std::runtime_error) |
| Add a constraint to the problem. More... | |
| const intervalsVect_t & | roboptim::Problem< F, C >::boundsVector () const throw () |
| Retrieve constraints bounds vector. More... | |
| const scalesVect_t & | roboptim::Problem< F, C >::scalesVector () const throw () |
| Retrieve constraints scales vector. More... | |
Starting point (initial guess). | |
| startingPoint_t & | roboptim::Problem< F, C >::startingPoint () throw () |
| Set the initial guess. More... | |
| const startingPoint_t & | roboptim::Problem< F, C >::startingPoint () const throw () |
| Get the initial guess. More... | |
Optimization problem without constraints.
Optimization problem.
An optimization problem is defined as:
)The goal of the optimization process is finding a point which minimizes the cost function
To use the class, one has to instantiate a problem with a reference to a cost function. method: a reference to a function and an interval is needed.
The cost function is immutable.
Unlike other classes which just copy functions, pointers are used here in order to allow sub-classes of constraints to be inserted in the problem. For instance, a twice derivable function can be inserted in a problem which expects a derivable function.
| F | function type |
An optimization problem is defined as:
)
) associated with an interval and a scale,The goal of the optimization process is finding a point which minimizes the cost function and which respects the constraints (i.e. the result of some functions is inside of specific interval).
To use the class, one has to instantiate a problem with a reference to a cost function. Then, constraints can be added through the addConstraint method: a reference to a function and an interval is needed.
The cost function is immutable.
Constraints are stored as a Boost.Variant of smart pointers (i.e. more precisely using a boost::shared_ptr) representing all the different possibles constraint types.
It is recommended to add a constraint using the following syntax:
where C is the constraint type and MyFunction the function type.
Unlike other classes which just copy functions, pointers are used here in order to allow sub-classes of constraints to be inserted in the problem. For instance, a twice derivable function can be inserted in a problem which expects a derivable function.
| F | function type |
| CLIST | type list satisfying MPL's sequence concept |
| typedef boost::make_variant_over<typename detail::add_shared_ptr<CLIST>::type>::type roboptim::Problem< F, C >::constraint_t |
Constraint's type.
Generate a Boost.Variant of shared pointers tyle from the static constraints types list.
For instance, if one instantiates
then this type will be set to:
The meta-algorithm which add shared pointers is implemented in detail::add_shared_pointer.
| typedef std::vector<constraint_t> roboptim::Problem< F, C >::constraints_t |
Constraints are represented as a vector of constraints.
| typedef CLIST roboptim::Problem< F, C >::constraintsList_t |
Constraints types list.
| typedef F roboptim::Problem< F, boost::mpl::vector<> >::function_t |
Function type.
This has to be either Function or one of its sub-classes.
| typedef F roboptim::Problem< F, C >::function_t |
Function type.
This has to be either Function or one of its sub-classes.
| typedef Function::interval_t roboptim::Problem< F, boost::mpl::vector<> >::interval_t |
| typedef Function::interval_t roboptim::Problem< F, C >::interval_t |
| typedef Function::intervals_t roboptim::Problem< F, boost::mpl::vector<> >::intervals_t |
| typedef Function::intervals_t roboptim::Problem< F, C >::intervals_t |
| typedef std::vector<intervals_t> roboptim::Problem< F, C >::intervalsVect_t |
Vector of interval vectors.
This type is used to take into account the fact that constraints can have output values in
.
If
, then the associated interval vector contains only one element of interval_t type.
| typedef std::vector<value_type> roboptim::Problem< F, boost::mpl::vector<> >::scales_t |
Scale vector.
| typedef std::vector<value_type> roboptim::Problem< F, C >::scales_t |
Scale vector.
| typedef std::vector<scales_t> roboptim::Problem< F, C >::scalesVect_t |
Vector of scale vectors.
This type is used to take into account the fact that constraints can have output values in
.
If
, then the associated scale vector contains only one element of scale_t type.
| typedef boost::optional<Function::vector_t> roboptim::Problem< F, boost::mpl::vector<> >::startingPoint_t |
Optional vector defines a starting point.
| typedef boost::optional<Function::vector_t> roboptim::Problem< F, C >::startingPoint_t |
Optional vector defines a starting point.
| typedef boost::mpl::transform<CLIST, typename boost::shared_ptr<boost::mpl::_1> >::type roboptim::detail::add_shared_ptr< CLIST >::type |
| typedef function_t::value_type roboptim::Problem< F, boost::mpl::vector<> >::value_type |
| typedef function_t::value_type roboptim::Problem< F, C >::value_type |
| void roboptim::Problem< F, CLIST >::addConstraint | ( | boost::shared_ptr< C > | constraint, |
| interval_t | interval, | ||
| value_type | scale = 1. |
||
| ) | |||
| throw | ( | std::runtime_error | |
| ) | |||
Add a constraint to the problem.
Useful only when
, use addConstraint (boost::shared_ptr<C> constraint, intervals_t intervals, scales_t scales) instead.
| constraint | the constraint that will be added |
| interval | interval in which the constraint is satisfied |
| scale | constraint scale |
| C | constraint type (has to be in CLIST) |
| void roboptim::Problem< F, CLIST >::addConstraint | ( | boost::shared_ptr< C > | constraint, |
| intervals_t | intervals, | ||
| scales_t | scales | ||
| ) | |||
| throw | ( | std::runtime_error | |
| ) | |||
Add a constraint to the problem.
The constraint can be multidimensional.
| constraint | the constraint that will be added |
| intervals | interval vector in which the constraint is satisfied |
| scale | constraint scale |
| C | constraint type (has to be in CLIST) |
| Problem< F, boost::mpl::vector<> >::intervals_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentBounds | ( | ) | ||
| throw | ( | |||
| ) | ||||
Retrieve arguments bounds.
Arguments bounds define in which interval each argument is valid.
| const Problem< F, boost::mpl::vector<> >::intervals_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentBounds | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Retrieve arguments bounds.
Arguments bounds define in which interval each argument is valid.
| Problem< F, CLIST >::intervals_t & roboptim::Problem< F, CLIST >::argumentBounds | ( | ) | ||
| throw | ( | |||
| ) | ||||
Retrieve arguments bounds.
Arguments bounds define in which interval each argument is valid.
| const Problem< F, CLIST >::intervals_t & roboptim::Problem< F, CLIST >::argumentBounds | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Retrieve arguments bounds.
Arguments bounds define in which interval each argument is valid.
| Problem< F, boost::mpl::vector<> >::scales_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentScales | ( | ) | ||
| throw | ( | |||
| ) | ||||
Retrieve arguments scales.
Arguments scales define which scale is applied for each argument.
| const Problem< F, boost::mpl::vector<> >::scales_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentScales | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Retrieve arguments scales.
Arguments scales define which scale is applied for each argument.
| Problem< F, CLIST >::scales_t & roboptim::Problem< F, CLIST >::argumentScales | ( | ) | ||
| throw | ( | |||
| ) | ||||
Retrieve arguments scales.
Arguments scales define which scale is applied for each argument.
| const Problem< F, CLIST >::scales_t & roboptim::Problem< F, CLIST >::argumentScales | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Retrieve arguments scales.
Arguments scales define which scale is applied for each argument.
| const Problem< F, CLIST >::intervalsVect_t & roboptim::Problem< F, CLIST >::boundsVector | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Retrieve constraints bounds vector.
| const Problem< F, CLIST >::constraints_t & roboptim::Problem< F, CLIST >::constraints | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Retrieve constraints.
| const Problem< F, boost::mpl::vector<> >::function_t & roboptim::Problem< F, boost::mpl::vector<> >::function | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Retrieve cost function.
| const Problem< F, CLIST >::function_t & roboptim::Problem< F, CLIST >::function | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Retrieve cost function.
| std::ostream & roboptim::operator<< | ( | std::ostream & | o, |
| const Parameter & | parameter | ||
| ) |
Override operator<< to display ``parameters'' objects.
| o | output stream used for display |
| ns | NoSolution object, ignored |
References roboptim::Parameter::description.
| std::ostream & roboptim::operator<< | ( | std::ostream & | o, |
| const Problem< F, boost::mpl::vector<> > & | pb | ||
| ) |
Override operator<< to handle problem display.
| o | output stream used for display |
| pb | problem to be displayed |
| std::ostream & roboptim::operator<< | ( | std::ostream & | o, |
| const Problem< F, CLIST > & | pb | ||
| ) |
Override operator<< to handle problem display.
| o | output stream used for display |
| pb | problem to be displayed |
| std::ostream & roboptim::Problem< F, boost::mpl::vector<> >::print | ( | std::ostream & | o | ) | const |
| throw | ( | ||||
| ) | |||||
Display the problem on the specified output stream.
| o | output stream used for display |
References roboptim::decindent(), roboptim::iendl(), roboptim::incendl(), roboptim::GenericFunction< T >::infinity(), roboptim::fg::reset(), and roboptim::fg::warn().
| std::ostream & roboptim::Problem< F, CLIST >::print | ( | std::ostream & | o | ) | const |
| throw | ( | ||||
| ) | |||||
Display the problem on the specified output stream.
| o | output stream used for display |
References roboptim::decindent(), roboptim::iendl(), roboptim::incendl(), roboptim::GenericFunction< T >::infinity(), roboptim::fg::ok(), roboptim::fg::reset(), and roboptim::fg::warn().
|
explicit | ||||||||||||||
References roboptim::GenericFunction< T >::makeInfiniteInterval().
|
explicit | ||||||||||||||
Copy constructor.
|
explicit | ||||||||||||||
Copy constructor (convert from another class of problem).
|
explicit | ||||||||||||||
References roboptim::GenericFunction< T >::makeInfiniteInterval().
|
explicit | ||||||||||||||
Copy constructor.
|
explicit | ||||||||||||||
Copy constructor (convert from another class of problem).
| const Problem< F, CLIST >::scalesVect_t & roboptim::Problem< F, CLIST >::scalesVector | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Retrieve constraints scales vector.
| Problem< F, boost::mpl::vector<> >::startingPoint_t & roboptim::Problem< F, boost::mpl::vector<> >::startingPoint | ( | ) | ||
| throw | ( | |||
| ) | ||||
Set the initial guess.
| const Problem< F, boost::mpl::vector<> >::startingPoint_t & roboptim::Problem< F, boost::mpl::vector<> >::startingPoint | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Get the initial guess.
| Problem< F, CLIST >::startingPoint_t & roboptim::Problem< F, CLIST >::startingPoint | ( | ) | ||
| throw | ( | |||
| ) | ||||
Set the initial guess.
| const Problem< F, CLIST >::startingPoint_t & roboptim::Problem< F, CLIST >::startingPoint | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Get the initial guess.
| roboptim::Problem< F, boost::mpl::vector<> >::~Problem | ( | ) | ||
| throw | ( | |||
| ) | ||||
| roboptim::Problem< F, CLIST >::~Problem | ( | ) | ||
| throw | ( | |||
| ) | ||||
|
friend |
|
friend |