Loading...
Searching...
No Matches
ompl::NearestNeighborsGNAT< _T >::Node Class Reference

The class used internally to define the GNAT. More...

#include <ompl/datastructures/NearestNeighborsGNAT.h>

Public Member Functions

 Node (int degree, int capacity, _T pivot)
 Construct a node of given degree with at most capacity data elements and with given pivot. More...
 
void updateRadius (double dist)
 Update minRadius_ and maxRadius_, given that an element was added with distance dist to the pivot. More...
 
void updateRange (unsigned int i, double dist)
 Update minRange_[i] and maxRange_[i], given that an element was added to the i-th child of the parent that has distance dist to this Node's pivot. More...
 
void add (GNAT &gnat, const _T &data)
 Add an element to the tree rooted at this node. More...
 
bool needToSplit (const GNAT &gnat) const
 Return true iff the node needs to be split into child nodes. More...
 
void split (GNAT &gnat)
 The split operation finds pivot elements for the child nodes and moves each data element of this node to the appropriate child node. More...
 
bool insertNeighborK (NearQueue &nbh, std::size_t k, const _T &data, const _T &key, double dist) const
 Insert data in nbh if it is a near neighbor. Return true iff data was added to nbh. More...
 
void nearestK (const GNAT &gnat, const _T &data, std::size_t k, NearQueue &nbh, NodeQueue &nodeQueue, bool &isPivot) const
 Compute the k nearest neighbors of data in the tree. For k=1, isPivot is true if the nearest neighbor is a pivot (which is important during removal; removing pivots is a special case). The nodeQueue, which contains other Nodes that need to be checked for nearest neighbors, is updated. More...
 
void insertNeighborR (NearQueue &nbh, double r, const _T &data, double dist) const
 Insert data in nbh if it is a near neighbor. More...
 
void nearestR (const GNAT &gnat, const _T &data, double r, NearQueue &nbh, NodeQueue &nodeQueue) const
 Return all elements that are within distance r in nbh. The nodeQueue, which contains other Nodes that need to be checked for nearest neighbors, is updated. More...
 
void list (const GNAT &gnat, std::vector< _T > &data) const
 

Public Attributes

unsigned int degree_
 Number of child nodes. More...
 
const _T pivot_
 Data element stored in this Node. More...
 
double minRadius_
 Minimum distance between the pivot element and the elements stored in data_. More...
 
double maxRadius_
 Maximum distance between the pivot element and the elements stored in data_. More...
 
std::vector< double > minRange_
 The i-th element in minRange_ is the minimum distance between the pivot and any data_ element in the i-th child node of this node's parent. More...
 
std::vector< double > maxRange_
 The i-th element in maxRange_ is the maximum distance between the pivot and any data_ element in the i-th child node of this node's parent. More...
 
std::vector< _T > data_
 The data elements stored in this node (in addition to the pivot element). An internal node has no elements stored in data_. More...
 
std::vector< Node * > children_
 The child nodes of this node. By definition, only internal nodes have child nodes. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const Node &node)
 

Detailed Description

template<typename _T>
class ompl::NearestNeighborsGNAT< _T >::Node

The class used internally to define the GNAT.

Definition at line 387 of file NearestNeighborsGNAT.h.

Constructor & Destructor Documentation

◆ Node()

template<typename _T >
ompl::NearestNeighborsGNAT< _T >::Node::Node ( int  degree,
int  capacity,
_T  pivot 
)
inline

Construct a node of given degree with at most capacity data elements and with given pivot.

Definition at line 392 of file NearestNeighborsGNAT.h.

◆ ~Node()

template<typename _T >
ompl::NearestNeighborsGNAT< _T >::Node::~Node ( )
inline

Definition at line 408 of file NearestNeighborsGNAT.h.

Member Function Documentation

◆ add()

template<typename _T >
void ompl::NearestNeighborsGNAT< _T >::Node::add ( GNAT gnat,
const _T &  data 
)
inline

Add an element to the tree rooted at this node.

Definition at line 444 of file NearestNeighborsGNAT.h.

◆ insertNeighborK()

template<typename _T >
bool ompl::NearestNeighborsGNAT< _T >::Node::insertNeighborK ( NearQueue &  nbh,
std::size_t  k,
const _T &  data,
const _T &  key,
double  dist 
) const
inline

Insert data in nbh if it is a near neighbor. Return true iff data was added to nbh.

Definition at line 544 of file NearestNeighborsGNAT.h.

◆ insertNeighborR()

template<typename _T >
void ompl::NearestNeighborsGNAT< _T >::Node::insertNeighborR ( NearQueue &  nbh,
double  r,
const _T &  data,
double  dist 
) const
inline

Insert data in nbh if it is a near neighbor.

Definition at line 614 of file NearestNeighborsGNAT.h.

◆ list()

template<typename _T >
void ompl::NearestNeighborsGNAT< _T >::Node::list ( const GNAT gnat,
std::vector< _T > &  data 
) const
inline

Definition at line 693 of file NearestNeighborsGNAT.h.

◆ nearestK()

template<typename _T >
void ompl::NearestNeighborsGNAT< _T >::Node::nearestK ( const GNAT gnat,
const _T &  data,
std::size_t  k,
NearQueue &  nbh,
NodeQueue &  nodeQueue,
bool &  isPivot 
) const
inline

Compute the k nearest neighbors of data in the tree. For k=1, isPivot is true if the nearest neighbor is a pivot (which is important during removal; removing pivots is a special case). The nodeQueue, which contains other Nodes that need to be checked for nearest neighbors, is updated.

Definition at line 565 of file NearestNeighborsGNAT.h.

◆ nearestR()

template<typename _T >
void ompl::NearestNeighborsGNAT< _T >::Node::nearestR ( const GNAT gnat,
const _T &  data,
double  r,
NearQueue &  nbh,
NodeQueue &  nodeQueue 
) const
inline

Return all elements that are within distance r in nbh. The nodeQueue, which contains other Nodes that need to be checked for nearest neighbors, is updated.

Definition at line 622 of file NearestNeighborsGNAT.h.

◆ needToSplit()

template<typename _T >
bool ompl::NearestNeighborsGNAT< _T >::Node::needToSplit ( const GNAT gnat) const
inline

Return true iff the node needs to be split into child nodes.

Definition at line 485 of file NearestNeighborsGNAT.h.

◆ split()

template<typename _T >
void ompl::NearestNeighborsGNAT< _T >::Node::split ( GNAT gnat)
inline

The split operation finds pivot elements for the child nodes and moves each data element of this node to the appropriate child node.

Definition at line 493 of file NearestNeighborsGNAT.h.

◆ updateRadius()

template<typename _T >
void ompl::NearestNeighborsGNAT< _T >::Node::updateRadius ( double  dist)
inline

Update minRadius_ and maxRadius_, given that an element was added with distance dist to the pivot.

Definition at line 416 of file NearestNeighborsGNAT.h.

◆ updateRange()

template<typename _T >
void ompl::NearestNeighborsGNAT< _T >::Node::updateRange ( unsigned int  i,
double  dist 
)
inline

Update minRange_[i] and maxRange_[i], given that an element was added to the i-th child of the parent that has distance dist to this Node's pivot.

Definition at line 436 of file NearestNeighborsGNAT.h.

Friends And Related Function Documentation

◆ operator<<

template<typename _T >
std::ostream & operator<< ( std::ostream &  out,
const Node node 
)
friend

Definition at line 704 of file NearestNeighborsGNAT.h.

Member Data Documentation

◆ children_

template<typename _T >
std::vector<Node *> ompl::NearestNeighborsGNAT< _T >::Node::children_

The child nodes of this node. By definition, only internal nodes have child nodes.

Definition at line 752 of file NearestNeighborsGNAT.h.

◆ data_

template<typename _T >
std::vector<_T> ompl::NearestNeighborsGNAT< _T >::Node::data_

The data elements stored in this node (in addition to the pivot element). An internal node has no elements stored in data_.

Definition at line 749 of file NearestNeighborsGNAT.h.

◆ degree_

template<typename _T >
unsigned int ompl::NearestNeighborsGNAT< _T >::Node::degree_

Number of child nodes.

Definition at line 734 of file NearestNeighborsGNAT.h.

◆ maxRadius_

template<typename _T >
double ompl::NearestNeighborsGNAT< _T >::Node::maxRadius_

Maximum distance between the pivot element and the elements stored in data_.

Definition at line 740 of file NearestNeighborsGNAT.h.

◆ maxRange_

template<typename _T >
std::vector<double> ompl::NearestNeighborsGNAT< _T >::Node::maxRange_

The i-th element in maxRange_ is the maximum distance between the pivot and any data_ element in the i-th child node of this node's parent.

Definition at line 746 of file NearestNeighborsGNAT.h.

◆ minRadius_

template<typename _T >
double ompl::NearestNeighborsGNAT< _T >::Node::minRadius_

Minimum distance between the pivot element and the elements stored in data_.

Definition at line 738 of file NearestNeighborsGNAT.h.

◆ minRange_

template<typename _T >
std::vector<double> ompl::NearestNeighborsGNAT< _T >::Node::minRange_

The i-th element in minRange_ is the minimum distance between the pivot and any data_ element in the i-th child node of this node's parent.

Definition at line 743 of file NearestNeighborsGNAT.h.

◆ pivot_

template<typename _T >
const _T ompl::NearestNeighborsGNAT< _T >::Node::pivot_

Data element stored in this Node.

Definition at line 736 of file NearestNeighborsGNAT.h.


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