From 3a446d700817a2fd6dd65bd478b1e5f13ec8b892 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Mon, 16 Jan 2023 17:32:54 -0800 Subject: [PATCH] Explicitly implement logNormalizationConstant --- gtsam/discrete/DiscreteConditional.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtsam/discrete/DiscreteConditional.h b/gtsam/discrete/DiscreteConditional.h index f073c2d76..a4e1f011b 100644 --- a/gtsam/discrete/DiscreteConditional.h +++ b/gtsam/discrete/DiscreteConditional.h @@ -254,6 +254,13 @@ class GTSAM_EXPORT DiscreteConditional return -error(x); } + /** + * logNormalizationConstant K is just zero, such that + * logProbability(x) = log(evaluate(x)) = - error(x) + * and hence error(x) = - log(evaluate(x)) > 0 for all x. + */ + double logNormalizationConstant() const override { return 0.0; } + /// @} #ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V42