Loading...
Searching...
No Matches
roboptim::Problem< F, boost::mpl::vector<> > Class Template Reference

#include <roboptim/core/problem.hh>

Public Types

typedef boost::mpl::vector constraintsList_t
 
typedef F function_t
 Function type.
 
typedef function_t::value_type value_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 boost::optional< argument_tstartingPoint_t
 Optional vector defines a starting point.
 
typedef function_t::interval_t interval_t
 
typedef function_t::intervals_t intervals_t
 
typedef std::vector< value_typescaling_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 detail::list_converter< boost::mpl::vector<> >::type constraintsList_t
 Constraints types list.
 
typedef F function_t
 Function type.
 
typedef detail::shared_ptr_variant< constraintsList_t >::type 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_tconstraints_t
 Constraints are represented as a vector of constraints.
 
typedef boost::optional< argument_tstartingPoint_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_typescaling_t
 Scaling vector.
 
typedef scaling_t scales_t ROBOPTIM_CORE_DEPRECATED
 Scaling vector (deprecated typedef)
 
typedef scalingVect_t scalesVect_t ROBOPTIM_CORE_DEPRECATED
 Vector of scaling vectors (deprecated typedef).
 
typedef function_t::names_t names_t
 Vector of names (e.g. for arguments).
 
typedef std::vector< intervals_tintervalsVect_t
 Vector of interval vectors.
 
typedef std::vector< scaling_tscalingVect_t
 Vector of scaling vectors.
 

Public Member Functions

std::ostream & print (std::ostream &o) const
 Display the problem on the specified output stream.
 
std::ostream & print (std::ostream &o) const
 Display the problem on the specified output stream.
 
Constructors and destructors.
 Problem (const function_t &)
 
 Problem (const Problem< F, boost::mpl::vector<> > &)
 Copy constructor.
 
template<typename F_>
 Problem (const Problem< F_, boost::mpl::vector<> > &)
 Copy constructor (convert from another class of problem).
 
virtual ~Problem ()
 Virtual destructor.
 
Cost function.
const function_tfunction () const
 Retrieve cost function.
 
intervals_targumentBounds ()
 Retrieve arguments bounds.
 
const intervals_targumentBounds () const
 Retrieve arguments bounds.
 
scaling_targumentScaling ()
 Retrieve arguments scaling.
 
const scaling_targumentScaling () 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_targumentNames ()
 Retrieve arguments names.
 
const names_targumentNames () const
 Retrieve arguments names.
 
Starting point (initial guess).
startingPoint_tstartingPoint ()
 Set the initial guess.
 
const startingPoint_tstartingPoint () const
 Get the initial guess.
 
Constructors and destructors.
 Problem (const function_t &cost)
 
 Problem (const Problem< F, boost::mpl::vector<> > &pb)
 Copy constructor.
 
 Problem (const Problem< F_, CLIST_ > &pb)
 Copy constructor (convert from another class of problem).
 
virtual ~Problem ()
 Virtual destructor.
 
Cost function.
const function_tfunction () const
 Retrieve cost function.
 
intervals_targumentBounds ()
 Retrieve arguments bounds.
 
const intervals_targumentBounds () const
 Retrieve arguments bounds.
 
scaling_targumentScaling ()
 Retrieve arguments scaling.
 
const scaling_targumentScaling () 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_targumentNames ()
 Retrieve arguments names.
 
const names_targumentNames () const
 Retrieve arguments names.
 
Constraints.
const constraints_tconstraints () const
 Retrieve constraints.
 
void addConstraint (boost::shared_ptr< C > constraint, interval_t interval, value_type scale=1.)
 Add a constraint to the problem.
 
void addConstraint (boost::shared_ptr< C > constraint, intervals_t intervals, scaling_t scaling)
 Add a constraint to the problem.
 
const intervalsVect_tboundsVector () const
 Retrieve constraints bounds vector.
 
const scalingVect_tscalingVector () const
 Retrieve constraints scaling vector.
 
const scalesVect_t & scalesVector () const ROBOPTIM_CORE_DEPRECATED
 Retrieve constraints scaling vector (deprecated version).
 
Starting point (initial guess).
startingPoint_tstartingPoint ()
 Set the initial guess.
 
const startingPoint_tstartingPoint () const
 Get the initial guess.
 

Friends

template<typename F_, typename CLIST_>
class Problem
 
class Problem
 

