| 68 | }; |
| 69 | |
| 70 | void test_forward() |
| 71 | { |
| 72 | VectorXd x(3); |
| 73 | MatrixXd jac(15,3); |
| 74 | MatrixXd actual_jac(15,3); |
| 75 | my_functor functor; |
| 76 | |
| 77 | x << 0.082, 1.13, 2.35; |
| 78 | |
| 79 | // real one |
| 80 | functor.actual_df(x, actual_jac); |
| 81 | // std::cout << actual_jac << std::endl << std::endl; |
| 82 | |
| 83 | // using NumericalDiff |
| 84 | NumericalDiff<my_functor> numDiff(functor); |
| 85 | numDiff.df(x, jac); |
| 86 | // std::cout << jac << std::endl; |
| 87 | |
| 88 | VERIFY_IS_APPROX(jac, actual_jac); |
| 89 | } |
| 90 | |
| 91 | void test_central() |
| 92 | { |
no test coverage detected