Skip to content

Commit

Permalink
Merge pull request #687 from ptrmu/ptrmu_numericalGradient_typo
Browse files Browse the repository at this point in the history
typo in numericalGradient test hidden by duplicate test values
  • Loading branch information
dellaert authored Jan 28, 2021
2 parents 97723d1 + a3d06f6 commit b8f5466
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gtsam/base/tests/testNumericalDerivative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ double f(const Vector2& x) {
/* ************************************************************************* */
//
TEST(testNumericalDerivative, numericalGradient) {
Vector2 x(1, 1);
Vector2 x(1, 1.1);

Vector expected(2);
expected << cos(x(1)), -sin(x(0));
expected << cos(x(0)), -sin(x(1));

Vector actual = numericalGradient<Vector2>(f, x);

Expand All @@ -42,7 +42,7 @@ TEST(testNumericalDerivative, numericalGradient) {

/* ************************************************************************* */
TEST(testNumericalDerivative, numericalHessian) {
Vector2 x(1, 1);
Vector2 x(1, 1.1);

Matrix expected(2, 2);
expected << -sin(x(0)), 0.0, 0.0, -cos(x(1));
Expand Down

0 comments on commit b8f5466

Please sign in to comment.