All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T > Class Template Reference

Precise finite difference gradient computation. More...

#include <roboptim/core/fwd.hh>

Inheritance diagram for roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T >:
roboptim::finiteDifferenceGradientPolicies::Policy< T >

Public Member Functions

 ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS_ (GenericDifferentiableFunction< T >)
 
 FivePointsRule (const GenericFunction< T > &adaptee)
 
void computeColumn (value_type epsilon, gradient_ref column, const_argument_ref argument, size_type colIdx, argument_ref xEps) const
 
void computeGradient (value_type epsilon, gradient_ref gradient, const_argument_ref argument, size_type idFunction, argument_ref xEps) const
 
void computeJacobian (value_type epsilon, jacobian_ref jacobian, const_argument_ref argument, argument_ref xEps) const
 
void compute_deriv (typename GenericFunction< T >::size_type j, double h, double &result, double &round, double &trunc, typename GenericFunction< T >::const_argument_ref argument, typename GenericFunction< T >::size_type idFunction, typename GenericFunction< T >::argument_ref xEps) const
 Algorithm from the Gnu Scientific Library. More...
 
template<>
void computeGradient (value_type epsilon, gradient_ref gradient, const_argument_ref argument, size_type idFunction, argument_ref xEps) const
 
template<>
void computeJacobian (value_type epsilon, jacobian_ref jacobian, const_argument_ref argument, argument_ref xEps) const
 
template<>
void computeColumn (value_type, gradient_ref, const_argument_ref, size_type, argument_ref) const
 
- Public Member Functions inherited from roboptim::finiteDifferenceGradientPolicies::Policy< T >
 ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS_ (GenericDifferentiableFunction< T >)
 
 Policy (const GenericFunction< T > &adaptee)
 
virtual ~Policy ()
 Virtual destructor. More...
 
value_type & sparseEpsilon ()
 Get a reference to the epsilon used to converse dense to sparse matrices. More...
 

Additional Inherited Members

- Protected Member Functions inherited from roboptim::finiteDifferenceGradientPolicies::Policy< T >
template<>
void computeJacobian (value_type epsilon, jacobian_ref jacobian, const_argument_ref argument, argument_ref xEps) const
 
- Protected Attributes inherited from roboptim::finiteDifferenceGradientPolicies::Policy< T >
const GenericFunction< T > & adaptee_
 Wrapped function. More...
 
vector_t column_
 Vector storing temporary Jacobian column. More...
 
gradient_t gradient_
 Vector storing temporary Jacobian row. More...
 
value_type sparseEps_
 Threshold used for the conversion from dense to sparse matrix. More...
 

Detailed Description

template<typename T>
class roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T >

Precise finite difference gradient computation.

Finite difference is computed using five-points stencil (i.e. \(\{x-2h, x-h, x, x+h, x+2h\}\)).

Constructor & Destructor Documentation

template<typename T >
roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T >::FivePointsRule ( const GenericFunction< T > &  adaptee)
inlineexplicit

Member Function Documentation

template<typename T >
void roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T >::compute_deriv ( typename GenericFunction< T >::size_type  j,
double  h,
double &  result,
double &  round,
double &  trunc,
typename GenericFunction< T >::const_argument_ref  argument,
typename GenericFunction< T >::size_type  idFunction,
typename GenericFunction< T >::argument_ref  xEps 
) const

Algorithm from the Gnu Scientific Library.

template<typename T >
void roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T >::computeColumn ( value_type  epsilon,
gradient_ref  column,
const_argument_ref  argument,
size_type  colIdx,
argument_ref  xEps 
) const
virtual
template<>
void roboptim::finiteDifferenceGradientPolicies::FivePointsRule< EigenMatrixSparse >::computeColumn ( value_type  ,
gradient_ref  ,
const_argument_ref  ,
size_type  ,
argument_ref   
) const
inlinevirtual
template<typename T >
void roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T >::computeGradient ( value_type  epsilon,
gradient_ref  gradient,
const_argument_ref  argument,
size_type  idFunction,
argument_ref  xEps 
) const
virtual
template<>
void roboptim::finiteDifferenceGradientPolicies::FivePointsRule< EigenMatrixSparse >::computeGradient ( value_type  epsilon,
gradient_ref  gradient,
const_argument_ref  argument,
size_type  idFunction,
argument_ref  xEps 
) const
inlinevirtual
template<typename T >
void roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T >::computeJacobian ( value_type  epsilon,
jacobian_ref  jacobian,
const_argument_ref  argument,
argument_ref  xEps 
) const
virtual
template<>
void roboptim::finiteDifferenceGradientPolicies::FivePointsRule< EigenMatrixSparse >::computeJacobian ( value_type  epsilon,
jacobian_ref  jacobian,
const_argument_ref  argument,
argument_ref  xEps 
) const
inlinevirtual
template<typename T >
roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T >::ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS_ ( GenericDifferentiableFunction< T >  )