Precise finite difference gradient computation. More...
#include <roboptim/core/fwd.hh>
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... | |
Precise finite difference gradient computation.
Finite difference is computed using five-points stencil (i.e. \(\{x-2h, x-h, x, x+h, x+2h\}\)).
|
inlineexplicit |
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.
|
virtual |
|
inlinevirtual |
|
virtual |
|
inlinevirtual |
|
virtual |
Reimplemented from roboptim::finiteDifferenceGradientPolicies::Policy< T >.
Referenced by roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T >::computeJacobian().
|
inlinevirtual |
ROBOPTIM_DO_NOT_CHECK_ALLOCATION
ROBOPTIM_DO_NOT_CHECK_ALLOCATION
Reimplemented from roboptim::finiteDifferenceGradientPolicies::Policy< T >.
References roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T >::computeJacobian(), roboptim::is_malloc_allowed(), and roboptim::set_is_malloc_allowed().
roboptim::finiteDifferenceGradientPolicies::FivePointsRule< T >::ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS_ | ( | GenericDifferentiableFunction< T > | ) |