template<typename Functor_>
class Eigen::Ridders< Functor_ >
Adaptive numerical Jacobians using Ridders' extrapolation method.
Stores a functor by value and computes its Jacobian from central differences at successively smaller steps. Richardson extrapolation in the squared step size reduces truncation error; the Jacobian column with the smallest estimated error is retained. The stopping test uses the maximum absolute componentwise difference over the entire column.
The functor supplies Scalar, InputType, ValueType, JacobianType, InputsAtCompileTime, ValuesAtCompileTime, values(), and operator(), as for NumericalDiff. The scalar type must be real and non-integer. The functor's inputs() method is required only when calling inputs().
- Warning
- The functor must be smooth and defined throughout the initial step interval.
derivative.df(x, jacobian);
derivative.df(x, jacobian, error);
Adaptive numerical Jacobians using Ridders' extrapolation method.
Definition Ridders.h:49
Functor & functor()
Definition Ridders.h:100
- Template Parameters
-
| Functor_ | The vector-valued functor to differentiate. |
template<typename Functor_>
| int Eigen::Ridders< Functor_ >::df |
( |
const InputType & | x, |
|
|
JacobianType & | jac ) const |
|
inline |
Computes the Jacobian using adaptive central differences.
The caller sizes jac to values() by x.size(). At most 2*maxSteps evaluations are made per coordinate. Difference quotients divide by the separation of the representable evaluation points. Refinement stops when successive tableau diagonals differ by at least twice the best estimated error, when evaluation points coincide or repeat the previous pair, or when a non-finite value is encountered. The best finite estimate is retained; if none exists, the column contains NaNs.
- Parameters
-
| [in] | x | The evaluation point. |
| [out] | jac | The Jacobian at x. |
- Returns
- the number of functor evaluations.
- See also
- Parameters