roboptim::trajectory::VectorInterpolation Class Reference

Takes a vector or argument and differentiate it. More...

#include <roboptim/trajectory/vector-interpolation.hh>

Inheritance diagram for roboptim::trajectory::VectorInterpolation:
roboptim::trajectory::Trajectory< 3 > NTimesDerivableFunction

List of all members.

Public Types

typedef boost::shared_ptr
< VectorInterpolation
VectorInterpolationShPtr_t

Public Member Functions

 ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS (Trajectory< 3 >)
 ROBOPTIM_IMPLEMENT_CLONE (VectorInterpolation)
 VectorInterpolation (const_vector_ref x, size_type outputSize, value_type dt)
 Vector interpolation constructor.
 ~VectorInterpolation ()
 VectorInterpolation (const VectorInterpolation &vi)
void setParameters (const vector_t &)
 Store parameters and update coefficients.
size_type numFrames () const
jacobian_t variationConfigWrtParam (double t) const
 Get the variation of a configuration with respect to parameter vector.
jacobian_t variationDerivWrtParam (double t, size_type order) const
 Get the variation of a derivative with respect to parameter vector.
value_type singularPointAtRank (size_type rank) const
 Get singular point at given rank.
vector_t derivBeforeSingularPoint (size_type rank, size_type order) const
 Get left limit value of derivative at given singular point.
vector_t derivAfterSingularPoint (size_type rank, size_type order) const
 Get right limit value of derivative at given singular point.
jacobian_t variationConfigWrtParam (StableTimePoint tp) const
jacobian_t variationDerivWrtParam (StableTimePoint tp, size_type order) const
boost::shared_ptr
< VectorInterpolation
trim (size_type start, size_type length) const
 Instantiate a trajectory corresponding to a sub-part of this trajectory.

Protected Member Functions

void impl_compute (result_ref result, double t) const
void impl_derivative (gradient_ref derivative, double argument, size_type order=1) const
void impl_derivative (gradient_ref g, StableTimePoint, size_type order) const
Trajectory< 3 > * resize (interval_t timeRange) const
 Clone and resize a trajectory.

Detailed Description

Takes a vector or argument and differentiate it.

It is common to have an optimization vector where a pattern is repeated:

[x_0^0 ... x_N^0 ... x_0^M x_N^M]

The pattern is here of length N and repeated M times.

By using numerical interpolation, it is possible to differentiate this pattern.

A classical example are trajectories.


Member Typedef Documentation


Constructor & Destructor Documentation

roboptim::trajectory::VectorInterpolation::VectorInterpolation ( const_vector_ref  x,
size_type  outputSize,
value_type  dt 
) [inline, explicit]

Vector interpolation constructor.

Exceptions:
std::runtime_error

Member Function Documentation

VectorInterpolation::vector_t roboptim::trajectory::VectorInterpolation::derivAfterSingularPoint ( size_type  rank,
size_type  order 
) const [inline, virtual]

Get right limit value of derivative at given singular point.

Parameters:
rankrank of the singular points.
orderorder of derivation.
Return values:
derivativeLimit of the derivative at singular point for decreasing parameter values.

Implements roboptim::trajectory::Trajectory< 3 >.

VectorInterpolation::vector_t roboptim::trajectory::VectorInterpolation::derivBeforeSingularPoint ( size_type  rank,
size_type  order 
) const [inline, virtual]

Get left limit value of derivative at given singular point.

Parameters:
rankrank of the singular points.
orderorder of derivation.
Returns:
Limit of the derivative at singular point for increasing parameter values.

Implements roboptim::trajectory::Trajectory< 3 >.

void roboptim::trajectory::VectorInterpolation::impl_compute ( result_ref  result,
double  t 
) const [inline, protected]
void roboptim::trajectory::VectorInterpolation::impl_derivative ( gradient_ref  derivative,
double  argument,
size_type  order = 1 
) const [inline, protected]
void roboptim::trajectory::VectorInterpolation::impl_derivative ( gradient_ref  g,
StableTimePoint  stp,
size_type  order 
) const [inline, protected, virtual]
VectorInterpolation::size_type roboptim::trajectory::VectorInterpolation::numFrames ( ) const [inline]
Trajectory< 3 > * roboptim::trajectory::VectorInterpolation::resize ( interval_t  timeRange) const [inline, protected, virtual]

Clone and resize a trajectory.

Implements roboptim::trajectory::Trajectory< 3 >.

void roboptim::trajectory::VectorInterpolation::setParameters ( const vector_t &  x) [inline, virtual]

Store parameters and update coefficients.

Parameters:
vector_tvector of parameters.
Exceptions:
std::runtime_error

Reimplemented from roboptim::trajectory::Trajectory< 3 >.

References roboptim::trajectory::Trajectory< 3 >::parameters(), and roboptim::trajectory::Trajectory< 3 >::singularPoints_.

Referenced by VectorInterpolation().

VectorInterpolation::value_type roboptim::trajectory::VectorInterpolation::singularPointAtRank ( size_type  rank) const [inline, virtual]

Get singular point at given rank.

Implements roboptim::trajectory::Trajectory< 3 >.

boost::shared_ptr< VectorInterpolation > roboptim::trajectory::VectorInterpolation::trim ( size_type  start,
size_type  length 
) const [inline]

Instantiate a trajectory corresponding to a sub-part of this trajectory.

This function can be called to exclude some frames at the beginning and/or the end of the trajectory.

Parameters:
[in]startstarting frame (0 is the first frame)
[out]lengthlength of the output trajectory (0 means maximum length)
Returns:
build sub-trajectory (data are copied)

References numFrames(), and roboptim::trajectory::Trajectory< 3 >::parameters().

VectorInterpolation::jacobian_t roboptim::trajectory::VectorInterpolation::variationConfigWrtParam ( double  t) const [inline, virtual]

Get the variation of a configuration with respect to parameter vector.

Parameters:
tvalue $t$ in the definition interval.
Returns:
Jacobian:

\[\frac{\partial\Gamma_{\textbf{p}}(t)}{\partial\textbf{p}}\]

Implements roboptim::trajectory::Trajectory< 3 >.

References variationDerivWrtParam().

VectorInterpolation::jacobian_t roboptim::trajectory::VectorInterpolation::variationDerivWrtParam ( double  t,
size_type  order 
) const [inline, virtual]

Get the variation of a derivative with respect to parameter vector.

Parameters:
tvalue $t$ in the definition interval.
orderorder $r$ of the derivative.
Returns:
jacobian

\[ \frac{\partial}{\partial\textbf{p}} \left(\frac{d^r\Gamma_{\textbf{p}}}{dt^r}(t)\right) \]

Implements roboptim::trajectory::Trajectory< 3 >.

References roboptim::trajectory::Trajectory< 3 >::parameters().

Referenced by variationConfigWrtParam().

VectorInterpolation::jacobian_t roboptim::trajectory::VectorInterpolation::variationDerivWrtParam ( StableTimePoint  tp,
size_type  order 
) const [inline, virtual]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines