9 #include <unsupported/Eigen/NumericalDiff> 12 template<
typename _Scalar,
int NX=Dynamic,
int NY=Dynamic>
39 double tmp1, tmp2, tmp3;
40 double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1,
41 3.9e-1, 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34, 2.1, 4.39};
47 tmp3 = (
i>=8)? tmp2 : tmp1;
48 fvec[
i] = y[
i] - (x[0] + tmp1/(x[1]*tmp2 + x[2]*tmp3));
55 double tmp1, tmp2, tmp3, tmp4;
60 tmp3 = (
i>=8)? tmp2 : tmp1;
61 tmp4 = (x[1]*tmp2 + x[2]*tmp3); tmp4 = tmp4*tmp4;
63 fjac(
i,1) = tmp1*tmp2/tmp4;
64 fjac(
i,2) = tmp1*tmp3/tmp4;
74 MatrixXd actual_jac(15,3);
77 x << 0.082, 1.13, 2.35;
95 MatrixXd actual_jac(15,3);
98 x << 0.082, 1.13, 2.35;
Matrix< Scalar, ValuesAtCompileTime, InputsAtCompileTime > JacobianType
int operator()(const VectorXd &x, VectorXd &fvec) const
Matrix< Scalar, InputsAtCompileTime, 1 > InputType
#define VERIFY_IS_APPROX(a, b)
Matrix< Scalar, ValuesAtCompileTime, 1 > ValueType
void test_NumericalDiff()
int actual_df(const VectorXd &x, MatrixXd &fjac) const
Functor(int inputs, int values)
#define CALL_SUBTEST(FUNC)
int df(const InputType &_x, JacobianType &jac) const
The matrix class, also used for vectors and row-vectors.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x