diff --git a/gtsam/discrete/DiscreteFactorGraph.cpp b/gtsam/discrete/DiscreteFactorGraph.cpp index 7d07043b2..4ededbb8b 100644 --- a/gtsam/discrete/DiscreteFactorGraph.cpp +++ b/gtsam/discrete/DiscreteFactorGraph.cpp @@ -121,8 +121,8 @@ namespace gtsam { for (auto&& factor : factors) product = (*factor) * product; gttoc(product); - // Sum all the potentials by pretending all keys are frontal: - auto normalization = product.sum(product.size()); + // Max over all the potentials by pretending all keys are frontal: + auto normalization = product.max(product.size()); // Normalize the product factor to prevent underflow. product = product / (*normalization); @@ -210,8 +210,8 @@ namespace gtsam { for (auto&& factor : factors) product = (*factor) * product; gttoc(product); - // Sum all the potentials by pretending all keys are frontal: - auto normalization = product.sum(product.size()); + // Max over all the potentials by pretending all keys are frontal: + auto normalization = product.max(product.size()); // Normalize the product factor to prevent underflow. product = product / (*normalization);