Go to the documentation of this file.
47 template <
typename _T>
48 class NearestNeighbors
75 virtual void clear() = 0;
78 virtual void add(
const _T& data) = 0;
81 virtual void add(
const std::vector<_T>& data)
83 for (
auto elt = data.begin(); elt != data.end(); ++elt)
88 virtual bool remove(
const _T& data) = 0;
91 virtual _T
nearest(
const _T& data)
const = 0;
98 virtual void nearestK(
const _T& data, std::size_t k, std::vector<_T>& nbh)
const = 0;
105 virtual void nearestR(
const _T& data,
double radius, std::vector<_T>& nbh)
const = 0;
108 virtual std::size_t
size()
const = 0;
111 virtual void list(std::vector<_T>& data)
const = 0;
virtual _T nearest(const _T &data) const =0
Get the nearest neighbor of a point.
virtual void list(std::vector< _T > &data) const =0
Get all the elements in the datastructure.
std::function< double(const _T &, const _T &)> DistanceFunction
The definition of a distance function.
const DistanceFunction & getDistanceFunction() const
Get the distance function used.
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.
virtual std::size_t size() const =0
Get the number of elements in the datastructure.
NearestNeighbors()=default
virtual bool remove(const _T &data)=0
Remove an element from the datastructure.
virtual bool reportsSortedResults() const =0
Return true if the solutions reported by this data structure are sorted, when calling nearestK / near...
virtual void add(const _T &data)=0
Add an element to the datastructure.
virtual void clear()=0
Clear the datastructure.
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 ~NearestNeighbors()=default
DistanceFunction distFun_
The used distance function.
moveit_kinematics
Author(s): Dave Coleman
, Ioan Sucan , Sachin Chitta
autogenerated on Sat Apr 27 2024 02:26:15