13 #ifndef EIGEN_NUMERICAL_DIFF_H 14 #define EIGEN_NUMERICAL_DIFF_H 35 template<
typename _Functor, NumericalDiffMode mode=Forward>
40 typedef typename Functor::Scalar
Scalar;
51 template<
typename T0,
typename T1>
53 template<
typename T0,
typename T1,
typename T2>
64 int df(
const InputType& _x, JacobianType &jac)
const 71 const typename InputType::Index n = _x.size();
76 val1.resize(Functor::values());
77 val2.resize(Functor::values());
83 Functor::operator()(x, val1); nfev++;
93 for (
int j = 0; j < n; ++j) {
101 Functor::operator()(x, val2);
104 jac.col(j) = (val2-val1)/h;
108 Functor::operator()(x, val2); nfev++;
110 Functor::operator()(x, val1); nfev++;
112 jac.col(j) = (val2-val1)/(2*h);
129 #endif // EIGEN_NUMERICAL_DIFF_H Functor::ValueType ValueType
IntermediateState sqrt(const Expression &arg)
Functor::JacobianType JacobianType
NumericalDiff(const T0 &a0)
iterative scaling algorithm to equilibrate rows and column norms in matrices
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
NumericalDiff(Scalar _epsfcn=0.)
EIGEN_STRONG_INLINE const CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > abs() const
Functor::InputType InputType
NumericalDiff(const T0 &a0, const T1 &a1)
NumericalDiff(const Functor &f, Scalar _epsfcn=0.)
int df(const InputType &_x, JacobianType &jac) const
NumericalDiff(const T0 &a0, const T1 &a1, const T2 &a2)
NumericalDiff & operator=(const NumericalDiff &)