[mlpack-git] mlpack-2.0.x: Apply fix from #731 to RangeSearch and RASearch. (715c474)

gitdub at mlpack.org gitdub at mlpack.org
Wed Jul 20 19:28:30 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : mlpack-2.0.x
Link       : https://github.com/mlpack/mlpack/compare/fc4195d27bb9e642356a384d1fa6fe10cbdf89a6...715c474599e71bb47899a4b6eb3ec5582650d7f9

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

commit 715c474599e71bb47899a4b6eb3ec5582650d7f9
Author: Ryan Curtin <ryan at ratml.org>
Date:   Wed Jul 20 19:27:05 2016 -0400

    Apply fix from #731 to RangeSearch and RASearch.


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

715c474599e71bb47899a4b6eb3ec5582650d7f9
 src/mlpack/methods/range_search/range_search_impl.hpp | 2 +-
 src/mlpack/methods/rann/ra_search_impl.hpp            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/methods/range_search/range_search_impl.hpp b/src/mlpack/methods/range_search/range_search_impl.hpp
index 737b0ea..505dc32 100644
--- a/src/mlpack/methods/range_search/range_search_impl.hpp
+++ b/src/mlpack/methods/range_search/range_search_impl.hpp
@@ -324,7 +324,7 @@ void RangeSearch<MetricType, MatType, TreeType>::Search(
 
     // Reference indices only need to be mapped if we built the reference tree
     // ourselves.
-    if (treeOwner)
+    else if (treeOwner)
       neighborPtr = new std::vector<std::vector<size_t>>;
   }
 
diff --git a/src/mlpack/methods/rann/ra_search_impl.hpp b/src/mlpack/methods/rann/ra_search_impl.hpp
index 95d54ea..c38a1aa 100644
--- a/src/mlpack/methods/rann/ra_search_impl.hpp
+++ b/src/mlpack/methods/rann/ra_search_impl.hpp
@@ -354,7 +354,7 @@ Search(const MatType& querySet,
       neighborPtr = new arma::Mat<size_t>;
     }
 
-    if (treeOwner)
+    else if (treeOwner)
       neighborPtr = new arma::Mat<size_t>; // All indices need mapping.
   }
 




More information about the mlpack-git mailing list