A nearest neighbors datastructure that uses linear search. More...
#include <NearestNeighborsLinear.h>
Public Member Functions | |
virtual void | clear (void) |
Clear the datastructure. | |
virtual void | add (const _T &data) |
Add an element to the datastructure. | |
virtual void | add (const std::vector< _T > &data) |
Add a vector of points. | |
virtual bool | remove (const _T &data) |
Remove an element from the datastructure. | |
virtual _T | nearest (const _T &data) const |
Get the nearest neighbor of a point. | |
virtual void | nearestK (const _T &data, std::size_t k, std::vector< _T > &nbh) const |
Get the k-nearest neighbors of a point. | |
virtual void | nearestR (const _T &data, double radius, std::vector< _T > &nbh) const |
Get the nearest neighbors of a point, within a specified radius. | |
virtual std::size_t | size (void) const |
Get the number of elements in the datastructure. | |
virtual void | list (std::vector< _T > &data) const |
Get all the elements in the datastructure. | |
![]() | |
virtual void | setDistanceFunction (const DistanceFunction &distFun) |
Set the distance function to use. | |
const DistanceFunction & | getDistanceFunction (void) const |
Get the distance function used. | |
Protected Attributes | |
std::vector< _T > | data_ |
The data elements stored in this structure. | |
![]() | |
DistanceFunction | distFun_ |
The used distance function. | |
Additional Inherited Members | |
![]() | |
typedef boost::function < double(const _T &, const _T &)> | DistanceFunction |
The definition of a distance function. | |
A nearest neighbors datastructure that uses linear search.
Definition at line 57 of file NearestNeighborsLinear.h.