NearestNeighborsLinear.h
129 {
161 ElemSort(const _T &e, const typename NearestNeighbors<_T>::DistanceFunction &df) : e_(e), df_(df)
162 {
bool remove(const _T &data) override
Remove an element from the datastructure.
Definition: NearestNeighborsLinear.h:150
_T nearest(const _T &data) const override
Get the nearest neighbor of a point.
Definition: NearestNeighborsLinear.h:162
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:183
void list(std::vector< _T > &data) const override
Get all the elements in the datastructure.
Definition: NearestNeighborsLinear.h:213
std::function< double(const _T &, const _T &)> DistanceFunction
The definition of a distance function.
Definition: NearestNeighbors.h:115
void add(const _T &data) override
Add an element to the datastructure.
Definition: NearestNeighborsLinear.h:139
std::vector< _T > data_
The data elements stored in this structure.
Definition: NearestNeighborsLinear.h:220
std::size_t size() const override
Get the number of elements in the datastructure.
Definition: NearestNeighborsLinear.h:208
Abstract representation of a container that can perform nearest neighbors queries.
Definition: NearestNeighbors.h:79
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:199
bool reportsSortedResults() const override
Return true if the solutions reported by this data structure are sorted, when calling nearestK / near...
Definition: NearestNeighborsLinear.h:134