All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
roboptim::trajectory::Freeze< P > Class Template Reference

Freeze parameters by modifying argument bounds. More...

#include <roboptim/trajectory/freeze.hh>

Public Types

typedef std::pair
< Function::size_type,
Function::value_type > 
frozenArgument_t
 Pair representing an argument index and a value. More...
 
typedef P problem_t
 Problem type. More...
 
typedef std::vector
< frozenArgument_t
frozenArguments_t
 Vector of pairs (argument index, value). More...
 

Public Member Functions

 Freeze (problem_t &problem)
 Create the argument bounds from a vector of pairs. More...
 
virtual ~Freeze ()
 
void operator() (const frozenArguments_t fa)
 Apply modification. More...
 
void operator() (const std::vector< Function::size_type > &indices, Function::const_vector_ref values)
 Apply modification. More...
 

Detailed Description

template<typename P>
class roboptim::trajectory::Freeze< P >

Freeze parameters by modifying argument bounds.

This helper class expects a vector of pairs (argument id, value) to freeze the given arguments to their associated value.

For instance, the vector: [(0, 5.), (3, -12.)] forces the first parameter to 5 and the fourth one to -12.

This modifies the argument bounds for each frozen parameter.

Member Typedef Documentation

template<typename P >
typedef std::pair<Function::size_type, Function::value_type> roboptim::trajectory::Freeze< P >::frozenArgument_t

Pair representing an argument index and a value.

template<typename P >
typedef std::vector<frozenArgument_t> roboptim::trajectory::Freeze< P >::frozenArguments_t

Vector of pairs (argument index, value).

This type defines which arguments to freeze and their associated values.

template<typename P >
typedef P roboptim::trajectory::Freeze< P >::problem_t

Problem type.

Constructor & Destructor Documentation

template<typename P >
roboptim::trajectory::Freeze< P >::Freeze ( problem_t problem)

Create the argument bounds from a vector of pairs.

Parameters
problemproblem that will be modified.
template<typename P >
roboptim::trajectory::Freeze< P >::~Freeze ( )
virtual

Member Function Documentation

template<typename P >
void roboptim::trajectory::Freeze< P >::operator() ( const frozenArguments_t  fa)

Apply modification.

Parameters
faVector of pairs containing what to freeze and to what value.
template<typename P >
void roboptim::trajectory::Freeze< P >::operator() ( const std::vector< Function::size_type > &  indices,
Function::const_vector_ref  values 
)

Apply modification.

Parameters
indicesVector of parameters index that will be frozen.
valuesVector of parameters values.