23 #ifndef __MLPACK_METHODS_RANGE_SEARCH_RANGE_SEARCH_HPP 24 #define __MLPACK_METHODS_RANGE_SEARCH_RANGE_SEARCH_HPP 66 const typename TreeType::Mat&
querySet,
67 const bool naive =
false,
69 const MetricType
metric = MetricType());
90 RangeSearch(
const typename TreeType::Mat& referenceSet,
91 const bool naive =
false,
93 const MetricType
metric = MetricType());
126 const typename TreeType::Mat& referenceSet,
127 const typename TreeType::Mat& querySet,
129 const MetricType
metric = MetricType());
159 const typename TreeType::Mat& referenceSet,
161 const MetricType
metric = MetricType());
196 std::vector<std::vector<size_t> >& neighbors,
197 std::vector<std::vector<double> >& distances);
245 #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.