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

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue May 7 15:38:58 EDT 2013


Author: rcurtin
Date: 2013-05-07 15:38:58 -0400 (Tue, 07 May 2013)
New Revision: 15019

Modified:
   mlpack/trunk/src/mlpack/tests/tree_test.cpp
Log:
Test NumDescendants() and Descendant() instead of Begin() and Count() (since
those will eventually be removed).


Modified: mlpack/trunk/src/mlpack/tests/tree_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/tree_test.cpp	2013-05-07 19:38:35 UTC (rev 15018)
+++ mlpack/trunk/src/mlpack/tests/tree_test.cpp	2013-05-07 19:38:58 UTC (rev 15019)
@@ -1693,12 +1693,9 @@
   TreeType* left = node->Left();
   TreeType* right = node->Right();
 
-  size_t begin = node->Begin();
-  size_t count = node->Count();
-
   // Check that each point which this tree claims is actually inside the tree.
-  for (size_t index = begin; index < begin + count; index++)
-    if (!node->Bound().Contains(data.col(index)))
+  for (size_t index = 0; index < node->NumDescendants(); index++)
+    if (!node->Bound().Contains(data.col(node->Descendant(index))))
       return false;
 
   return CheckPointBounds(left, data) && CheckPointBounds(right, data);




More information about the mlpack-svn mailing list