1 #define chkder_log10e 0.43429448190325182765 2 #define chkder_factor 100. 8 template<
typename Scalar>
10 const Matrix< Scalar, Dynamic, 1 > &x,
11 const Matrix< Scalar, Dynamic, 1 > &fvec,
12 const Matrix< Scalar, Dynamic, Dynamic > &fjac,
13 Matrix< Scalar, Dynamic, 1 > &xp,
14 const Matrix< Scalar, Dynamic, 1 > &fvecp,
16 Matrix< Scalar, Dynamic, 1 > &err
23 typedef DenseIndex Index;
25 const Scalar eps = sqrt(NumTraits<Scalar>::epsilon());
26 const Scalar epsf = chkder_factor * NumTraits<Scalar>::epsilon();
27 const Scalar epslog = chkder_log10e * log(eps);
30 const Index m = fvec.size(), n = x.size();
35 for (Index j = 0; j < n; ++j) {
36 temp = eps * abs(x[j]);
45 for (Index j = 0; j < n; ++j) {
49 err += temp * fjac.col(j);
51 for (Index i = 0; i < m; ++i) {
53 if (fvec[i] != 0. && fvecp[i] != 0. && abs(fvecp[i] - fvec[i]) >= epsf * abs(fvec[i]))
54 temp = eps * abs((fvecp[i] - fvec[i]) / eps - err[i]) / (abs(fvec[i]) + abs(fvecp[i]));
56 if (temp > NumTraits<Scalar>::epsilon() && temp < eps)
57 err[i] = (chkder_log10e * log(temp) - epslog) / epslog;
Namespace containing all symbols from the Eigen library.
Definition: AdolcForward:45