[mlpack-svn] r13241 - mlpack/trunk/src/mlpack/tests

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Jul 16 13:23:28 EDT 2012


Author: rcurtin
Date: 2012-07-16 13:23:28 -0400 (Mon, 16 Jul 2012)
New Revision: 13241

Modified:
   mlpack/trunk/src/mlpack/tests/det_test.cpp
Log:
Use double instead of long double for Grow() and PruneAndUpdate().


Modified: mlpack/trunk/src/mlpack/tests/det_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/det_test.cpp	2012-07-16 17:23:11 UTC (rev 13240)
+++ mlpack/trunk/src/mlpack/tests/det_test.cpp	2012-07-16 17:23:28 UTC (rev 13241)
@@ -168,7 +168,7 @@
   rr_error = -1.0 * exp(2 * log(2.0 / 5.0) - (log(6.5) + log(4.0) + log(2.5)));
 
   DTree<> testDTree(test_data);
-  long double alpha = testDTree.Grow(&test_data, &o_test, false, 2, 1);
+  double alpha = testDTree.Grow(test_data, o_test, false, 2, 1);
 
   BOOST_REQUIRE_EQUAL(o_test[0], 0);
   BOOST_REQUIRE_EQUAL(o_test[1], 3);
@@ -200,7 +200,7 @@
 
 
   // test alpha
-  long double root_alpha, r_alpha;
+  double root_alpha, r_alpha;
   root_alpha = (root_error - (l_error + rl_error + rr_error)) / 2;
   r_alpha = r_error - (rl_error + rr_error);
 
@@ -218,10 +218,10 @@
   arma::Col<size_t> o_test(5);
   o_test << 0 << 1 << 2 << 3 << 4;
   DTree<> testDTree(test_data);
-  long double alpha = testDTree.Grow(&test_data, &o_test, false, 2, 1);
+  double alpha = testDTree.Grow(test_data, o_test, false, 2, 1);
   alpha = testDTree.PruneAndUpdate(alpha, false);
 
-  BOOST_REQUIRE_CLOSE(alpha, numeric_limits<long double>::max(), 1e-10);
+  BOOST_REQUIRE_CLOSE(alpha, numeric_limits<double>::max(), 1e-10);
   BOOST_REQUIRE(testDTree.subtree_leaves() == 1);
 
   long double root_error = -1.0 * exp(-log(4.0) - log(7.0) - log(7.0));
@@ -251,7 +251,7 @@
   o_test << 0 << 1 << 2 << 3 << 4;
 
   DTree<> testDTree(test_data);
-  long double alpha = testDTree.Grow(&test_data, &o_test, false, 2, 1);
+  double alpha = testDTree.Grow(test_data, o_test, false, 2, 1);
 
   long double d1, d2, d3;
   d1 = (2.0 / 5.0) / exp(log(4.0) + log(7.0) + log(4.5));
@@ -295,7 +295,7 @@
   o_test << 0 << 1 << 2 << 3 << 4;
 
   DTree<> testDTree(test_data);
-  testDTree.Grow(&test_data, &o_test, false, 2, 1);
+  testDTree.Grow(test_data, o_test, false, 2, 1);
 
   arma::vec imps(3);
   imps.zeros();




More information about the mlpack-svn mailing list