Abstract representation of a container that can perform nearest neighbors queries. More...
#include <NearestNeighbors.h>
Public Types | |
typedef std::function< double(const _T &, const _T &)> | DistanceFunction |
The definition of a distance function. More... | |
Public Member Functions | |
virtual void | add (const _T &data)=0 |
Add an element to the datastructure. More... | |
virtual void | add (const std::vector< _T > &data) |
Add a vector of points. More... | |
virtual void | clear ()=0 |
Clear the datastructure. More... | |
const DistanceFunction & | getDistanceFunction () const |
Get the distance function used. More... | |
virtual void | list (std::vector< _T > &data) const =0 |
Get all the elements in the datastructure. More... | |
virtual _T | nearest (const _T &data) const =0 |
Get the nearest neighbor of a point. More... | |
virtual void | nearestK (const _T &data, std::size_t k, std::vector< _T > &nbh) const =0 |
Get the k-nearest neighbors of a point. More... | |
NearestNeighbors ()=default | |
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. More... | |
virtual bool | remove (const _T &data)=0 |
Remove an element from the datastructure. More... | |
virtual bool | reportsSortedResults () const =0 |
Return true if the solutions reported by this data structure are sorted, when calling nearestK / nearestR. More... | |
virtual void | setDistanceFunction (const DistanceFunction &distFun) |
Set the distance function to use. More... | |
virtual std::size_t | size () const =0 |
Get the number of elements in the datastructure. More... | |
virtual | ~NearestNeighbors ()=default |
Protected Attributes | |
DistanceFunction | distFun_ |
The used distance function. More... | |
Abstract representation of a container that can perform nearest neighbors queries.
Definition at line 49 of file NearestNeighbors.h.
typedef std::function<double(const _T&, const _T&)> cached_ik_kinematics_plugin::NearestNeighbors< _T >::DistanceFunction |
The definition of a distance function.
Definition at line 53 of file NearestNeighbors.h.
|
default |
|
virtualdefault |
|
pure virtual |
Add an element to the datastructure.
Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >, and cached_ik_kinematics_plugin::NearestNeighborsGNAT< IKEntry * >.
|
inlinevirtual |
Add a vector of points.
Reimplemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >, and cached_ik_kinematics_plugin::NearestNeighborsGNAT< IKEntry * >.
Definition at line 82 of file NearestNeighbors.h.
|
pure virtual |
Clear the datastructure.
Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >, and cached_ik_kinematics_plugin::NearestNeighborsGNAT< IKEntry * >.
|
inline |
Get the distance function used.
Definition at line 66 of file NearestNeighbors.h.
|
pure virtual |
Get all the elements in the datastructure.
Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >, and cached_ik_kinematics_plugin::NearestNeighborsGNAT< IKEntry * >.
|
pure virtual |
Get the nearest neighbor of a point.
Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >, and cached_ik_kinematics_plugin::NearestNeighborsGNAT< IKEntry * >.
|
pure virtual |
Get the k-nearest neighbors of a point.
All the nearest neighbor structures currently return the neighbors in sorted order, but this is not required.
Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >, and cached_ik_kinematics_plugin::NearestNeighborsGNAT< IKEntry * >.
|
pure virtual |
Get the nearest neighbors of a point, within a specified radius.
All the nearest neighbor structures currently return the neighbors in sorted order, but this is not required.
Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >, and cached_ik_kinematics_plugin::NearestNeighborsGNAT< IKEntry * >.
|
pure virtual |
Remove an element from the datastructure.
Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >, and cached_ik_kinematics_plugin::NearestNeighborsGNAT< IKEntry * >.
|
pure virtual |
Return true if the solutions reported by this data structure are sorted, when calling nearestK / nearestR.
Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >, and cached_ik_kinematics_plugin::NearestNeighborsGNAT< IKEntry * >.
|
inlinevirtual |
Set the distance function to use.
Definition at line 60 of file NearestNeighbors.h.
|
pure virtual |
Get the number of elements in the datastructure.
Implemented in cached_ik_kinematics_plugin::NearestNeighborsGNAT< _T >, and cached_ik_kinematics_plugin::NearestNeighborsGNAT< IKEntry * >.
|
protected |
The used distance function.
Definition at line 116 of file NearestNeighbors.h.