[mlpack-git] master: Update tests to use the new API. (749ce28)

gitdub at mlpack.org gitdub at mlpack.org
Sat Aug 20 18:27:18 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/3274b05fcc545c3b36f783316fea2e22f79c3d03...1c77230c7d3b9c45fb102cd3c632d9c7248e085e

>---------------------------------------------------------------

commit 749ce2878d6628cb654ae6a8914b31bffe1c9a70
Author: MarcosPividori <marcos.pividori at gmail.com>
Date:   Sat Aug 20 17:41:57 2016 -0300

    Update tests to use the new API.


>---------------------------------------------------------------

749ce2878d6628cb654ae6a8914b31bffe1c9a70
 src/mlpack/tests/akfn_test.cpp               | 14 +++++++-------
 src/mlpack/tests/aknn_test.cpp               | 18 +++++++++---------
 src/mlpack/tests/kfn_test.cpp                | 22 +++++++++++-----------
 src/mlpack/tests/knn_test.cpp                | 26 +++++++++++++-------------
 src/mlpack/tests/rectangle_tree_test.cpp     | 28 ++++++++++++++--------------
 src/mlpack/tests/serialization_test.cpp      |  2 +-
 src/mlpack/tests/vantage_point_tree_test.cpp |  8 ++++----
 7 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/src/mlpack/tests/akfn_test.cpp b/src/mlpack/tests/akfn_test.cpp
index 5769899..605bde0 100644
--- a/src/mlpack/tests/akfn_test.cpp
+++ b/src/mlpack/tests/akfn_test.cpp
@@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE(ApproxVsExact1)
     }
 
     // Now perform the actual calculation.
-    akfn = new KFN(dataset, false, false, epsilon);
+    akfn = new KFN(dataset, DUAL_TREE_MODE, epsilon);
     arma::Mat<size_t> neighborsApprox;
     arma::mat distancesApprox;
     akfn->Search(dataset, 15, neighborsApprox, distancesApprox);
@@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE(ApproxVsExact2)
   arma::mat distancesExact;
   exact.Search(15, neighborsExact, distancesExact);
 
-  KFN akfn(dataset, false, false, 0.05);
+  KFN akfn(dataset, DUAL_TREE_MODE, 0.05);
   arma::Mat<size_t> neighborsApprox;
   arma::mat distancesApprox;
   akfn.Search(15, neighborsApprox, distancesApprox);
@@ -115,7 +115,7 @@ BOOST_AUTO_TEST_CASE(SingleTreeVsExact)
   arma::mat distancesExact;
   exact.Search(15, neighborsExact, distancesExact);
 
-  KFN akfn(dataset, false, true, 0.05);
+  KFN akfn(dataset, SINGLE_TREE_MODE, 0.05);
   arma::Mat<size_t> neighborsApprox;
   arma::mat distancesApprox;
   akfn.Search(15, neighborsApprox, distancesApprox);
@@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE(SingleCoverTreeTest)
       arma::mat> tree(dataset);
 
   NeighborSearch<FurthestNeighborSort, LMetric<2>, arma::mat, StandardCoverTree>
-      coverTreeSearch(&tree, true, 0.05);
+      coverTreeSearch(&tree, SINGLE_TREE_MODE, 0.05);
 
   arma::Mat<size_t> neighborsCoverTree;
   arma::mat distancesCoverTree;
@@ -174,7 +174,7 @@ BOOST_AUTO_TEST_CASE(DualCoverTreeTest)
       arma::mat> referenceTree(dataset);
 
   NeighborSearch<FurthestNeighborSort, LMetric<2>, arma::mat, StandardCoverTree>
-      coverTreeSearch(&referenceTree, false, 0.05);
+      coverTreeSearch(&referenceTree, DUAL_TREE_MODE, 0.05);
 
   arma::Mat<size_t> neighborsCoverTree;
   arma::mat distancesCoverTree;
@@ -201,7 +201,7 @@ BOOST_AUTO_TEST_CASE(SingleBallTreeTest)
   exact.Search(dataset, 15, neighborsExact, distancesExact);
 
   NeighborSearch<FurthestNeighborSort, EuclideanDistance, arma::mat, BallTree>
-      ballTreeSearch(dataset, false, true, 0.05);
+      ballTreeSearch(dataset, SINGLE_TREE_MODE, 0.05);
 
   arma::Mat<size_t> neighborsBallTree;
   arma::mat distancesBallTree;
