function for computing log-determinant

release/4.3a0
Natesh Srinivasan 2013-08-02 17:00:22 +00:00
parent 74f7e3e16a
commit 3200c999b2
1 changed files with 10 additions and 0 deletions

View File

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