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

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Fri Nov 25 20:13:17 EST 2011


Author: rcurtin
Date: 2011-11-25 20:13:17 -0500 (Fri, 25 Nov 2011)
New Revision: 10410

Modified:
   mlpack/trunk/src/mlpack/tests/tree_test.cpp
Log:
Add a test for the identical case for MaxDistance().


Modified: mlpack/trunk/src/mlpack/tests/tree_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/tree_test.cpp	2011-11-25 23:59:09 UTC (rev 10409)
+++ mlpack/trunk/src/mlpack/tests/tree_test.cpp	2011-11-26 01:13:17 UTC (rev 10410)
@@ -328,6 +328,11 @@
   BOOST_REQUIRE_CLOSE(b.MaxDistance(c), 100.0, 1e-5);
   BOOST_REQUIRE_CLOSE(c.MaxDistance(b), 100.0, 1e-5);
 
+  // Identical bounds.  This will be the sum of the squared widths in each
+  // dimension.
+  BOOST_REQUIRE_CLOSE(b.MaxDistance(b), 46.0, 1e-5);
+  BOOST_REQUIRE_CLOSE(c.MaxDistance(c), 162.0, 1e-5);
+
   // One last additional case.  If the bound encloses only one point, the
   // maximum distance between it and itself is 0.
   HRectBound<2> d(2);




More information about the mlpack-svn mailing list