Robotics Library
0.7.0
|
k-d tree. More...
#include <KdtreeNearestNeighbors.h>
Classes | |
struct | Branch |
struct | BranchCompare |
struct | Cut |
struct | NeighborCompare |
struct | Node |
Public Types | |
typedef const MetricT::Value & | const_reference |
typedef ::std::ptrdiff_t | difference_type |
typedef MetricT::Value & | reference |
typedef ::std::size_t | size_type |
typedef MetricT::Value | value_type |
typedef MetricT::Distance | Distance |
typedef MetricT | Metric |
typedef MetricT::Size | Size |
typedef MetricT::Value | Value |
typedef ::std::pair< Distance, Value > | Neighbor |
Public Member Functions | |
KdtreeNearestNeighbors (const Metric &metric) | |
KdtreeNearestNeighbors (Metric &&metric=Metric()) | |
template<typename InputIterator > | |
KdtreeNearestNeighbors (InputIterator first, InputIterator last, const Metric &metric) | |
template<typename InputIterator > | |
KdtreeNearestNeighbors (InputIterator first, InputIterator last, Metric &&metric=Metric()) | |
~KdtreeNearestNeighbors () | |
void | clear () |
::std::vector< Value > | data () const |
bool | empty () const |
::boost::optional< ::std::size_t > | getChecks () const |
::std::size_t | getSamples () const |
template<typename InputIterator > | |
void | insert (InputIterator first, InputIterator last) |
::std::vector< Neighbor > | nearest (const Value &query, const ::std::size_t &k, const bool &sorted=true) const |
void | push (const Value &value) |
::std::vector< Neighbor > | radius (const Value &query, const Distance &radius, const bool &sorted=true) const |
void | setChecks (const ::boost::optional< ::std::size_t > &checks) |
void | setSamples (const ::std::size_t &samples) |
::std::size_t | size () const |
void | swap (KdtreeNearestNeighbors &other) |
Private Member Functions | |
void | data (const Node &node, ::std::vector< Value > &data) const |
template<typename InputIterator > | |
void | divide (Node &node, InputIterator first, InputIterator last) |
void | push (Node &node, const Value &value) |
::std::vector< Neighbor > | search (const Value &query, const ::std::size_t *k, const Distance *radius, const bool &sorted) const |
void | search (const Node &node, const Value &query, const ::std::size_t *k, const Distance *radius, ::std::vector< Branch > &branches, ::std::vector< Neighbor > &neighbors, ::std::size_t &checks, const Distance &mindist, const ::std::vector< Distance > &sidedist) const |
template<typename InputIterator > | |
Cut | select (InputIterator first, InputIterator last) |
Private Attributes | |
::boost::optional< ::std::size_t > | checks |
::std::vector< Distance > | mean |
Metric | metric |
Node | root |
::std::size_t | samples |
::std::size_t | values |
::std::vector< Distance > | var |
Friends | |
void | swap (KdtreeNearestNeighbors &lhs, KdtreeNearestNeighbors &rhs) |
k-d tree.
Jon Louis Bentley. Multidimensional binary search trees used for associative searching. Communications of the ACM, 18(9):509-517, September 1975.
typedef const MetricT::Value& rl::math::KdtreeNearestNeighbors< MetricT >::const_reference |
typedef ::std::ptrdiff_t rl::math::KdtreeNearestNeighbors< MetricT >::difference_type |
typedef MetricT::Distance rl::math::KdtreeNearestNeighbors< MetricT >::Distance |
typedef MetricT rl::math::KdtreeNearestNeighbors< MetricT >::Metric |
typedef ::std::pair<Distance, Value> rl::math::KdtreeNearestNeighbors< MetricT >::Neighbor |
typedef MetricT::Value& rl::math::KdtreeNearestNeighbors< MetricT >::reference |
typedef MetricT::Size rl::math::KdtreeNearestNeighbors< MetricT >::Size |
typedef ::std::size_t rl::math::KdtreeNearestNeighbors< MetricT >::size_type |
typedef MetricT::Value rl::math::KdtreeNearestNeighbors< MetricT >::Value |
typedef MetricT::Value rl::math::KdtreeNearestNeighbors< MetricT >::value_type |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |