From 29358f826b0d7f8d74a5d4c916b56c6364771648 Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 9 Feb 2023 14:23:52 -0500 Subject: [PATCH] Patch discrete factor graph test to normalize expected result. --- gtsam/discrete/tests/testDiscreteFactorGraph.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtsam/discrete/tests/testDiscreteFactorGraph.cpp b/gtsam/discrete/tests/testDiscreteFactorGraph.cpp index bb23b7a83..8226a81dd 100644 --- a/gtsam/discrete/tests/testDiscreteFactorGraph.cpp +++ b/gtsam/discrete/tests/testDiscreteFactorGraph.cpp @@ -119,6 +119,9 @@ TEST(DiscreteFactorGraph, test) { // Check Factor CHECK(newFactor); DecisionTreeFactor expectedFactor(B & A, "10 6 6 10"); + auto normalization = expectedFactor.sum(expectedFactor.size()); + // Ensure normalization is correct. + expectedFactor = expectedFactor / *normalization; EXPECT(assert_equal(expectedFactor, *newFactor)); // Test using elimination tree