All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
roboptim::ParametrizedFunction< F > Class Template Referenceabstract

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

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

Inheritance diagram for roboptim::ParametrizedFunction< F >:
roboptim::DerivableParametrizedFunction< F >

Public Types

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

Public Member Functions

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

Protected Member Functions

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

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 types.

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

Import matrix type.

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

Import result type.

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

Import size type.

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

Import value type.

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

Import vector type.

Constructor & Destructor Documentation

template<typename F >
roboptim::ParametrizedFunction< F >::ParametrizedFunction ( size_type  inputSize,
size_type  functionInputSize,
size_type  functionOutputSize 
)
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 ( )
inlineprotectedvirtual

Member Function Documentation

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

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

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_ref  argument) const
protectedpure virtual

Function evaluation.

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

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

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
virtual

Display the function on the specified output stream.

Parameters
ooutput stream used for display
Returns
output stream

Reimplemented in roboptim::DerivableParametrizedFunction< F >.