virtual void impl_compute (result_ref, const_argument_ref) const
Function evaluation.
virtual void impl_gradient (gradient_ref, const_argument_ref argument, size_type =0) const
Gradient evaluation.
virtual void impl_jacobian (jacobian_ref jacobian , const_argument_ref argument) const
Jacobian evaluation.
GenericDifferentiableFunction (size_type inputSize , size_type outputSize =1, std::string name=std::string())
Concrete class constructor should call this constructor.
void impl_jacobian (jacobian_ref jacobian , const_argument_ref argument) const
GenericFunction (size_type inputSize , size_type outputSize =1, std::string name=std::string())
Concrete class constructor should call this constructor.
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.
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 computeColumn (value_type, gradient_ref, const_argument_ref, size_type, argument_ref) const
ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS_ (GenericDifferentiableFunction < T >)
Policy (const GenericFunction < T > &adaptee)
virtual ~Policy ()
Virtual destructor.
void computeJacobian (value_type epsilon, jacobian_ref jacobian, const_argument_ref argument, argument_ref xEps) const
typedef std::pair< size_type , size_type > jacobianSize_t
Jacobian size type (pair of values).
typedef T traits_t
Traits type.
typedef GenericFunctionTraits < T >::value_type value_type
Values type.
typedef GenericFunctionTraits < T >::size_type size_type
Size type.
typedef std::string name_t
Type of a function argument name.
typedef std::vector< name_t > names_t
Type of a vector of function argument names.
typedef std::pair< value_type , value_type > interval_t
Interval type (lower, upper).
typedef std::vector< interval_t > intervals_t
Vector of intervals.
typedef boost::tuple< value_type , value_type , value_type > discreteInterval_t
Types representing a discrete interval.
static value_type epsilon ()
Get the value of the machine epsilon, useful for floating types comparison.
static value_type infinity ()
Get the value that symbolizes positive infinity.
static interval_t makeInterval (value_type l, value_type u)
Construct an interval from a lower and upper bound.
static interval_t makeInfiniteInterval ()
Construct an infinite interval.
static interval_t makeLowerInterval (value_type l)
Construct an interval from a lower bound.
static interval_t makeUpperInterval (value_type u)
Construct an interval from an upper bound.
static value_type getLowerBound (const interval_t &interval)
Get the lower bound of an interval.
static value_type getUpperBound (const interval_t &interval)
Get the upper bound of an interval.
static discreteInterval_t makeDiscreteInterval (value_type min, value_type max, value_type step)
Construct a discrete interval.
static discreteInterval_t makeDiscreteInterval (interval_t interval, value_type step)
Construct a discrete interval.
static value_type getLowerBound (const discreteInterval_t &interval)
Get the lower bound of a discrete interval.
static value_type getUpperBound (const discreteInterval_t &interval)
Get the upper bound of a discrete interval.
static value_type getStep (const discreteInterval_t &interval)
Get the upper step of a discrete interval.
template<typename F >
static void foreach (const discreteInterval_t interval, F functor)
Iterate on an interval.
template<typename F >
static void foreach (const interval_t interval, const size_type n, F functor)
Iterate on an interval.
static log4cxx::LoggerPtr logger
Pointer to function logger (see log4cxx documentation).
template<typename T, typename FdgPolicy = finiteDifferenceGradientPolicies::FivePointsRule<T>>
class roboptim::GenericFiniteDifferenceGradient< T, FdgPolicy >
Compute automatically a gradient with finite differences.
Finite difference gradient is a method to approximate a function's gradient. It is particularly useful in RobOptim to avoid the need to compute the analytical gradient manually.
This class takes a Function as its input and wraps it into a derivable function.
The one dimensional formula is:
where is a constant given when calling the class constructor.