From 3200c999b24e3cd73cda87c9cdd26a4722a48baf Mon Sep 17 00:00:00 2001 From: Natesh Srinivasan Date: Fri, 2 Aug 2013 17:00:22 +0000 Subject: [PATCH] function for computing log-determinant --- gtsam/linear/GaussianBayesTree.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gtsam/linear/GaussianBayesTree.h b/gtsam/linear/GaussianBayesTree.h index 9df3d67b4..63411b610 100644 --- a/gtsam/linear/GaussianBayesTree.h +++ b/gtsam/linear/GaussianBayesTree.h @@ -102,6 +102,16 @@ GTSAM_EXPORT void gradientAtZero(const GaussianBayesTree& bayesTree, VectorValue */ GTSAM_EXPORT double determinant(const GaussianBayesTree& bayesTree); +/** + * Computes the log determinant of a GassianBayesTree + * A GassianBayesTree is an upper triangular matrix and for an upper triangular matrix + * determinant is the product of the diagonal elements. Instead of actually multiplying + * we add the logarithms of the diagonal elements because this is more numerically stable. + * @param bayesTree The input GassianBayesTree + * @return The log determinant + */ +GTSAM_EXPORT double logDeterminant(const GaussianBayesTree& bayesTree); + namespace internal { template