Loading...
Searching...
No Matches
ompl::NearestNeighbors< _T > Class Template Referenceabstract

Abstract representation of a container that can perform nearest neighbors queries. More...

#include <ompl/datastructures/NearestNeighbors.h>

Inheritance diagram for ompl::NearestNeighbors< _T >:

Public Types

using DistanceFunction = std::function<double(const _T &, const _T &)>
 The definition of a distance function.
 

Public Member Functions

virtual void setDistanceFunction (const DistanceFunction &distFun)
 Set the distance function to use.
 
const DistanceFunctiongetDistanceFunction () const
 Get the distance function used.
 
virtual bool reportsSortedResults () const =0
 Return true if the solutions reported by this data structure are sorted, when calling nearestK / nearestR.
 
virtual void clear ()=0
 Clear the datastructure.
 
virtual void add (const _T &data)=0
 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)=0
 Remove an element from the datastructure.
 
virtual _T nearest (const _T &data) const =0
 Get the nearest neighbor of a point.
 
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 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 list (std::vector< _T > &data) const =0
 Get all the elements in the datastructure.
 

Protected Attributes

DistanceFunction distFun_
 The used distance function.
 

Detailed Description

template<typename _T>
class ompl::NearestNeighbors< _T >

Abstract representation of a container that can perform nearest neighbors queries.

Definition at line 47 of file NearestNeighbors.h.

Member Typedef Documentation

◆ DistanceFunction

template<typename _T>
using ompl::NearestNeighbors< _T >::DistanceFunction = std::function<double(const _T &, const _T &)>

The definition of a distance function.

Definition at line 51 of file NearestNeighbors.h.

Member Function Documentation

◆ add() [1/2]

◆ add() [2/2]

◆ clear()

◆ getDistanceFunction()

template<typename _T>
const DistanceFunction & ompl::NearestNeighbors< _T >::getDistanceFunction ( ) const
inline

Get the distance function used.

Definition at line 64 of file NearestNeighbors.h.

◆ list()

◆ nearest()

◆ nearestK()

template<typename _T>
virtual void ompl::NearestNeighbors< _T >::nearestK ( const _T & data,
std::size_t k,
std::vector< _T > & nbh ) const
pure virtual

◆ nearestR()

template<typename _T>
virtual void ompl::NearestNeighbors< _T >::nearestR ( const _T & data,
double radius,
std::vector< _T > & nbh ) const
pure virtual

◆ remove()

◆ reportsSortedResults()

◆ setDistanceFunction()

template<typename _T>
virtual void ompl::NearestNeighbors< _T >::setDistanceFunction ( const DistanceFunction & distFun)
inlinevirtual

Set the distance function to use.

Definition at line 58 of file NearestNeighbors.h.

◆ size()

Member Data Documentation

◆ distFun_

template<typename _T>
DistanceFunction ompl::NearestNeighbors< _T >::distFun_
protected

The used distance function.

Definition at line 114 of file NearestNeighbors.h.


The documentation for this class was generated from the following file: