roboptim::ParametrizedFunction< F > Class Template Reference

Define an abstract parametrized mathematical function ( $C^0$). More...

#include <roboptim/core/parametrized-function.hh>

Inheritance diagram for roboptim::ParametrizedFunction< F >:

List of all members.

Public Types

typedef F::value_type value_type
 Import value type.
typedef F::size_type size_type
 Import size type.
typedef F::vector_t vector_t
 Import vector type.
typedef F::matrix_t matrix_t
 Import matrix type.
typedef F result_t
 Import result type.
typedef F::argument_t argument_t
 Import argument type.

Public Member Functions

result_t operator() (const argument_t &argument) const throw ()
 Evaluate the function at a specified point.
size_type inputSize () const throw ()
 Return the input size (i.e.
size_type functionInputSize () const throw ()
 Return the function's input size (i.e.
size_type functionOutputSize () const throw ()
 Return the function's output size (i.e.
virtual std::ostream & print (std::ostream &) const throw ()
 Display the function on the specified output stream.

Protected Member Functions

 ParametrizedFunction (size_type inputSize, size_type functionInputSize, size_type functionOutputSize) throw ()
 Concrete class constructor should call this constructor.
virtual ~ParametrizedFunction ()
virtual result_t impl_compute (const argument_t &argument) const =0 throw ()
 Function evaluation.

Detailed Description

template<typename F>
class roboptim::ParametrizedFunction< F >

Define an abstract parametrized mathematical function ( $C^0$).

A function is an object that can be evaluated for a given point.

\[ f : p \rightarrow g \]

$p \in \mathbb{R}^p$, $g \in G$ where $p$ is the input size and $G = \mathbb{R}^n \in \mathbb{R}^m$ ( $n, m \in \mathbb{R}^2$).

Functions are pure immutable objects: evaluating a function twice at a given point must give the same result.

Template Parameters:
Finner function type.

Member Typedef Documentation

template<typename F>
typedef F::argument_t roboptim::ParametrizedFunction< F >::argument_t

Import argument type.

Reimplemented in roboptim::DerivableParametrizedFunction< F >.

template<typename F>
typedef F::matrix_t roboptim::ParametrizedFunction< F >::matrix_t

Import matrix type.

Reimplemented in roboptim::DerivableParametrizedFunction< F >.

template<typename F>
typedef F roboptim::ParametrizedFunction< F >::result_t

Import result type.

Reimplemented in roboptim::DerivableParametrizedFunction< F >.

template<typename F>
typedef F::size_type roboptim::ParametrizedFunction< F >::size_type

Import size type.

Reimplemented in roboptim::DerivableParametrizedFunction< F >.

template<typename F>
typedef F::value_type roboptim::ParametrizedFunction< F >::value_type

Import value type.

Reimplemented in roboptim::DerivableParametrizedFunction< F >.

template<typename F>
typedef F::vector_t roboptim::ParametrizedFunction< F >::vector_t

Import vector type.

Reimplemented in roboptim::DerivableParametrizedFunction< F >.


Constructor & Destructor Documentation

template<typename F >
roboptim::ParametrizedFunction< F >::ParametrizedFunction ( size_type  inputSize,
size_type  functionInputSize,
size_type  functionOutputSize 
) throw () [protected]

Concrete class constructor should call this constructor.

Parameters:
inputSizeparameter size
functionInputSizeinner function argument size
functionOutputSizeinner function result size
template<typename F>
virtual roboptim::ParametrizedFunction< F >::~ParametrizedFunction ( ) [inline, protected, virtual]

Member Function Documentation

template<typename F >
ParametrizedFunction< F >::size_type roboptim::ParametrizedFunction< F >::functionInputSize ( ) const throw ()

Return the function's input size (i.e.

argument's vector size).

Returns:
input size
template<typename F >
ParametrizedFunction< F >::size_type roboptim::ParametrizedFunction< F >::functionOutputSize ( ) const throw ()

Return the function's output size (i.e.

result's vector size).

Returns:
output size

Referenced by roboptim::DerivableParametrizedFunction< F >::impl_jacobian(), and roboptim::DerivableParametrizedFunction< F >::jacobianSize().

template<typename F>
virtual result_t roboptim::ParametrizedFunction< F >::impl_compute ( const argument_t argument) const throw () [protected, pure virtual]

Function evaluation.

Evaluate the function, has to be implemented in concrete classes.

Warning:
Do not call this function directly, call operator()(const argument_t&) const throw () instead.
Parameters:
argumentpoint at which the function will be evaluated
template<typename F >
ParametrizedFunction< F >::result_t roboptim::ParametrizedFunction< F >::operator() ( const argument_t argument) const throw ()

Evaluate the function at a specified point.

The program will abort if the argument does not have the expected size.

Parameters:
argumentpoint at which the function will be evaluated
Returns:
computed result
template<typename F >
std::ostream & roboptim::ParametrizedFunction< F >::print ( std::ostream &  o) const throw () [virtual]

Display the function on the specified output stream.

Parameters:
ooutput stream used for display
Returns:
output stream

Reimplemented in roboptim::DerivableParametrizedFunction< F >.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines