[mlpack] 28/35: Apply fix from #731 to RangeSearch and RASearch.

Barak A. Pearlmutter barak+git at pearlmutter.net
Thu Sep 15 23:29:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch master
in repository mlpack.

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.
---
 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.
   }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list