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

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Jul 16 11:43:14 EDT 2012


Author: rcurtin
Date: 2012-07-16 11:43:14 -0400 (Mon, 16 Jul 2012)
New Revision: 13237

Modified:
   mlpack/trunk/src/mlpack/tests/det_test.cpp
Log:
Oops, there was one more 'new'/'delete'.


Modified: mlpack/trunk/src/mlpack/tests/det_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/det_test.cpp	2012-07-16 15:42:16 UTC (rev 13236)
+++ mlpack/trunk/src/mlpack/tests/det_test.cpp	2012-07-16 15:43:14 UTC (rev 13237)
@@ -54,20 +54,18 @@
   arma::vec maxVals("7 7 8");
   arma::vec minVals("3 0 1");
 
-  DTree<>* testDTree = new DTree<>(maxVals, minVals, 5);
+  DTree<> testDTree(maxVals, minVals, 5);
   double true_node_error = -1.0 * exp(-log(4.0) - log(7.0) - log(7.0));
 
-  BOOST_REQUIRE_CLOSE((double) testDTree->error_, true_node_error, 1e-10);
+  BOOST_REQUIRE_CLOSE((double) testDTree.error_, true_node_error, 1e-10);
 
-  testDTree->start_ = 3;
-  testDTree->end_ = 5;
+  testDTree.start_ = 3;
+  testDTree.end_ = 5;
 
-  double node_error = -std::exp(testDTree->LogNegativeError(5));
+  double node_error = -std::exp(testDTree.LogNegativeError(5));
   true_node_error = -1.0 * exp(2 * log(2.0 / 5.0) - log(4.0) - log(7.0) -
       log(7.0));
   BOOST_REQUIRE_CLOSE(node_error, true_node_error, 1e-10);
-
-  delete testDTree;
 }
 
 BOOST_AUTO_TEST_CASE(TestWithinRange)




More information about the mlpack-svn mailing list