Store previous function computation. More...
#include <roboptim/core/filter/cached-function.hh>
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() |
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.
typedef DifferentiableFunction::argument_t roboptim::CachedFunction< T >::argument_t |
Import argument type.
typedef std::map<Function::vector_t, Function::vector_t, detail::ltvector> roboptim::CachedFunction< T >::functionCache_t |
typedef DifferentiableFunction::gradient_t roboptim::CachedFunction< T >::gradient_t |
Import gradient type.
typedef TwiceDifferentiableFunction::hessian_t roboptim::CachedFunction< T >::hessian_t |
Import hessian type.
typedef std::map<Function::vector_t, hessian_t, detail::ltvector> roboptim::CachedFunction< T >::hessianCache_t |
typedef DifferentiableFunction::interval_t roboptim::CachedFunction< T >::interval_t |
Import interval type.
typedef DifferentiableFunction::jacobian_t roboptim::CachedFunction< T >::jacobian_t |
Import jacobian type.
typedef DifferentiableFunction::result_t roboptim::CachedFunction< T >::result_t |
Import result type.
typedef DifferentiableFunction::size_type roboptim::CachedFunction< T >::size_type |
Import size type.
typedef DifferentiableFunction::value_type roboptim::CachedFunction< T >::value_type |
Import value type.
typedef DifferentiableFunction::vector_t roboptim::CachedFunction< T >::vector_t |
Import vector type.
roboptim::CachedFunction< T >::CachedFunction | ( | boost::shared_ptr< const T > | fct | ) | throw () [explicit] |
roboptim::CachedFunction< T >::~CachedFunction | ( | ) | throw () |
void roboptim::CachedFunction< T >::impl_compute | ( | result_t & | result, |
const argument_t & | argument | ||
) | const throw () [protected, virtual] |
void roboptim::CachedFunction< T >::impl_derivative | ( | gradient_t & | derivative, |
double | argument, | ||
size_type | order = 1 |
||
) | const throw () [protected, virtual] |
void roboptim::CachedFunction< Function >::impl_derivative | ( | gradient_t & | , |
double | , | ||
size_type | |||
) | const throw() [protected] |
void roboptim::CachedFunction< DifferentiableFunction >::impl_derivative | ( | gradient_t & | , |
double | , | ||
size_type | |||
) | const throw() [protected] |
void roboptim::CachedFunction< TwiceDifferentiableFunction >::impl_derivative | ( | gradient_t & | , |
double | , | ||
size_type | |||
) | const throw() [protected] |
void roboptim::CachedFunction< Function >::impl_gradient | ( | gradient_t & | , |
const argument_t & | , | ||
size_type | |||
) | const throw() [protected] |
void roboptim::CachedFunction< T >::impl_gradient | ( | gradient_t & | gradient, |
const argument_t & | argument, | ||
size_type | functionId = 0 |
||
) | const throw () [protected, virtual] |
void roboptim::CachedFunction< T >::impl_hessian | ( | hessian_t & | hessian, |
const argument_t & | argument, | ||
size_type | functionId = 0 |
||
) | const throw () [protected, virtual] |
void roboptim::CachedFunction< Function >::impl_hessian | ( | hessian_t & | , |
const argument_t & | , | ||
size_type | |||
) | const throw() [protected] |
void roboptim::CachedFunction< DifferentiableFunction >::impl_hessian | ( | hessian_t & | , |
const argument_t & | , | ||
size_type | |||
) | const throw() [protected] |
void roboptim::CachedFunction< T >::reset | ( | ) | throw () |