[mlpack-git] master: Apply fix from #731 to RangeSearch and RASearch. (57a24a9)

gitdub at mlpack.org gitdub at mlpack.org
Wed Jul 20 19:27:21 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/54c48dbd091eb4f419280a2e82ddbd1c7d438a5c...57a24a9d9fbdb4687ea0e0fef85bc2a133420dcc

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

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

    Apply fix from #731 to RangeSearch and RASearch.


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

57a24a9d9fbdb4687ea0e0fef85bc2a133420dcc
 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 c4ecc9d..c7e6338 100644
--- a/src/mlpack/methods/range_search/range_search_impl.hpp
+++ b/src/mlpack/methods/range_search/range_search_impl.hpp
@@ -317,7 +317,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 fcaa4e4..aa8daa5 100644
--- a/src/mlpack/methods/rann/ra_search_impl.hpp
+++ b/src/mlpack/methods/rann/ra_search_impl.hpp
@@ -347,7 +347,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