23 #ifndef __MLPACK_METHODS_RANGE_SEARCH_RANGE_SEARCH_HPP
24 #define __MLPACK_METHODS_RANGE_SEARCH_RANGE_SEARCH_HPP
69 const typename TreeType::Mat&
querySet,
70 const bool naive =
false,
72 const size_t leafSize = 20,
73 const MetricType
metric = MetricType());
94 RangeSearch(
const typename TreeType::Mat& referenceSet,
95 const bool naive =
false,
97 const size_t leafSize = 20,
98 const MetricType
metric = MetricType());
131 const typename TreeType::Mat& referenceSet,
132 const typename TreeType::Mat& querySet,
134 const MetricType
metric = MetricType());
164 const typename TreeType::Mat& referenceSet,
166 const MetricType
metric = MetricType());
201 std::vector<std::vector<size_t> >& neighbors,
202 std::vector<std::vector<double> >& distances);
247 #include "range_search_impl.hpp"
The RangeSearch class is a template class for performing range searches.
LMetric< 2, true > EuclideanDistance
~RangeSearch()
Destroy the RangeSearch object.
std::vector< size_t > oldFromNewReferences
Mappings to old reference indices (used when this object builds trees).
size_t numPrunes
The number of pruned nodes during computation.
A binary space partitioning tree, such as a KD-tree or a ball tree.
bool naive
If true, O(n^2) naive computation is used.
TreeType * referenceTree
Reference tree.
void Search(const math::Range &range, std::vector< std::vector< size_t > > &neighbors, std::vector< std::vector< double > > &distances)
Search for all points in the given range, returning the results in the neighbors and distances object...
TreeType::Mat referenceCopy
Copy of reference matrix; used when a tree is built internally.
Statistic class for RangeSearch, to be set to the StatisticType of the tree type that range search is...
TreeType::Mat queryCopy
Copy of query matrix; used when a tree is built internally.
bool hasQuerySet
If true, a query set was passed; if false, the query set is the reference set.
const TreeType::Mat & referenceSet
Reference set (data should be accessed using this).
std::vector< size_t > oldFromNewQueries
Mappings to old query indices (used when this object builds trees).
const TreeType::Mat & querySet
Query set (data should be accessed using this).
TreeType * queryTree
Query tree (may be NULL).
MetricType metric
Instantiated distance metric.
bool treeOwner
If true, this object is responsible for deleting the trees.
bool singleMode
If true, single-tree computation is used.
Simple real-valued range.
RangeSearch(const typename TreeType::Mat &referenceSet, const typename TreeType::Mat &querySet, const bool naive=false, const bool singleMode=false, const size_t leafSize=20, const MetricType metric=MetricType())
Initialize the RangeSearch object with a different reference set and a query set. ...