NearestNeighbors.h
virtual void nearestR(const _T &data, double radius, std::vector< _T > &nbh) const =0
Get the nearest neighbors of a point, within a specified radius.
virtual std::size_t size() const =0
Get the number of elements in the datastructure.
virtual void add(const std::vector< _T > &data)
Add a vector of points.
Definition: NearestNeighbors.h:81
virtual void nearestK(const _T &data, std::size_t k, std::vector< _T > &nbh) const =0
Get the k-nearest neighbors of a point.
virtual void setDistanceFunction(const DistanceFunction &distFun)
Set the distance function to use.
Definition: NearestNeighbors.h:59
virtual _T nearest(const _T &data) const =0
Get the nearest neighbor of a point.
Abstract representation of a container that can perform nearest neighbors queries.
Definition: NearestNeighbors.h:48
virtual void list(std::vector< _T > &data) const =0
Get all the elements in the datastructure.
const DistanceFunction & getDistanceFunction() const
Get the distance function used.
Definition: NearestNeighbors.h:65
std::function< double(const _T &, const _T &)> DistanceFunction
The definition of a distance function.
Definition: NearestNeighbors.h:52
virtual bool reportsSortedResults() const =0
Return true if the solutions reported by this data structure are sorted, when calling nearestK / near...