DiscreteNet::prune

release/4.3a0
Frank Dellaert 2025-01-30 07:57:42 -05:00
parent b5ddba9c3c
commit efea6b8cb9
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ DiscreteBayesNet DiscreteBayesNet::prune(
DiscreteValues deadModesValues;
// If we have a dead mode threshold and discrete variables left after pruning,
// then we run dead mode removal.
if (marginalThreshold.has_value() && pruned.keys().size() > 0) {
if (marginalThreshold && pruned.keys().size() > 0) {
DiscreteMarginals marginals(DiscreteFactorGraph{pruned});
for (auto dkey : pruned.discreteKeys()) {
const Vector probabilities = marginals.marginalProbabilities(dkey);