roboptim::CachedFunction< T > Class Template Reference

Store previous function computation. More...

#include <roboptim/core/filter/cached-function.hh>

List of all members.

Public Types

typedef
DifferentiableFunction::value_type 
value_type
 Import value type.
typedef
DifferentiableFunction::size_type 
size_type
 Import size type.
typedef
DifferentiableFunction::vector_t 
vector_t
 Import vector type.
typedef
DifferentiableFunction::result_t 
result_t
 Import result type.
typedef
DifferentiableFunction::argument_t 
argument_t
 Import argument type.
typedef
DifferentiableFunction::gradient_t 
gradient_t
 Import gradient type.
typedef
TwiceDifferentiableFunction::hessian_t 
hessian_t
 Import hessian type.
typedef
DifferentiableFunction::jacobian_t 
jacobian_t
 Import jacobian type.
typedef
DifferentiableFunction::interval_t 
interval_t
 Import interval type.
typedef std::map
< Function::vector_t,
Function::vector_t,
detail::ltvector
functionCache_t
typedef std::map
< Function::vector_t,
hessian_t, detail::ltvector
hessianCache_t

Public Member Functions

 CachedFunction (boost::shared_ptr< const T > fct) throw ()
 ~CachedFunction () throw ()
void reset () throw ()

Protected Member Functions

virtual void impl_compute (result_t &result, const argument_t &argument) const throw ()
virtual void impl_gradient (gradient_t &gradient, const argument_t &argument, size_type functionId=0) const throw ()
virtual void impl_hessian (hessian_t &hessian, const argument_t &argument, size_type functionId=0) const throw ()
virtual void impl_derivative (gradient_t &derivative, double argument, size_type order=1) const throw ()
template<>
void impl_gradient (gradient_t &, const argument_t &, size_type) const throw()
template<>
void impl_hessian (hessian_t &, const argument_t &, size_type) const throw()
template<>
void impl_hessian (hessian_t &, const argument_t &, size_type) const throw()
template<>
void impl_derivative (gradient_t &, double, size_type) const throw()
template<>
void impl_derivative (gradient_t &, double, size_type) const throw()
template<>
void impl_derivative (gradient_t &, double, size_type) const throw()

Detailed Description

template<typename T>
class roboptim::CachedFunction< T >

Store previous function computation.

When an expensive function is called several times at the same point (exactly!), the cached function prevents useless computation by caching the function result.

This filter is experimental in this release.


Member Typedef Documentation

Import argument type.

Import gradient type.

Import hessian type.

template<typename T >
typedef std::map<Function::vector_t, hessian_t, detail::ltvector> roboptim::CachedFunction< T >::hessianCache_t

Import interval type.

Import jacobian type.

Import result type.

Import size type.

Import value type.

Import vector type.


Constructor & Destructor Documentation

template<typename T >
roboptim::CachedFunction< T >::CachedFunction ( boost::shared_ptr< const T >  fct) throw () [explicit]
template<typename T >
roboptim::CachedFunction< T >::~CachedFunction ( ) throw ()

Member Function Documentation

template<typename T >
void roboptim::CachedFunction< T >::impl_compute ( result_t result,
const argument_t argument 
) const throw () [protected, virtual]
template<typename T >
void roboptim::CachedFunction< T >::impl_derivative ( gradient_t derivative,
double  argument,
size_type  order = 1 
) const throw () [protected, virtual]
template<>
void roboptim::CachedFunction< Function >::impl_derivative ( gradient_t ,
double  ,
size_type   
) const throw() [protected]
template<>
void roboptim::CachedFunction< DifferentiableFunction >::impl_derivative ( gradient_t ,
double  ,
size_type   
) const throw() [protected]
template<>
void roboptim::CachedFunction< TwiceDifferentiableFunction >::impl_derivative ( gradient_t ,
double  ,
size_type   
) const throw() [protected]
template<>
void roboptim::CachedFunction< Function >::impl_gradient ( gradient_t ,
const argument_t ,
size_type   
) const throw() [protected]
template<typename T >
void roboptim::CachedFunction< T >::impl_gradient ( gradient_t gradient,
const argument_t argument,
size_type  functionId = 0 
) const throw () [protected, virtual]
template<typename T >
void roboptim::CachedFunction< T >::impl_hessian ( hessian_t hessian,
const argument_t argument,
size_type  functionId = 0 
) const throw () [protected, virtual]
template<>
void roboptim::CachedFunction< Function >::impl_hessian ( hessian_t ,
const argument_t ,
size_type   
) const throw() [protected]
template<>
void roboptim::CachedFunction< DifferentiableFunction >::impl_hessian ( hessian_t ,
const argument_t ,
size_type   
) const throw() [protected]
template<typename T >
void roboptim::CachedFunction< T >::reset ( ) throw ()
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines