[mlpack-svn] r13215 - mlpack/trunk/src/mlpack/tests
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Jul 11 18:37:43 EDT 2012
Author: rcurtin
Date: 2012-07-11 18:37:43 -0400 (Wed, 11 Jul 2012)
New Revision: 13215
Modified:
mlpack/trunk/src/mlpack/tests/det_test.cpp
Log:
Further cleanup of casting issues.
Modified: mlpack/trunk/src/mlpack/tests/det_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/det_test.cpp 2012-07-11 22:37:25 UTC (rev 13214)
+++ mlpack/trunk/src/mlpack/tests/det_test.cpp 2012-07-11 22:37:43 UTC (rev 13215)
@@ -65,9 +65,7 @@
*min_vals << 3 << 0 << 1;
DTree<>* testDTree = new DTree<>(max_vals, min_vals, 5);
- double true_node_error = -1.0 * exp(-(double) log((double) 4.0)
- - (double) log((double) 7.0)
- - (double) log((double) 7.0));
+ double true_node_error = -1.0 * exp(-log(4.0) - log(7.0) - log(7.0));
BOOST_REQUIRE_CLOSE(testDTree->error_, true_node_error, 1e-10);
@@ -75,10 +73,8 @@
testDTree->end_ = 5;
double node_error = -std::exp(testDTree->LogNegativeError(5));
- true_node_error = -1.0 * exp(2 * log((double) 2 / (double) 5)
- -(double) log((double) 4.0)
- - (double) log((double) 7.0)
- - (double) log((double) 7.0));
+ 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;
More information about the mlpack-svn
mailing list