NearestNeighborsLinear.h
161 ElemSort(const _T &e, const typename NearestNeighbors<_T>::DistanceFunction &df) : e_(e), df_(df)
A nearest neighbors datastructure that uses linear search.
Definition: NearestNeighborsLinear.h:57
void list(std::vector< _T > &data) const override
Get all the elements in the datastructure.
Definition: NearestNeighborsLinear.h:149
std::size_t size() const override
Get the number of elements in the datastructure.
Definition: NearestNeighborsLinear.h:144
_T nearest(const _T &data) const override
Get the nearest neighbor of a point.
Definition: NearestNeighborsLinear.h:98
void nearestR(const _T &data, double radius, std::vector< _T > &nbh) const override
Return the nearest neighbors within distance radius in sorted order.
Definition: NearestNeighborsLinear.h:135
std::vector< _T > data_
The data elements stored in this structure.
Definition: NearestNeighborsLinear.h:156
void add(const _T &data) override
Add an element to the datastructure.
Definition: NearestNeighborsLinear.h:75
bool remove(const _T &data) override
Remove an element from the datastructure.
Definition: NearestNeighborsLinear.h:86
void nearestK(const _T &data, std::size_t k, std::vector< _T > &nbh) const override
Return the k nearest neighbors in sorted order.
Definition: NearestNeighborsLinear.h:119
bool reportsSortedResults() const override
Return true if the solutions reported by this data structure are sorted, when calling nearestK / near...
Definition: NearestNeighborsLinear.h:70
void add(const std::vector< _T > &data) override
Add a vector of points.
Definition: NearestNeighborsLinear.h:80
Abstract representation of a container that can perform nearest neighbors queries.
Definition: NearestNeighbors.h:48
std::function< double(const _T &, const _T &)> DistanceFunction
The definition of a distance function.
Definition: NearestNeighbors.h:51