[mlpack-git] master: Document when singleMode is useful and add SingleMode(). (0c9af65)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Apr 23 10:40:27 EDT 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/57d0567dddff01feea73b348f38cc040dc3cf8e3...3ad38770911c7b9840901f0934bd1a81c2249046
>---------------------------------------------------------------
commit 0c9af65ee08e0e1dc2d4c48124a090beeb9f90e2
Author: ryan <ryan at ratml.org>
Date: Wed Apr 22 18:36:28 2015 -0400
Document when singleMode is useful and add SingleMode().
>---------------------------------------------------------------
0c9af65ee08e0e1dc2d4c48124a090beeb9f90e2
src/mlpack/methods/neighbor_search/neighbor_search.hpp | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/mlpack/methods/neighbor_search/neighbor_search.hpp b/src/mlpack/methods/neighbor_search/neighbor_search.hpp
index 18111a3..80306e1 100644
--- a/src/mlpack/methods/neighbor_search/neighbor_search.hpp
+++ b/src/mlpack/methods/neighbor_search/neighbor_search.hpp
@@ -113,6 +113,11 @@ class NeighborSearch
* n columns by k rows, where n is the number of points in the query dataset
* and k is the number of neighbors being searched for.
*
+ * If querySet contains only a few query points, the extra cost of building a
+ * tree on the points for dual-tree search may not be warranted, and it may be
+ * worthwhile to set singleMode = false (either in the constructor or with
+ * SingleMode()).
+ *
* @param querySet Set of query points (can be just one point).
* @param k Number of neighbors to search for.
* @param neighbors Matrix storing lists of neighbors for each query point.
@@ -173,6 +178,11 @@ class NeighborSearch
//! Modify the number of node combination scores.
size_t& Scores() { return scores; }
+ //! Access whether or not search is done in single-tree mode.
+ bool SingleMode() const { return singleMode; }
+ //! Modify whether or not search is done in single-tree mode.
+ bool& SingleMode() { return singleMode; }
+
private:
//! Copy of reference dataset (if we need it, because tree building modifies
//! it).
More information about the mlpack-git
mailing list