Explicitly implement logNormalizationConstant

release/4.3a0
Frank Dellaert 2023-01-16 17:32:54 -08:00
parent 207c9b7236
commit 3a446d7008
1 changed files with 7 additions and 0 deletions

View File

@ -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