[mlpack-svn] r13926 - mlpack/trunk/src/mlpack/tests
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Fri Nov 23 17:03:29 EST 2012
Author: rcurtin
Date: 2012-11-23 17:03:26 -0500 (Fri, 23 Nov 2012)
New Revision: 13926
Modified:
mlpack/trunk/src/mlpack/tests/tree_test.cpp
Log:
Test for the manual constructor.
Modified: mlpack/trunk/src/mlpack/tests/tree_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/tree_test.cpp 2012-11-23 22:03:15 UTC (rev 13925)
+++ mlpack/trunk/src/mlpack/tests/tree_test.cpp 2012-11-23 22:03:26 UTC (rev 13926)
@@ -1948,6 +1948,24 @@
}
/**
+ * Test the manual constructor.
+ */
+BOOST_AUTO_TEST_CASE(CoverTreeManualConstructorTest)
+{
+ arma::mat dataset;
+ dataset.zeros(10, 10);
+
+ CoverTree<> node(dataset, 1.3, 3, 2, 1.5, 2.75);
+
+ BOOST_REQUIRE_EQUAL(&node.Dataset(), &dataset);
+ BOOST_REQUIRE_EQUAL(node.Base(), 1.3);
+ BOOST_REQUIRE_EQUAL(node.Point(), 3);
+ BOOST_REQUIRE_EQUAL(node.Scale(), 2);
+ BOOST_REQUIRE_EQUAL(node.ParentDistance(), 1.5);
+ BOOST_REQUIRE_EQUAL(node.FurthestDescendantDistance(), 2.75);
+}
+
+/**
* Make sure cover trees work in different metric spaces.
*/
BOOST_AUTO_TEST_CASE(CoverTreeAlternateMetricTest)
More information about the mlpack-svn
mailing list