@@ -228,7 +228,7 @@ BOOST_AUTO_TEST_CASE(DualBallTreeTest)
   exact.Search(15, neighborsExact, distancesExact);
 
   NeighborSearch<FurthestNeighborSort, EuclideanDistance, arma::mat, BallTree>
-      ballTreeSearch(dataset, false, false, 0.05);
+      ballTreeSearch(dataset, DUAL_TREE_MODE, 0.05);
   arma::Mat<size_t> neighborsBallTree;
   arma::mat distancesBallTree;
   ballTreeSearch.Search(15, neighborsBallTree, distancesBallTree);
diff --git a/src/mlpack/tests/aknn_test.cpp b/src/mlpack/tests/aknn_test.cpp
index c236be8..ea7f34b 100644
--- a/src/mlpack/tests/aknn_test.cpp
+++ b/src/mlpack/tests/aknn_test.cpp
@@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE(ApproxVsExact1)
     }
 
     // Now perform the actual calculation.
-    aknn = new KNN(dataset, false, false, epsilon);
+    aknn = new KNN(dataset, DUAL_TREE_MODE, epsilon);
     arma::Mat<size_t> neighborsApprox;
     arma::mat distancesApprox;
     aknn->Search(dataset, 15, neighborsApprox, distancesApprox);
@@ -91,7 +91,7 @@ BOOST_AUTO_TEST_CASE(ApproxVsExact2)
   arma::mat distancesExact;
   exact.Search(15, neighborsExact, distancesExact);
 
-  KNN aknn(dataset, false, false, 0.05);
+  KNN aknn(dataset, DUAL_TREE_MODE, 0.05);
   arma::Mat<size_t> neighborsApprox;
   arma::mat distancesApprox;
   aknn.Search(15, neighborsApprox, distancesApprox);
@@ -118,7 +118,7 @@ BOOST_AUTO_TEST_CASE(SingleTreeApproxVsExact)
   arma::mat distancesExact;
   exact.Search(15, neighborsExact, distancesExact);
 
-  KNN aknn(dataset, false, true, 0.05);
+  KNN aknn(dataset, SINGLE_TREE_MODE, 0.05);
   arma::Mat<size_t> neighborsApprox;
   arma::mat distancesApprox;
   aknn.Search(15, neighborsApprox, distancesApprox);
@@ -147,7 +147,7 @@ BOOST_AUTO_TEST_CASE(SingleCoverTreeTest)
       arma::mat> tree(dataset);
 
   NeighborSearch<NearestNeighborSort, LMetric<2>, arma::mat, StandardCoverTree>
-      coverTreeSearch(&tree, true, 0.05);
+      coverTreeSearch(&tree, SINGLE_TREE_MODE, 0.05);
 
   arma::Mat<size_t> neighborsCoverTree;
   arma::mat distancesCoverTree;
@@ -177,7 +177,7 @@ BOOST_AUTO_TEST_CASE(DualCoverTreeTest)
       arma::mat> referenceTree(dataset);
 
   NeighborSearch<NearestNeighborSort, EuclideanDistance, arma::mat,
-      StandardCoverTree> coverTreeSearch(&referenceTree, false, 0.05);
+      StandardCoverTree> coverTreeSearch(&referenceTree, DUAL_TREE_MODE, 0.05);
 
   arma::Mat<size_t> neighborsCoverTree;
   arma::mat distancesCoverTree;
@@ -205,7 +205,7 @@ BOOST_AUTO_TEST_CASE(SingleBallTreeTest)
   exact.Search(dataset, 15, neighborsExact, distancesExact);
 
   NeighborSearch<NearestNeighborSort, EuclideanDistance, arma::mat, BallTree>
-      ballTreeSearch(dataset, false, true, 0.05);
+      ballTreeSearch(dataset, SINGLE_TREE_MODE, 0.05);
 
   arma::Mat<size_t> neighborsBallTree;
   arma::mat distancesBallTree;
@@ -232,7 +232,7 @@ BOOST_AUTO_TEST_CASE(DualBallTreeTest)
   exact.Search(15, neighborsExact, distancesExact);
 
   NeighborSearch<NearestNeighborSort, EuclideanDistance, arma::mat, BallTree>
-      ballTreeSearch(dataset, false, false, 0.05);
+      ballTreeSearch(dataset, DUAL_TREE_MODE, 0.05);
   arma::Mat<size_t> neighborsBallTree;
   arma::mat distancesBallTree;
   ballTreeSearch.Search(15, neighborsBallTree, distancesBallTree);
