RobWorkProject  23.9.11-
Classes | Public Member Functions | Friends | List of all members
PartialIndexTable< T, Cell > Class Template Reference

Provides an Partial Index Table to be used for nearest neighbor search. More...

#include <PartialIndexTable.hpp>

Public Member Functions

 PartialIndexTable (const rw::models::Device::QBox &bounds, rw::math::Q &weights, double r, int dims)
 Constructs Partial Index Table. More...
 
void addNode (const T &node, const rw::math::Q &q)
 Adds a node to the table. More...
 
void removeNode (const T &node, const rw::math::Q &q)
 Removes node from the table. More...
 
template<class Collection >
void searchNeighbors (const rw::math::Q &q, Collection &result) const
 Searches for all potential neighbors. More...
 
std::list< T > searchNeighbors (const rw::math::Q &q) const
 Searches for all potential neighbors. More...
 

Friends

bool operator< (const Dimension &a, const Dimension &b)
 Compares which of two dimensions is the best for the table.
 

Detailed Description

template<class T, class Cell = std::list<T>>
class rwlibs::pathplanners::prm::PartialIndexTable< T, Cell >

Provides an Partial Index Table to be used for nearest neighbor search.

This class is implemented as a helper for the PRMPlanner.

Constructor & Destructor Documentation

◆ PartialIndexTable()

PartialIndexTable ( const rw::models::Device::QBox bounds,
rw::math::Q weights,
double  r,
int  dims 
)
inline

Constructs Partial Index Table.

Parameters
bounds[in] Bounds of the space to partially index
weights[in] The weights for the WeightedEuclideanMetric used determining whether two nodes are neighbors
r[in] The distance where two nodes are considered neighbors
dims[in] The number of dimensions of the table. dims has to be within [1, dof]

Member Function Documentation

◆ addNode()

void addNode ( const T &  node,
const rw::math::Q q 
)
inline

Adds a node to the table.

Parameters
node[in] Node to add
q[in] Configuration of node

◆ removeNode()

void removeNode ( const T &  node,
const rw::math::Q q 
)
inline

Removes node from the table.

Parameters
node[in] Node to remove
q[in] Configuration associated with the node. Used to find the table entry containing the node.

◆ searchNeighbors() [1/2]

std::list<T> searchNeighbors ( const rw::math::Q q) const
inline

Searches for all potential neighbors.

The potential neighbor is those within the cell associated with q and all neighboring cells.

To find the true neighbors one has to run through the content of the list and make an exact match.

Parameters
q[in] Configuration to search neighbors for

◆ searchNeighbors() [2/2]

void searchNeighbors ( const rw::math::Q q,
Collection &  result 
) const
inline

Searches for all potential neighbors.

The potential neighbor is those within the cell associated with q and all neighboring cells.

To find the true neighbors one has to run through the content of the list and make an exact match.

Parameters
q[in] Configuration to search neighbors for
result[out] The neighbors of q

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