Skip to content

Commit

Permalink
fix testHybridEstimation
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Jan 2, 2025
1 parent 4c5b842 commit e620729
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gtsam/hybrid/tests/testHybridEstimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,22 +464,22 @@ TEST(HybridEstimation, EliminateSequentialRegression) {

// Create expected discrete conditional on m0.
DiscreteKey m(M(0), 2);
DiscreteConditional expected(m % "0.51341712/1"); // regression
DiscreteTableConditional expected(m % "0.51341712/1"); // regression

// Eliminate into BN using one ordering
const Ordering ordering1{X(0), X(1), M(0)};
HybridBayesNet::shared_ptr bn1 = fg->eliminateSequential(ordering1);

// Check that the discrete conditional matches the expected.
auto dc1 = bn1->back()->asDiscrete();
auto dc1 = bn1->back()->asDiscrete<DiscreteTableConditional>();
EXPECT(assert_equal(expected, *dc1, 1e-9));

// Eliminate into BN using a different ordering
const Ordering ordering2{X(0), X(1), M(0)};
HybridBayesNet::shared_ptr bn2 = fg->eliminateSequential(ordering2);

// Check that the discrete conditional matches the expected.
auto dc2 = bn2->back()->asDiscrete();
auto dc2 = bn2->back()->asDiscrete<DiscreteTableConditional>();
EXPECT(assert_equal(expected, *dc2, 1e-9));
}

Expand Down

0 comments on commit e620729

Please sign in to comment.