Robotics Library  0.7.0
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
rl::math::LinearNearestNeighbors< MetricT, ContainerT > Class Template Reference

Linear nearest neighbor search. More...

#include <LinearNearestNeighbors.h>

Classes

struct  NeighborCompare
 

Public Types

typedef ContainerT::const_iterator const_iterator
 
typedef const MetricT::Value & const_reference
 
typedef ContainerT::difference_type difference_type
 
typedef ContainerT::iterator iterator
 
typedef MetricT::Value & reference
 
typedef ContainerT::size_type size_type
 
typedef MetricT::Value value_type
 
typedef ContainerT Container
 
typedef MetricT::Distance Distance
 
typedef MetricT Metric
 
typedef MetricT::Value Value
 
typedef ::std::pair< Distance, ValueNeighbor
 

Public Member Functions

 LinearNearestNeighbors (const Metric &metric)
 
 LinearNearestNeighbors (Metric &&metric=Metric())
 
template<typename InputIterator >
 LinearNearestNeighbors (InputIterator first, InputIterator last, const Metric &metric)
 
template<typename InputIterator >
 LinearNearestNeighbors (InputIterator first, InputIterator last, Metric &&metric=Metric())
 
 ~LinearNearestNeighbors ()
 
Valueat (const ::std::size_t &i)
 
const Valueat (const ::std::size_t &i) const
 
Valueback ()
 
const Valueback () const
 
iterator begin ()
 
const_iterator begin () const
 
::std::size_t capacity () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
void erase (const_iterator pos)
 
Valuefront ()
 
const Valuefront () const
 
template<typename InputIterator >
void insert (InputIterator first, InputIterator last)
 
::std::size_t max_size () const
 
::std::vector< Neighbornearest (const Value &query, const ::std::size_t &k, const bool &sorted=true) const
 
Valueoperator[] (const ::std::size_t &i)
 
const Valueoperator[] (const ::std::size_t &i) const
 
void push (const Value &value)
 
::std::vector< Neighborradius (const Value &query, const Distance &radius, const bool &sorted=true) const
 
void reserve (const ::std::size_t &capacity)
 
::std::size_t size () const
 
void swap (LinearNearestNeighbors &other)
 

Private Member Functions

::std::vector< Neighborsearch (const Value &query, const ::std::size_t *k, const Distance *radius, const bool &sorted) const
 

Private Attributes

Container container
 
Metric metric
 

Friends

void swap (LinearNearestNeighbors &lhs, LinearNearestNeighbors &rhs)
 

Detailed Description

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
class rl::math::LinearNearestNeighbors< MetricT, ContainerT >

Linear nearest neighbor search.

Member Typedef Documentation

◆ const_iterator

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef ContainerT::const_iterator rl::math::LinearNearestNeighbors< MetricT, ContainerT >::const_iterator

◆ const_reference

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef const MetricT::Value& rl::math::LinearNearestNeighbors< MetricT, ContainerT >::const_reference

◆ Container

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef ContainerT rl::math::LinearNearestNeighbors< MetricT, ContainerT >::Container

◆ difference_type

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef ContainerT::difference_type rl::math::LinearNearestNeighbors< MetricT, ContainerT >::difference_type

◆ Distance

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef MetricT::Distance rl::math::LinearNearestNeighbors< MetricT, ContainerT >::Distance

◆ iterator

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef ContainerT::iterator rl::math::LinearNearestNeighbors< MetricT, ContainerT >::iterator

◆ Metric

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef MetricT rl::math::LinearNearestNeighbors< MetricT, ContainerT >::Metric

◆ Neighbor

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef ::std::pair<Distance, Value> rl::math::LinearNearestNeighbors< MetricT, ContainerT >::Neighbor

◆ reference

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef MetricT::Value& rl::math::LinearNearestNeighbors< MetricT, ContainerT >::reference

◆ size_type

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef ContainerT::size_type rl::math::LinearNearestNeighbors< MetricT, ContainerT >::size_type

◆ Value

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef MetricT::Value rl::math::LinearNearestNeighbors< MetricT, ContainerT >::Value

◆ value_type

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
typedef MetricT::Value rl::math::LinearNearestNeighbors< MetricT, ContainerT >::value_type

Constructor & Destructor Documentation

◆ LinearNearestNeighbors() [1/4]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
rl::math::LinearNearestNeighbors< MetricT, ContainerT >::LinearNearestNeighbors ( const Metric metric)
inlineexplicit

◆ LinearNearestNeighbors() [2/4]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
rl::math::LinearNearestNeighbors< MetricT, ContainerT >::LinearNearestNeighbors ( Metric &&  metric = Metric())
inlineexplicit

◆ LinearNearestNeighbors() [3/4]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
template<typename InputIterator >
rl::math::LinearNearestNeighbors< MetricT, ContainerT >::LinearNearestNeighbors ( InputIterator  first,
InputIterator  last,
const Metric metric 
)
inline