@@ -272,7 +272,7 @@ BOOST_AUTO_TEST_CASE(SingleSpillTreeTest)
       referenceTree(dataset, maxDist * 1.01 /* tau parameter */);
 
   NeighborSearch<NearestNeighborSort, EuclideanDistance, arma::mat, SPTree>
-      spTreeSearch(&referenceTree, true, 0.05);
+      spTreeSearch(&referenceTree, SINGLE_TREE_MODE, 0.05);
 
   arma::Mat<size_t> neighborsSPTree;
   arma::mat distancesSPTree;
@@ -301,7 +301,7 @@ BOOST_AUTO_TEST_CASE(SparseKNNKDTreeTest)
   typedef NeighborSearch<NearestNeighborSort, EuclideanDistance, arma::sp_mat,
       KDTree> SparseKNN;
 
-  SparseKNN aknn(referenceDataset, false, false, 0.05);
+  SparseKNN aknn(referenceDataset, DUAL_TREE_MODE, 0.05);
   arma::mat distancesSparse;
   arma::Mat<size_t> neighborsSparse;
   aknn.Search(queryDataset, 10, neighborsSparse, distancesSparse);
diff --git a/src/mlpack/tests/kfn_test.cpp b/src/mlpack/tests/kfn_test.cpp
index 1fc536a..be1ee7d 100644
--- a/src/mlpack/tests/kfn_test.cpp
+++ b/src/mlpack/tests/kfn_test.cpp
@@ -56,13 +56,13 @@ BOOST_AUTO_TEST_CASE(ExhaustiveSyntheticTest)
     switch (i)
     {
       case 0: // Use the dual-tree method.
-        kfn = new KFN(tree, false);
+        kfn = new KFN(tree, DUAL_TREE_MODE);
         break;
       case 1: // Use the single-tree method.
-        kfn = new KFN(tree, true);
+        kfn = new KFN(tree, SINGLE_TREE_MODE);
         break;
       case 2: // Use the naive method.
-        kfn = new KFN(tree->Dataset(), true);
+        kfn = new KFN(tree->Dataset(), NAIVE_MODE);
         break;
     }
 
@@ -342,7 +342,7 @@ BOOST_AUTO_TEST_CASE(DualTreeVsNaive1)
 
   KFN kfn(dataset);
 
-  KFN naive(dataset, true);
+  KFN naive(dataset, NAIVE_MODE);
 
   arma::Mat<size_t> neighborsTree;
   arma::mat distancesTree;
@@ -376,7 +376,7 @@ BOOST_AUTO_TEST_CASE(DualTreeVsNaive2)
 
   KFN kfn(dataset);
 
-  KFN naive(dataset, true);
+  KFN naive(dataset, NAIVE_MODE);
 
   arma::Mat<size_t> neighborsTree;
   arma::mat distancesTree;
@@ -408,9 +408,9 @@ BOOST_AUTO_TEST_CASE(SingleTreeVsNaive)
   if (!data::Load("test_data_3_1000.csv", dataset))
     BOOST_FAIL("Cannot load test dataset test_data_3_1000.csv!");
 
-  KFN kfn(dataset, false, true);
+  KFN kfn(dataset, SINGLE_TREE_MODE);
 
-  KFN naive(dataset, true);
+  KFN naive(dataset, NAIVE_MODE);
 
   arma::Mat<size_t> neighborsTree;
   arma::mat distancesTree;
@@ -443,9 +443,9 @@ BOOST_AUTO_TEST_CASE(SingleCoverTreeTest)
       FirstPointIsRoot> tree(data);
 
   NeighborSearch<FurthestNeighborSort, LMetric<2>, arma::mat, StandardCoverTree>
-      coverTreeSearch(&tree, true);
+      coverTreeSearch(&tree, SINGLE_TREE_MODE);
 
-  KFN naive(data, true);
+  KFN naive(data, NAIVE_MODE);
 
   arma::Mat<size_t> coverTreeNeighbors;
   arma::mat coverTreeDistances;
@@ -515,9 +515,9 @@ BOOST_AUTO_TEST_CASE(SingleBallTreeTest)
   // correspondence between points in the dataset for both methods. The order of
   // query points in both methods should be same.
   NeighborSearch<FurthestNeighborSort, LMetric<2>, arma::mat, BallTree>
-      ballTreeSearch(&tree, true);
+      ballTreeSearch(&tree, SINGLE_TREE_MODE);
 
-  KFN naive(tree.Dataset(), true);
+  KFN naive(tree.Dataset(), NAIVE_MODE);
 
   arma::Mat<size_t> ballTreeNeighbors;
   arma::mat ballTreeDistances;
diff --git a/src/mlpack/tests/knn_test.cpp b/src/mlpack/tests/knn_test.cpp
index 35a0f50..09d6737 100644
--- a/src/mlpack/tests/knn_test.cpp
+++ b/src/mlpack/tests/knn_test.cpp
@@ -270,7 +270,7 @@ BOOST_AUTO_TEST_CASE(TrainTreeTest)
  */
 BOOST_AUTO_TEST_CASE(NaiveTrainTreeTest)
 {
-  KNN empty(true);
+  KNN empty(NAIVE_MODE);
 
   arma::mat dataset = arma::randu<arma::mat>(5, 100);
   KNN::Tree tree(dataset);
@@ -381,13 +381,13 @@ BOOST_AUTO_TEST_CASE(ExhaustiveSyntheticTest)
     switch (i)
     {
       case 0: // Use the dual-tree method.
-        knn = new KNN(tree, false);
+        knn = new KNN(tree, DUAL_TREE_MODE);
         break;
       case 1: // Use the single-tree method.
-        knn = new KNN(tree, true);
+        knn = new KNN(tree, SINGLE_TREE_MODE);
         break;
       case 2: // Use the naive method.
-        knn = new KNN(tree->Dataset(), true);
+        knn = new KNN(tree->Dataset(), NAIVE_MODE);
         break;
     }
 
@@ -667,7 +667,7 @@ BOOST_AUTO_TEST_CASE(DualTreeVsNaive1)
 
   KNN knn(dataset);
 
-  KNN naive(dataset, true);
+  KNN naive(dataset, NAIVE_MODE);
 
   arma::Mat<size_t> neighborsTree;
   arma::mat distancesTree;
@@ -702,7 +702,7 @@ BOOST_AUTO_TEST_CASE(DualTreeVsNaive2)
   KNN knn(dataset);
 
   // Set naive mode.
-  KNN naive(dataset, true);
+  KNN naive(dataset, NAIVE_MODE);
 
   arma::Mat<size_t> neighborsTree;
   arma::mat distancesTree;
@@ -734,10 +734,10 @@ BOOST_AUTO_TEST_CASE(SingleTreeVsNaive)
   if (!data::Load("test_data_3_1000.csv", dataset))
     BOOST_FAIL("Cannot load test dataset test_data_3_1000.csv!");
 
-  KNN knn(dataset, false, true);
+  KNN knn(dataset, SINGLE_TREE_MODE);
 
   // Set up computation for naive mode.
-  KNN naive(dataset, true);
+  KNN naive(dataset, NAIVE_MODE);
 
   arma::Mat<size_t> neighborsTree;
   arma::mat distancesTree;
@@ -769,9 +769,9 @@ BOOST_AUTO_TEST_CASE(SingleCoverTreeTest)
       arma::mat> tree(data);
 
   NeighborSearch<NearestNeighborSort, LMetric<2>, arma::mat, StandardCoverTree>
-      coverTreeSearch(&tree, true);
+      coverTreeSearch(&tree, SINGLE_TREE_MODE);
 
-  KNN naive(data, true);
+  KNN naive(data, NAIVE_MODE);
 
   arma::Mat<size_t> coverTreeNeighbors;
   arma::mat coverTreeDistances;
@@ -840,9 +840,9 @@ BOOST_AUTO_TEST_CASE(SingleBallTreeTest)
   // query points in both methods should be same.
 
   NeighborSearch<NearestNeighborSort, EuclideanDistance, arma::mat, BallTree>
-      ballTreeSearch(&tree, true);
+      ballTreeSearch(&tree, SINGLE_TREE_MODE);
 
-  KNN naive(tree.Dataset(), true);
+  KNN naive(tree.Dataset(), NAIVE_MODE);
 
   arma::Mat<size_t> ballTreeNeighbors;
   arma::mat ballTreeDistances;
@@ -998,7 +998,7 @@ BOOST_AUTO_TEST_CASE(SparseKNNKDTreeTest)
       KDTree> SparseKNN;
 
   SparseKNN a(referenceDataset);
-  KNN naive(denseReference, true);
+  KNN naive(denseReference, NAIVE_MODE);
 
   arma::mat sparseDistances;
   arma::Mat<size_t> sparseNeighbors;
diff --git a/src/mlpack/tests/rectangle_tree_test.cpp b/src/mlpack/tests/rectangle_tree_test.cpp
index c90ff37..dbf945d 100644
--- a/src/mlpack/tests/rectangle_tree_test.cpp
+++ b/src/mlpack/tests/rectangle_tree_test.cpp
@@ -414,7 +414,7 @@ BOOST_AUTO_TEST_CASE(PointDeletion)
 
   // Single-tree search.
   NeighborSearch<NearestNeighborSort, metric::LMetric<2, true>, arma::mat,
-      RTree> knn1(&tree, true);
+      RTree> knn1(&tree, SINGLE_TREE_MODE);
 
   arma::Mat<size_t> neighbors1;
   arma::mat distances1;
@@ -428,7 +428,7 @@ BOOST_AUTO_TEST_CASE(PointDeletion)
   arma::mat distances2;
 
   // Nearest neighbor search the naive way.
-  KNN knn2(newDataset, true, true);
+  KNN knn2(newDataset, NAIVE_MODE);
 
   knn2.Search(querySet, 5, neighbors2, distances2);
 
@@ -504,12 +504,12 @@ BOOST_AUTO_TEST_CASE(PointDynamicAdd)
 
   // Nearest neighbor search with the R tree.
   NeighborSearch<NearestNeighborSort, metric::LMetric<2, true>, arma::mat,
-      RTree> knn1(&tree, true);
+      RTree> knn1(&tree, SINGLE_TREE_MODE);
 
   knn1.Search(5, neighbors1, distances1);
 
   // Nearest neighbor search the naive way.
-  KNN knn2(dataset, true, true);
+  KNN knn2(dataset, NAIVE_MODE);
 
   knn2.Search(5, neighbors2, distances2);
 
@@ -537,7 +537,7 @@ BOOST_AUTO_TEST_CASE(SingleTreeTraverserTest)
 
   // Nearest neighbor search with the R tree.
   NeighborSearch<NearestNeighborSort, metric::LMetric<2, true>, arma::mat,
-      RStarTree> knn1(&rTree, true);
+      RStarTree> knn1(&rTree, SINGLE_TREE_MODE);
 
   BOOST_REQUIRE_EQUAL(rTree.NumDescendants(), 1000);
 
@@ -549,7 +549,7 @@ BOOST_AUTO_TEST_CASE(SingleTreeTraverserTest)
   knn1.Search(5, neighbors1, distances1);
 
   // Nearest neighbor search the naive way.
-  KNN knn2(dataset, true, true);
+  KNN knn2(dataset, NAIVE_MODE);
 
   knn2.Search(5, neighbors2, distances2);
 
@@ -580,7 +580,7 @@ BOOST_AUTO_TEST_CASE(XTreeTraverserTest)
 
   // Nearest neighbor search with the X tree.
   NeighborSearch<NearestNeighborSort, metric::LMetric<2, true>, arma::mat,
-      XTree> knn1(&xTree, true);
+      XTree> knn1(&xTree, SINGLE_TREE_MODE);
 
   BOOST_REQUIRE_EQUAL(xTree.NumDescendants(), numP);
 
@@ -592,7 +592,7 @@ BOOST_AUTO_TEST_CASE(XTreeTraverserTest)
   knn1.Search(5, neighbors1, distances1);
 
   // Nearest neighbor search the naive way.
-  KNN knn2(dataset, true, true);
+  KNN knn2(dataset, NAIVE_MODE);
 
   knn2.Search(5, neighbors2, distances2);
 
@@ -621,7 +621,7 @@ BOOST_AUTO_TEST_CASE(HilbertRTreeTraverserTest)
 
   // Nearest neighbor search with the Hilbert R tree.
   NeighborSearch<NearestNeighborSort, metric::LMetric<2, true>, arma::mat,
-      HilbertRTree> knn1(&hilbertRTree, true);
+      HilbertRTree> knn1(&hilbertRTree, SINGLE_TREE_MODE);
 
   BOOST_REQUIRE_EQUAL(hilbertRTree.NumDescendants(), numP);
 
@@ -633,7 +633,7 @@ BOOST_AUTO_TEST_CASE(HilbertRTreeTraverserTest)
   knn1.Search(5, neighbors1, distances1);
 
   // Nearest neighbor search the naive way.
-  KNN knn2(dataset, true, true);
+  KNN knn2(dataset, NAIVE_MODE);
 
   knn2.Search(5, neighbors2, distances2);
 
@@ -933,7 +933,7 @@ BOOST_AUTO_TEST_CASE(RPlusTreeTraverserTest)
   // Nearest neighbor search with the R+ tree.
 
   NeighborSearch<NearestNeighborSort, metric::LMetric<2, true>, arma::mat,
-      RPlusTree > knn1(&rPlusTree, true);
+      RPlusTree > knn1(&rPlusTree, SINGLE_TREE_MODE);
 
   BOOST_REQUIRE_EQUAL(rPlusTree.NumDescendants(), numP);
 
@@ -946,7 +946,7 @@ BOOST_AUTO_TEST_CASE(RPlusTreeTraverserTest)
   knn1.Search(5, neighbors1, distances1);
 
   // Nearest neighbor search the naive way.
-  KNN knn2(dataset, true, true);
+  KNN knn2(dataset, NAIVE_MODE);
 
   knn2.Search(5, neighbors2, distances2);
 
@@ -1064,7 +1064,7 @@ BOOST_AUTO_TEST_CASE(RPlusPlusTreeTraverserTest)
   // Nearest neighbor search with the R++ tree.
 
   NeighborSearch<NearestNeighborSort, metric::LMetric<2, true>,
-      arma::mat, RPlusPlusTree > knn1(&rPlusPlusTree, true);
+      arma::mat, RPlusPlusTree > knn1(&rPlusPlusTree, SINGLE_TREE_MODE);
 
   BOOST_REQUIRE_EQUAL(rPlusPlusTree.NumDescendants(), numP);
 
@@ -1077,7 +1077,7 @@ BOOST_AUTO_TEST_CASE(RPlusPlusTreeTraverserTest)
   knn1.Search(5, neighbors1, distances1);
 
   // Nearest neighbor search the naive way.
-  KNN knn2(dataset, true, true);
+  KNN knn2(dataset, NAIVE_MODE);
 
   knn2.Search(5, neighbors2, distances2);
 
diff --git a/src/mlpack/tests/serialization_test.cpp b/src/mlpack/tests/serialization_test.cpp
index 49a913f..e6aecc7 100644
--- a/src/mlpack/tests/serialization_test.cpp
+++ b/src/mlpack/tests/serialization_test.cpp
@@ -806,7 +806,7 @@ BOOST_AUTO_TEST_CASE(KNNTest)
   using neighbor::KNN;
   arma::mat dataset = arma::randu<arma::mat>(5, 2000);
 
-  KNN knn(dataset, false, false);
+  KNN knn(dataset, DUAL_TREE_MODE);
 
   KNN knnXml, knnText, knnBinary;
 
diff --git a/src/mlpack/tests/vantage_point_tree_test.cpp b/src/mlpack/tests/vantage_point_tree_test.cpp
index babdbef..a4b6fb2 100644
--- a/src/mlpack/tests/vantage_point_tree_test.cpp
+++ b/src/mlpack/tests/vantage_point_tree_test.cpp
@@ -237,12 +237,12 @@ BOOST_AUTO_TEST_CASE(SingleTreeTraverserTest)
 
   // Nearest neighbor search with the VP tree.
   NeighborSearch<NearestNeighborSort, metric::LMetric<2, true>, arma::mat,
-      VPTree> knn1(dataset, false, true);
+      VPTree> knn1(dataset, SINGLE_TREE_MODE);
 
   knn1.Search(5, neighbors1, distances1);
 
   // Nearest neighbor search the naive way.
-  KNN knn2(dataset, true, true);
+  KNN knn2(dataset, NAIVE_MODE);
 
   knn2.Search(5, neighbors2, distances2);
 
@@ -264,12 +264,12 @@ BOOST_AUTO_TEST_CASE(DualTreeTraverserTest)
 
   // Nearest neighbor search with the VP tree.
   NeighborSearch<NearestNeighborSort, metric::LMetric<2, true>, arma::mat,
-      VPTree> knn1(dataset, false, false);
+      VPTree> knn1(dataset, DUAL_TREE_MODE);
 
   knn1.Search(5, neighbors1, distances1);
 
   // Nearest neighbor search the naive way.
-  KNN knn2(dataset, true, true);
+  KNN knn2(dataset, NAIVE_MODE);
 
   knn2.Search(5, neighbors2, distances2);
 




More information about the mlpack-git mailing list