ompl::NearestNeighborsLinear< _T > Class Template Reference

A nearest neighbors datastructure that uses linear search. More...

#include <ompl/datastructures/NearestNeighborsLinear.h>

Inheritance diagram for ompl::NearestNeighborsLinear< _T >:

List of all members.

Classes

struct  ElemSort

Public Member Functions

virtual void clear ()
 Clear the datastructure.
virtual bool reportsSortedResults () const
 Return true if the solutions reported by this data structure are sorted, when calling nearestK / nearestR.
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
 Return the k nearest neighbors in sorted order.
virtual void nearestR (const _T &data, double radius, std::vector< _T > &nbh) const
 Return the nearest neighbors within distance radius in sorted order.
virtual std::size_t size () const
 Get the number of elements in the datastructure.
virtual void list (std::vector< _T > &data) const
 Get all the elements in the datastructure.

Protected Attributes

std::vector< _T > data_
 The data elements stored in this structure.

Detailed Description

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

A nearest neighbors datastructure that uses linear search.

  • Search for nearest neighbor is O(n).
  • Search for k-nearest neighbors is O(n log(k)).
  • Search for neighbors within a range is O(n log(n)).
  • Adding an element to the datastructure is O(1).
  • Removing an element from the datastructure O(n).

Definition at line 57 of file NearestNeighborsLinear.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines