15 #ifndef __MLPACK_METHODS_RANGE_SEARCH_RANGE_SEARCH_HPP
16 #define __MLPACK_METHODS_RANGE_SEARCH_RANGE_SEARCH_HPP
58 const typename TreeType::Mat&
querySet,
59 const bool naive =
false,
61 const MetricType
metric = MetricType());
82 RangeSearch(
const typename TreeType::Mat& referenceSet,
83 const bool naive =
false,
85 const MetricType
metric = MetricType());
118 const typename TreeType::Mat& referenceSet,
119 const typename TreeType::Mat& querySet,
121 const MetricType
metric = MetricType());
151 const typename TreeType::Mat& referenceSet,
153 const MetricType
metric = MetricType());
188 std::vector<std::vector<size_t> >& neighbors,
189 std::vector<std::vector<double> >& distances);
237 #include "range_search_impl.hpp"
The RangeSearch class is a template class for performing range searches.
Linear algebra utility functions, generally performed on matrices or vectors.
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...
std::string ToString() const
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).
RangeSearch(const typename TreeType::Mat &referenceSet, const typename TreeType::Mat &querySet, const bool naive=false, const bool singleMode=false, const MetricType metric=MetricType())
Initialize the RangeSearch object with a different reference set and a query set. ...
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.