Skip to content

Commit

Permalink
fix test TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Oct 10, 2024
1 parent acda56d commit 878c626
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 10 additions & 5 deletions gtsam/hybrid/tests/testHybridGaussianProductFactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ TEST(HybridGaussianProductFactor, AsProductFactor) {
EXPECT(actual.first.at(0) == f10);
EXPECT_DOUBLES_EQUAL(10, actual.second, 1e-9);

// TODO(Frank): when killed hiding, f11 should also be there
mode[m1.first] = 1;
actual = product(mode);
EXPECT(actual.first.at(0) == f11);
EXPECT_DOUBLES_EQUAL(11, actual.second, 1e-9);
}

/* ************************************************************************* */
Expand All @@ -145,7 +148,10 @@ TEST(HybridGaussianProductFactor, AddOne) {
EXPECT(actual.first.at(0) == f10);
EXPECT_DOUBLES_EQUAL(10, actual.second, 1e-9);

// TODO(Frank): when killed hiding, f11 should also be there
mode[m1.first] = 1;
actual = product(mode);
EXPECT(actual.first.at(0) == f11);
EXPECT_DOUBLES_EQUAL(11, actual.second, 1e-9);
}

/* ************************************************************************* */
Expand All @@ -166,9 +172,8 @@ TEST(HybridGaussianProductFactor, AddTwo) {
EXPECT_DOUBLES_EQUAL(10 + 20, actual00.second, 1e-9);

auto actual12 = product({{M(1), 1}, {M(2), 2}});
// TODO(Frank): when killed hiding, these should also equal:
// EXPECT(actual12.first.at(0) == f11);
// EXPECT(actual12.first.at(1) == f22);
EXPECT(actual12.first.at(0) == f11);
EXPECT(actual12.first.at(1) == f22);
EXPECT_DOUBLES_EQUAL(11 + 22, actual12.second, 1e-9);
}

Expand Down
2 changes: 0 additions & 2 deletions gtsam/hybrid/tests/testHybridNonlinearFactorGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,8 +973,6 @@ TEST(HybridNonlinearFactorGraph, DifferentMeans) {
VectorValues cont0 = bn->optimize(dv0);
double error0 = bn->error(HybridValues(cont0, dv0));

// TODO(Varun) Perform importance sampling to estimate error?

// regression
EXPECT_DOUBLES_EQUAL(0.69314718056, error0, 1e-9);

Expand Down

0 comments on commit 878c626

Please sign in to comment.