#include <roboptim/core/problem.hh>
Classes | |
| struct | NoopDeleter |
| Custom deleter that does not delete anything. | |
Public Types | |
| typedef GenericFunction< T > | function_t |
| Function type. | |
| typedef boost::mpl::vector < function_t > | constraintsList_t |
| Constraints types list. | |
| typedef boost::shared_ptr < function_t > | constraint_t |
| Constraint's type. | |
| typedef function_t::value_type | value_type |
| Import function's value_type type. | |
| typedef function_t::vector_t | vector_t |
| Vector type. | |
| typedef function_t::argument_t | argument_t |
| Argument type. | |
| typedef function_t::size_type | size_type |
| Size type. | |
| typedef std::vector< constraint_t > | constraints_t |
| Constraints are represented as a vector of constraints. | |
| typedef boost::optional < argument_t > | startingPoint_t |
| Optional vector defines a starting point. | |
| typedef function_t::interval_t | interval_t |
| Interval type (e.g. for bounds). | |
| typedef function_t::intervals_t | intervals_t |
| Intervals type. | |
| typedef std::vector< value_type > | scaling_t |
| Scaling vector. | |
| typedef scaling_t scales_t | ROBOPTIM_CORE_DEPRECATED |
| Scaling vector (deprecated typedef) | |
| typedef function_t::names_t | names_t |
| Vector of names (e.g. for arguments). | |
| typedef std::vector< intervals_t > | intervalsVect_t |
| Vector of interval vectors. | |
| typedef std::vector< scaling_t > | scalingVect_t |
| Vector of scaling vectors. | |
| typedef scalingVect_t scalesVect_t | ROBOPTIM_CORE_DEPRECATED |
| Vector of scaling vectors (deprecated typedef). | |
| typedef GenericFunctionTraits < T >::jacobian_t | jacobian_t |
| Jacobian matrix type. | |
| typedef GenericFunctionTraits < T >::const_argument_ref | const_argument_ref |
| Constant reference to an argument vector. | |
Public Member Functions | |
| std::ostream & | print (std::ostream &o) const |
| Display the problem on the specified output stream. | |
| template<> | |
| Problem< EigenMatrixSparse > ::jacobian_t | jacobian (const_argument_ref x) const |
Constructors and destructors. | |
| Problem (const boost::shared_ptr< const function_t > &cost) | |
| Constructor taking a shared_ptr to a cost function. | |
| Problem (const function_t &cost) ROBOPTIM_CORE_DEPRECATED | |
| Deprecated constructor taking a reference to a cost function. | |
| Problem (const Problem< T > &pb) | |
| Copy constructor. | |
| virtual | ~Problem () |
| Virtual destructor. | |
Cost function. | |
| const function_t & | function () const |
| Retrieve cost function. | |
| intervals_t & | argumentBounds () |
| Retrieve arguments bounds. | |
| const intervals_t & | argumentBounds () const |
| Retrieve arguments bounds. | |
| scaling_t & | argumentScaling () |
| Retrieve arguments scaling. | |
| const scaling_t & | argumentScaling () const |
| Retrieve arguments scaling. | |
| scales_t & | argumentScales () ROBOPTIM_CORE_DEPRECATED |
| Retrieve arguments scaling (deprecated version). | |
| const scales_t & | argumentScales () const ROBOPTIM_CORE_DEPRECATED |
| Retrieve arguments scaling (deprecated version). | |
| names_t & | argumentNames () |
| Retrieve arguments names. | |
| const names_t & | argumentNames () const |
| Retrieve arguments names. | |
Constraints. | |
| const constraints_t & | constraints () const |
| Retrieve constraints. | |
| void | addConstraint (boost::shared_ptr< function_t > constraint, interval_t interval, value_type scale=1.) |
| Add a constraint to the problem. | |
| void | addConstraint (boost::shared_ptr< function_t > constraint, intervals_t intervals, scaling_t scaling) |
| Add a constraint to the problem. | |
| const intervalsVect_t & | boundsVector () const |
| Retrieve constraints bounds vector. | |
| const scalingVect_t & | scalingVector () const |
| Retrieve constraints scaling vector. | |
| const scalesVect_t & | scalesVector () const ROBOPTIM_CORE_DEPRECATED |
| Retrieve constraints scaling vector (deprecated version). | |
| size_type | constraintsOutputSize () const |
| Return the output size of the problem's constraints. | |
| size_type | differentiableConstraintsOutputSize () const |
| Return the output size of the problem's differentiable constraints. | |
| void | clearConstraints () |
| Clear the constraints from the problem. | |
Starting point (initial guess). | |
| startingPoint_t & | startingPoint () |
| Set the initial guess. | |
| const startingPoint_t & | startingPoint () const |
| Get the initial guess. | |
Helper methods. | |
| jacobian_t | jacobian (const_argument_ref x) const |
| Evaluate the Jacobian matrix of the problem for a given x. | |
| typedef function_t::argument_t roboptim::Problem< T >::argument_t |
Argument type.
| typedef GenericFunctionTraits<T>::const_argument_ref roboptim::Problem< T >::const_argument_ref |
Constant reference to an argument vector.
| typedef boost::shared_ptr<function_t> roboptim::Problem< T >::constraint_t |
Constraint's type.
| typedef std::vector<constraint_t> roboptim::Problem< T >::constraints_t |
Constraints are represented as a vector of constraints.
| typedef boost::mpl::vector<function_t> roboptim::Problem< T >::constraintsList_t |
Constraints types list.
| typedef GenericFunction<T> roboptim::Problem< T >::function_t |
Function type.
This has to be either Function or one of its sub-classes.
| typedef function_t::interval_t roboptim::Problem< T >::interval_t |
Interval type (e.g. for bounds).
| typedef function_t::intervals_t roboptim::Problem< T >::intervals_t |
Intervals type.
| typedef std::vector<intervals_t> roboptim::Problem< T >::intervalsVect_t |
Vector of interval vectors.
This type is used to take into account the fact that constraints can have output values in \(\mathbb{C}^{m}\).
If \(m=1\), then the associated interval vector contains only one element of interval_t type.
| typedef GenericFunctionTraits<T>::jacobian_t roboptim::Problem< T >::jacobian_t |
Jacobian matrix type.
| typedef function_t::names_t roboptim::Problem< T >::names_t |
Vector of names (e.g. for arguments).
| typedef scaling_t scales_t roboptim::Problem< T >::ROBOPTIM_CORE_DEPRECATED |
Scaling vector (deprecated typedef)
| typedef scalingVect_t scalesVect_t roboptim::Problem< T >::ROBOPTIM_CORE_DEPRECATED |
Vector of scaling vectors (deprecated typedef).
| typedef std::vector<value_type> roboptim::Problem< T >::scaling_t |
Scaling vector.
| typedef std::vector<scaling_t> roboptim::Problem< T >::scalingVect_t |
Vector of scaling vectors.
This type is used to take into account the fact that constraints can have output values in \(\mathbb{R}^m\).
If \(m=1\), then the associated scaling vector contains only one element of scaling_t type.
| typedef function_t::size_type roboptim::Problem< T >::size_type |
Size type.
| typedef boost::optional<argument_t> roboptim::Problem< T >::startingPoint_t |
Optional vector defines a starting point.
| typedef function_t::value_type roboptim::Problem< T >::value_type |
Import function's value_type type.
| typedef function_t::vector_t roboptim::Problem< T >::vector_t |
Vector type.
| roboptim::Problem< T >::Problem | ( | const boost::shared_ptr< const function_t > & | cost | ) | [explicit] |
Constructor taking a shared_ptr to a cost function.
| cost | cost function. |
| roboptim::Problem< T >::Problem | ( | const function_t & | cost | ) | [explicit] |
Deprecated constructor taking a reference to a cost function.
This legacy version meant that we simply kept a const reference to the cost function, which could reference stack variables... This prepares the transition to something safer (shared_ptr).
| cost | cost function. |
| roboptim::Problem< T >::Problem | ( | const Problem< T > & | pb | ) | [explicit] |
Copy constructor.
| pb | problem to copy. |
| roboptim::Problem< T >::~Problem | ( | ) | [virtual] |
Virtual destructor.
One may want to inherit from Problem to provide extra information to a solver plugin.
| void roboptim::Problem< T >::addConstraint | ( | boost::shared_ptr< function_t > | constraint, |
| interval_t | interval, | ||
| value_type | scale = 1. |
||
| ) |
Add a constraint to the problem.
Useful only when \(m=1\), use addConstraint (boost::shared_ptr<C> constraint, intervals_t intervals, scaling_t scaling) instead.
| constraint | the constraint that will be added |
| interval | interval in which the constraint is satisfied |
| scale | constraint scale |
| std::runtime_error |
| void roboptim::Problem< T >::addConstraint | ( | boost::shared_ptr< function_t > | constraint, |
| intervals_t | intervals, | ||
| scaling_t | scaling | ||
| ) |
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 |
| scaling | constraint scaling |
| std::runtime_error |
References ROBOPTIM_DEBUG_ONLY.
| Problem< T >::intervals_t & roboptim::Problem< T >::argumentBounds | ( | ) |
Retrieve arguments bounds.
Arguments bounds define in which interval each argument is valid.
| const Problem< T >::intervals_t & roboptim::Problem< T >::argumentBounds | ( | ) | const |
Retrieve arguments bounds.
Arguments bounds define in which interval each argument is valid.
| Problem< T >::names_t & roboptim::Problem< T >::argumentNames | ( | ) |
Retrieve arguments names.
Arguments names define a name for each argument. This is particularly useful when logging data.
| const Problem< T >::names_t & roboptim::Problem< T >::argumentNames | ( | ) | const |
Retrieve arguments names.
Arguments names define a name for each argument. This is particularly useful when logging data.
| Problem< T >::scales_t & roboptim::Problem< T >::argumentScales | ( | ) |
Retrieve arguments scaling (deprecated version).
| const Problem< T >::scales_t & roboptim::Problem< T >::argumentScales | ( | ) | const |
Retrieve arguments scaling (deprecated version).
| Problem< T >::scaling_t & roboptim::Problem< T >::argumentScaling | ( | ) |
Retrieve arguments scaling.
Arguments scaling define which scale factor is applied for each argument.
| const Problem< T >::scaling_t & roboptim::Problem< T >::argumentScaling | ( | ) | const |
Retrieve arguments scaling.
Arguments scaling define which scale factor is applied for each argument.
| const Problem< T >::intervalsVect_t & roboptim::Problem< T >::boundsVector | ( | ) | const |
Retrieve constraints bounds vector.
| void roboptim::Problem< T >::clearConstraints | ( | ) |
Clear the constraints from the problem.
| const Problem< T >::constraints_t & roboptim::Problem< T >::constraints | ( | ) | const |
Retrieve constraints.
| Problem< T >::size_type roboptim::Problem< T >::constraintsOutputSize | ( | ) | const |
Return the output size of the problem's constraints.
| Problem< T >::size_type roboptim::Problem< T >::differentiableConstraintsOutputSize | ( | ) | const |
Return the output size of the problem's differentiable constraints.
| const Problem< T >::function_t & roboptim::Problem< T >::function | ( | ) | const |
Retrieve cost function.
| Problem< T >::jacobian_t roboptim::Problem< T >::jacobian | ( | const_argument_ref | x | ) | const |
Evaluate the Jacobian matrix of the problem for a given x.
Note: this is a helper method, and is not supposed to be used in any critical loop.
| x | evaluation point. |
References roboptim::GenericFunction< T >::inputSize().
| Problem< EigenMatrixSparse >::jacobian_t roboptim::Problem< EigenMatrixSparse >::jacobian | ( | const_argument_ref | x | ) | const [inline] |
References roboptim::GenericFunction< T >::inputSize().
| std::ostream & roboptim::Problem< T >::print | ( | std::ostream & | o | ) | const |
Display the problem on the specified output stream.
| o | output stream used for display |
References roboptim::decindent(), roboptim::fg::fail(), roboptim::iendl(), roboptim::incendl(), roboptim::fg::ok(), roboptim::fg::reset(), and roboptim::fg::warn().
| const Problem< T >::scalesVect_t & roboptim::Problem< T >::scalesVector | ( | ) | const |
Retrieve constraints scaling vector (deprecated version).
| const Problem< T >::scalingVect_t & roboptim::Problem< T >::scalingVector | ( | ) | const |
Retrieve constraints scaling vector.
| Problem< T >::startingPoint_t & roboptim::Problem< T >::startingPoint | ( | ) |
Set the initial guess.
| std::runtime_error |
| const Problem< T >::startingPoint_t & roboptim::Problem< T >::startingPoint | ( | ) | const |
Get the initial guess.
| std::runtime_error |