[mlpack-svn] r12712 - mlpack/trunk/src/mlpack/methods/neighbor_search

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Thu May 17 13:26:59 EDT 2012


Author: rcurtin
Date: 2012-05-17 13:26:59 -0400 (Thu, 17 May 2012)
New Revision: 12712

Modified:
   mlpack/trunk/src/mlpack/methods/neighbor_search/allkfn_main.cpp
   mlpack/trunk/src/mlpack/methods/neighbor_search/allknn_main.cpp
Log:
It helps if the conditional is right, too.


Modified: mlpack/trunk/src/mlpack/methods/neighbor_search/allkfn_main.cpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/neighbor_search/allkfn_main.cpp	2012-05-17 17:26:10 UTC (rev 12711)
+++ mlpack/trunk/src/mlpack/methods/neighbor_search/allkfn_main.cpp	2012-05-17 17:26:59 UTC (rev 12712)
@@ -79,7 +79,7 @@
 
   // Sanity check on k value: must be greater than 0, must be less than the
   // number of reference points.
-  if ((k <= 0) || (k >= referenceData.n_cols))
+  if (k > referenceData.n_cols)
   {
     Log::Fatal << "Invalid k: " << k << "; must be greater than 0 and less ";
     Log::Fatal << "than or equal to the number of reference points (";

Modified: mlpack/trunk/src/mlpack/methods/neighbor_search/allknn_main.cpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/neighbor_search/allknn_main.cpp	2012-05-17 17:26:10 UTC (rev 12711)
+++ mlpack/trunk/src/mlpack/methods/neighbor_search/allknn_main.cpp	2012-05-17 17:26:59 UTC (rev 12712)
@@ -83,7 +83,7 @@
 
   // Sanity check on k value: must be greater than 0, must be less than the
   // number of reference points.
-  if ((k <= 0) || (k >= referenceData.n_cols))
+  if (k > referenceData.n_cols)
   {
     Log::Fatal << "Invalid k: " << k << "; must be greater than 0 and less ";
     Log::Fatal << "than or equal to the number of reference points (";




More information about the mlpack-svn mailing list