From 48879afce00cd036398e2f224ff6258310c5ada3 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Wed, 14 May 2025 06:43:43 -0400 Subject: [PATCH] update TableFactor to only consider values greater than 1e-11 --- gtsam/discrete/TableFactor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gtsam/discrete/TableFactor.cpp b/gtsam/discrete/TableFactor.cpp index b5d3193e4..93359c8a7 100644 --- a/gtsam/discrete/TableFactor.cpp +++ b/gtsam/discrete/TableFactor.cpp @@ -108,7 +108,9 @@ static Eigen::SparseVector ComputeSparseTable( * */ auto op = [&](const Assignment& assignment, double p) { - if (p > 0) { + // Check if greater than 1e-11 because we consider + // smaller than that as numerically 0 + if (p > 1e-11) { // Get all the keys involved in this assignment KeySet assignmentKeys; for (auto&& [k, _] : assignment) {