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) {