Optimo  0.1.0
A C++ header library for optimization
 All Classes Functions Variables Pages
optimo::SecantGradientFunctor< Scalar, n > Class Template Reference

Numerical Gradient Computation using the Secant Method. More...

#include <numerical_gradient.h>

Inheritance diagram for optimo::SecantGradientFunctor< Scalar, n >:
optimo::GradientFunctor< Scalar, n >

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW SecantGradientFunctor (const ObjectiveFunctor< Scalar, n > &obj, const Scalar h)
virtual void operator() (const Eigen::Matrix< Scalar, n, 1 > &x, Eigen::Matrix< Scalar, n, 1 > *g) const
 Compute gradient.

Detailed Description

template<typename Scalar, uint n>
class optimo::SecantGradientFunctor< Scalar, n >

Numerical Gradient Computation using the Secant Method.

This class computes the gradient using the secant method.

\[ \nabla f_0(\mathbf{x}) \approx \frac{f_0(\mathbf{x}_r) - f_0(\mathbf{x}_l)}{2*h} \]


\begin{eqnarray*} \mathbf{x}_r & = & \mathbf{x} + h\mathbb{1} \\ \mathbf{x}_l & = & \mathbf{x} - h\mathbb{1} \\ \end{eqnarray*}

and \(\mathbb{1}\) is a vector of ones.

This class is recommended for problems that fit in the stack. If this is a concern, use the SecantGradientFunctorLS class.

The documentation for this class was generated from the following file: