added a funtion for computing log-Determinant

release/4.3a0
Natesh Srinivasan 2013-08-02 16:59:46 +00:00
parent f273b8f915
commit 74f7e3e16a
1 changed files with 6 additions and 1 deletions

View File

@ -82,10 +82,15 @@ void gradientAtZero(const GaussianBayesTree& bayesTree, VectorValues& g) {
/* ************************************************************************* */
double determinant(const GaussianBayesTree& bayesTree) {
return exp(logDeterminant(bayesTree));
}
/* ************************************************************************* */
double logDeterminant(const GaussianBayesTree& bayesTree) {
if (!bayesTree.root())
return 0.0;
return exp(internal::logDeterminant<GaussianBayesTree>(bayesTree.root()));
return internal::logDeterminant<GaussianBayesTree>(bayesTree.root());
}
/* ************************************************************************* */