◆ LinearNearestNeighbors() [4/4]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
template<typename InputIterator >
rl::math::LinearNearestNeighbors< MetricT, ContainerT >::LinearNearestNeighbors ( InputIterator  first,
InputIterator  last,
Metric &&  metric = Metric() 
)
inline

◆ ~LinearNearestNeighbors()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
rl::math::LinearNearestNeighbors< MetricT, ContainerT >::~LinearNearestNeighbors ( )
inline

Member Function Documentation

◆ at() [1/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
Value& rl::math::LinearNearestNeighbors< MetricT, ContainerT >::at ( const ::std::size_t &  i)
inline

◆ at() [2/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
const Value& rl::math::LinearNearestNeighbors< MetricT, ContainerT >::at ( const ::std::size_t &  i) const
inline

◆ back() [1/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
Value& rl::math::LinearNearestNeighbors< MetricT, ContainerT >::back ( )
inline

◆ back() [2/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
const Value& rl::math::LinearNearestNeighbors< MetricT, ContainerT >::back ( ) const
inline

◆ begin() [1/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
iterator rl::math::LinearNearestNeighbors< MetricT, ContainerT >::begin ( )
inline

◆ begin() [2/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
const_iterator rl::math::LinearNearestNeighbors< MetricT, ContainerT >::begin ( ) const
inline

◆ capacity()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
::std::size_t rl::math::LinearNearestNeighbors< MetricT, ContainerT >::capacity ( ) const
inline

◆ cbegin()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
const_iterator rl::math::LinearNearestNeighbors< MetricT, ContainerT >::cbegin ( ) const
inline

◆ cend()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
const_iterator rl::math::LinearNearestNeighbors< MetricT, ContainerT >::cend ( ) const
inline

◆ clear()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
void rl::math::LinearNearestNeighbors< MetricT, ContainerT >::clear ( )
inline

◆ empty()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
bool rl::math::LinearNearestNeighbors< MetricT, ContainerT >::empty ( ) const
inline

◆ end() [1/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
iterator rl::math::LinearNearestNeighbors< MetricT, ContainerT >::end ( )
inline

◆ end() [2/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
const_iterator rl::math::LinearNearestNeighbors< MetricT, ContainerT >::end ( ) const
inline

◆ erase()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
void rl::math::LinearNearestNeighbors< MetricT, ContainerT >::erase ( const_iterator  pos)
inline

◆ front() [1/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
Value& rl::math::LinearNearestNeighbors< MetricT, ContainerT >::front ( )
inline

◆ front() [2/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
const Value& rl::math::LinearNearestNeighbors< MetricT, ContainerT >::front ( ) const
inline

◆ insert()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
template<typename InputIterator >
void rl::math::LinearNearestNeighbors< MetricT, ContainerT >::insert ( InputIterator  first,
InputIterator  last 
)
inline

◆ max_size()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
::std::size_t rl::math::LinearNearestNeighbors< MetricT, ContainerT >::max_size ( ) const
inline

◆ nearest()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
::std::vector<Neighbor> rl::math::LinearNearestNeighbors< MetricT, ContainerT >::nearest ( const Value query,
const ::std::size_t &  k,
const bool &  sorted = true 
) const
inline

◆ operator[]() [1/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
Value& rl::math::LinearNearestNeighbors< MetricT, ContainerT >::operator[] ( const ::std::size_t &  i)
inline

◆ operator[]() [2/2]

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
const Value& rl::math::LinearNearestNeighbors< MetricT, ContainerT >::operator[] ( const ::std::size_t &  i) const
inline

◆ push()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
void rl::math::LinearNearestNeighbors< MetricT, ContainerT >::push ( const Value value)
inline

◆ radius()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
::std::vector<Neighbor> rl::math::LinearNearestNeighbors< MetricT, ContainerT >::radius ( const Value query,
const Distance radius,
const bool &  sorted = true 
) const
inline

◆ reserve()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
void rl::math::LinearNearestNeighbors< MetricT, ContainerT >::reserve ( const ::std::size_t &  capacity)
inline

◆ search()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
::std::vector<Neighbor> rl::math::LinearNearestNeighbors< MetricT, ContainerT >::search ( const Value query,
const ::std::size_t *  k,
const Distance radius,
const bool &  sorted 
) const
inlineprivate

◆ size()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
::std::size_t rl::math::LinearNearestNeighbors< MetricT, ContainerT >::size ( ) const
inline

◆ swap()

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
void rl::math::LinearNearestNeighbors< MetricT, ContainerT >::swap ( LinearNearestNeighbors< MetricT, ContainerT > &  other)
inline

Friends And Related Function Documentation

◆ swap

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
void swap ( LinearNearestNeighbors< MetricT, ContainerT > &  lhs,
LinearNearestNeighbors< MetricT, ContainerT > &  rhs 
)
friend

Member Data Documentation

◆ container

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
Container rl::math::LinearNearestNeighbors< MetricT, ContainerT >::container
private

◆ metric

template<typename MetricT, typename ContainerT = ::std::vector<typename MetricT::Value>>
Metric rl::math::LinearNearestNeighbors< MetricT, ContainerT >::metric
private

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