Member Typedef Documentation

◆ argument_t

typedef function_t::argument_t roboptim::Problem< F, boost::mpl::vector<> >::argument_t

Argument type.

◆ constraint_t

typedef detail::shared_ptr_variant<constraintsList_t>::type roboptim::Problem< F, boost::mpl::vector<> >::constraint_t

Constraint's type.

Generate a Boost.Variant of shared pointers from the static constraints types list.

◆ constraints_t

typedef std::vector<constraint_t> roboptim::Problem< F, boost::mpl::vector<> >::constraints_t

Constraints are represented as a vector of constraints.

◆ constraintsList_t

typedef detail::list_converter<boost::mpl::vector<>>::type roboptim::Problem< F, boost::mpl::vector<> >::constraintsList_t

Constraints types list.

CLIST is converted to a boost::mpl::vector to ensure a similar behavior for codes using different random access sequences (vector, list, etc.).

◆ function_t

typedef F roboptim::Problem< F, boost::mpl::vector<> >::function_t

Function type.

This has to be either Function or one of its sub-classes.

◆ interval_t

typedef function_t::interval_t roboptim::Problem< F, boost::mpl::vector<> >::interval_t

Interval type (e.g. for bounds).

◆ intervals_t

typedef function_t::intervals_t roboptim::Problem< F, boost::mpl::vector<> >::intervals_t

Intervals type.

◆ intervalsVect_t

typedef std::vector<intervals_t> roboptim::Problem< F, boost::mpl::vector<> >::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.

◆ names_t

typedef function_t::names_t roboptim::Problem< F, boost::mpl::vector<> >::names_t

Vector of names (e.g. for arguments).

◆ ROBOPTIM_CORE_DEPRECATED [1/2]

typedef scaling_t scales_t roboptim::Problem< F, boost::mpl::vector<> >::ROBOPTIM_CORE_DEPRECATED

Scaling vector (deprecated typedef)

◆ ROBOPTIM_CORE_DEPRECATED [2/2]

typedef scalingVect_t scalesVect_t roboptim::Problem< F, boost::mpl::vector<> >::ROBOPTIM_CORE_DEPRECATED

Vector of scaling vectors (deprecated typedef).

◆ scaling_t

typedef std::vector<value_type> roboptim::Problem< F, boost::mpl::vector<> >::scaling_t

Scaling vector.

◆ scalingVect_t

typedef std::vector<scaling_t> roboptim::Problem< F, boost::mpl::vector<> >::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.

◆ size_type

typedef function_t::size_type roboptim::Problem< F, boost::mpl::vector<> >::size_type

Size type.

◆ startingPoint_t

typedef boost::optional<argument_t> roboptim::Problem< F, boost::mpl::vector<> >::startingPoint_t

Optional vector defines a starting point.

◆ value_type

typedef function_t::value_type roboptim::Problem< F, boost::mpl::vector<> >::value_type

Import function's value_type type.

◆ vector_t

typedef function_t::vector_t roboptim::Problem< F, boost::mpl::vector<> >::vector_t

Vector type.

Constructor & Destructor Documentation

◆ Problem() [1/3]

roboptim::Problem< F, boost::mpl::vector<> >::Problem ( const function_t & cost)
explicit
Precondition
costfunction $\mathbb{R}^n \rightarrow \mathbb{R}$
Parameters
costcost function.

◆ Problem() [2/3]

roboptim::Problem< F, boost::mpl::vector<> >::Problem ( const Problem< F, boost::mpl::vector<> > & pb)
explicit

Copy constructor.

Parameters
pbproblem to copy.

◆ Problem() [3/3]

roboptim::Problem< F, boost::mpl::vector<> >::Problem ( const Problem< F_, CLIST_ > & pb)
explicit

Copy constructor (convert from another class of problem).

Parameters
pbproblem to copy and convert.

◆ ~Problem()

roboptim::Problem< F, boost::mpl::vector<> >::~Problem ( )
virtual

Virtual destructor.

One may want to inherit from Problem to provide extra information to a solver plugin.

Member Function Documentation

◆ addConstraint() [1/2]

void roboptim::Problem< F, boost::mpl::vector<> >::addConstraint ( boost::shared_ptr< C > 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.

Parameters
constraintthe constraint that will be added
intervalinterval in which the constraint is satisfied
scaleconstraint scale
Template Parameters
Cconstraint type (has to be in CLIST)
Exceptions
std::runtime_error

◆ addConstraint() [2/2]

void roboptim::Problem< F, boost::mpl::vector<> >::addConstraint ( boost::shared_ptr< C > constraint,
intervals_t intervals,
scaling_t scaling )

Add a constraint to the problem.

The constraint can be multidimensional.

Parameters
constraintthe constraint that will be added
intervalsinterval vector in which the constraint is satisfied
scalingconstraint scaling
Template Parameters
Cconstraint type (has to be in CLIST)
Exceptions
std::runtime_error

◆ argumentBounds() [1/2]

Problem< F, boost::mpl::vector<> >::intervals_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentBounds ( )

Retrieve arguments bounds.

Arguments bounds define in which interval each argument is valid.

Returns
arguments bounds

◆ argumentBounds() [2/2]

const Problem< F, boost::mpl::vector<> >::intervals_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentBounds ( ) const

Retrieve arguments bounds.

Arguments bounds define in which interval each argument is valid.

Returns
arguments bounds

◆ argumentNames() [1/2]

Problem< F, boost::mpl::vector<> >::names_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentNames ( )

Retrieve arguments names.

Arguments names define a name for each argument. This is particularly useful when logging data.

Returns
arguments names

◆ argumentNames() [2/2]

const Problem< F, boost::mpl::vector<> >::names_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentNames ( ) const

Retrieve arguments names.

Arguments names define a name for each argument. This is particularly useful when logging data.

Returns
arguments names

◆ argumentScales() [1/2]

const Problem< F, boost::mpl::vector<> >::scales_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentScales ( ) const

Retrieve arguments scaling (deprecated version).

◆ argumentScales() [2/2]

Problem< F, boost::mpl::vector<> >::scales_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentScales ( )

Retrieve arguments scaling (deprecated version).

◆ argumentScaling() [1/2]

Problem< F, boost::mpl::vector<> >::scaling_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentScaling ( )

Retrieve arguments scaling.

Arguments scaling define which scale factor is applied for each argument.

Returns
arguments scaling

◆ argumentScaling() [2/2]

const Problem< F, boost::mpl::vector<> >::scaling_t & roboptim::Problem< F, boost::mpl::vector<> >::argumentScaling ( ) const

Retrieve arguments scaling.

Arguments scaling define which scale factor is applied for each argument.

Returns
arguments scaling

◆ boundsVector()

const Problem< F, boost::mpl::vector<> >::intervalsVect_t & roboptim::Problem< F, boost::mpl::vector<> >::boundsVector ( ) const

Retrieve constraints bounds vector.

Returns
constraints bounds vector

◆ constraints()

const Problem< F, boost::mpl::vector<> >::constraints_t & roboptim::Problem< F, boost::mpl::vector<> >::constraints ( ) const

Retrieve constraints.

Returns
constraints

◆ function()

const Problem< F, boost::mpl::vector<> >::function_t & roboptim::Problem< F, boost::mpl::vector<> >::function ( ) const

Retrieve cost function.

Returns
cost function

◆ print()

std::ostream & roboptim::Problem< F, boost::mpl::vector<> >::print ( std::ostream & o) const

Display the problem on the specified output stream.

Parameters
ooutput stream used for display
Returns
output stream

◆ scalesVector()

const Problem< F, boost::mpl::vector<> >::scalesVect_t & roboptim::Problem< F, boost::mpl::vector<> >::scalesVector ( ) const

Retrieve constraints scaling vector (deprecated version).

◆ scalingVector()

const Problem< F, boost::mpl::vector<> >::scalingVect_t & roboptim::Problem< F, boost::mpl::vector<> >::scalingVector ( ) const

Retrieve constraints scaling vector.

Returns
constraints scaling vector

◆ startingPoint() [1/2]

Problem< F, boost::mpl::vector<> >::startingPoint_t & roboptim::Problem< F, boost::mpl::vector<> >::startingPoint ( )

Set the initial guess.

Returns
reference on the initial guess
Exceptions
std::runtime_error

◆ startingPoint() [2/2]

const Problem< F, boost::mpl::vector<> >::startingPoint_t & roboptim::Problem< F, boost::mpl::vector<> >::startingPoint ( ) const

Get the initial guess.

Returns
reference on the initial guess
Exceptions
std::runtime_error

Friends And Related Symbol Documentation

◆ Problem

friend class Problem
friend