[mlpack-svn] r16208 - mlpack/trunk/src/mlpack/methods/gmm

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Feb 4 17:00:32 EST 2014


Author: birm
Date: Tue Feb  4 17:00:31 2014
New Revision: 16208

Log:
Fixed Positive Def Constaint under gmm; previous error was "/gmm/positive_definite_constraint.hpp:28: error: expected primary-expression before ‘(’ token" at lines 27 and 33.


Modified:
   mlpack/trunk/src/mlpack/methods/gmm/positive_definite_constraint.hpp

Modified: mlpack/trunk/src/mlpack/methods/gmm/positive_definite_constraint.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/gmm/positive_definite_constraint.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/gmm/positive_definite_constraint.hpp	Tue Feb  4 17:00:31 2014
@@ -7,6 +7,8 @@
 #ifndef __MLPACK_METHODS_GMM_POSITIVE_DEFINITE_CONSTRAINT_HPP
 #define __MLPACK_METHODS_GMM_POSITIVE_DEFINITE_CONSTRAINT_HPP
 
+#include <mlpack/core.hpp>
+
 namespace mlpack {
 namespace gmm {
 
@@ -24,13 +26,13 @@
   static void ApplyConstraint(arma::mat& covariance)
   {
     // TODO: make this more efficient.
-    if (det(covariance) <= 1e-50)
+    if (arma::det(covariance) <= 1e-50)
     {
       Log::Debug << "Covariance matrix is not positive definite.  Adding "
           << "perturbation." << std::endl;
 
       double perturbation = 1e-30;
-      while (det(covariance) <= 1e-50)
+      while (arma::det(covariance) <= 1e-50)
       {
         covariance.diag() += perturbation;
         perturbation *= 10;
@@ -43,3 +45,4 @@
 }; // namespace mlpack
 
 #endif
+



More information about the mlpack-svn mailing list