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

Interface for the finite difference gradient policies. More...

#include <roboptim/core/decorator/finite-difference-gradient.hh>

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

Public Member Functions

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

Protected Member Functions

virtual void computeGradient (value_type epsilon, gradient_ref gradient, const_argument_ref argument, size_type idFunction, argument_ref xEps) const =0
 
virtual void computeColumn (value_type epsilon, gradient_ref column, const_argument_ref argument, size_type colIdx, argument_ref xEps) const =0
 
virtual void computeJacobian (value_type epsilon, jacobian_ref jacobian, const_argument_ref argument, argument_ref xEps) const
 
template<>
void computeJacobian (value_type epsilon, jacobian_ref jacobian, const_argument_ref argument, argument_ref xEps) const
 

Protected Attributes

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::Policy< T >

Interface for the finite difference gradient policies.

Constructor & Destructor Documentation

template<typename T >
roboptim::finiteDifferenceGradientPolicies::Policy< T >::Policy ( const GenericFunction< T > &  adaptee)
inlineexplicit
template<typename T >
virtual roboptim::finiteDifferenceGradientPolicies::Policy< T >::~Policy ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

template<typename T >
virtual void roboptim::finiteDifferenceGradientPolicies::Policy< T >::computeColumn ( value_type  epsilon,
gradient_ref  column,
const_argument_ref  argument,
size_type  colIdx,
argument_ref  xEps 
) const
protectedpure virtual
template<typename T >
virtual void roboptim::finiteDifferenceGradientPolicies::Policy< T >::computeGradient ( value_type  epsilon,
gradient_ref  gradient,
const_argument_ref  argument,
size_type  idFunction,
argument_ref  xEps 
) const
protectedpure virtual
template<typename T >
void roboptim::finiteDifferenceGradientPolicies::Policy< T >::computeJacobian ( value_type  epsilon,
jacobian_ref  jacobian,
const_argument_ref  argument,
argument_ref  xEps 
) const
protectedvirtual
template<>
void roboptim::finiteDifferenceGradientPolicies::Policy< EigenMatrixSparse >::computeJacobian ( value_type  epsilon,
jacobian_ref  jacobian,
const_argument_ref  argument,
argument_ref  xEps 
) const
inlineprotected
template<typename T >
roboptim::finiteDifferenceGradientPolicies::Policy< T >::ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS_ ( GenericDifferentiableFunction< T >  )
template<typename T >
value_type& roboptim::finiteDifferenceGradientPolicies::Policy< T >::sparseEpsilon ( )
inline

Get a reference to the epsilon used to converse dense to sparse matrices.

This is only relevant when dealing with sparse functions. Set to a negative value to keep zeros as well.

References roboptim::finiteDifferenceGradientPolicies::Policy< T >::sparseEps_.

Member Data Documentation

template<typename T >
const GenericFunction<T>& roboptim::finiteDifferenceGradientPolicies::Policy< T >::adaptee_
protected

Wrapped function.

template<typename T >
vector_t roboptim::finiteDifferenceGradientPolicies::Policy< T >::column_
mutableprotected

Vector storing temporary Jacobian column.

template<typename T >
gradient_t roboptim::finiteDifferenceGradientPolicies::Policy< T >::gradient_
mutableprotected

Vector storing temporary Jacobian row.

template<typename T >
value_type roboptim::finiteDifferenceGradientPolicies::Policy< T >::sparseEps_
protected

Threshold used for the conversion from dense to sparse matrix.

Referenced by roboptim::finiteDifferenceGradientPolicies::Policy< T >::sparseEpsilon().