gtsam_points
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
gtsam_points::UnsafeKdTree< PointCloud, Projection_ > Struct Template Reference

"Unsafe" KdTree. More...

#include <small_kdtree.hpp>

Collaboration diagram for gtsam_points::UnsafeKdTree< PointCloud, Projection_ >:
Collaboration graph
[legend]

Public Types

using Projection = Projection_
 
using Node = KdTreeNode< Projection >
 

Public Member Functions

template<typename Builder = KdTreeBuilder>
 UnsafeKdTree (const PointCloud &points, const Builder &builder=KdTreeBuilder())
 Constructor.
 
size_t nearest_neighbor_search (const Eigen::Vector3d &query_, size_t *k_indices, double *k_sq_dists, const KnnSetting &setting=KnnSetting()) const
 Find the nearest neighbor.
 
size_t knn_search (const Eigen::Vector3d &query_, int k, size_t *k_indices, double *k_sq_dists, const KnnSetting &setting=KnnSetting()) const
 Find k-nearest neighbors. This method uses dynamic memory allocation.
 
template<int N>
size_t knn_search (const Eigen::Vector3d &query_, size_t *k_indices, double *k_sq_dists, const KnnSetting &setting=KnnSetting()) const
 Find k-nearest neighbors. This method uses fixed and static memory allocation. Might be faster for small k.
 
size_t radius_search (const Eigen::Vector3d &query_, double radius, std::vector< size_t > &indices, std::vector< double > &sq_dists, const KnnSetting &setting=KnnSetting()) const
 Find neighbors in a search radius.
 

Public Attributes

const PointCloudpoints
 Input points.
 
std::vector< size_t > indices
 Point indices refered by nodes.
 
NodeIndexType root
 Root node index (should be zero)
 
std::vector< Node > nodes
 Kd-tree nodes.
 

Detailed Description

template<typename PointCloud, typename Projection_ = AxisAlignedProjection>
struct gtsam_points::UnsafeKdTree< PointCloud, Projection_ >

"Unsafe" KdTree.

Note
This class does not hold the ownership of the input points. You must keep the input points along with this class.

Constructor & Destructor Documentation

◆ UnsafeKdTree()

template<typename PointCloud , typename Projection_ = AxisAlignedProjection>
template<typename Builder = KdTreeBuilder>
gtsam_points::UnsafeKdTree< PointCloud, Projection_ >::UnsafeKdTree ( const PointCloud points,
const Builder &  builder = KdTreeBuilder() 
)
inlineexplicit

Constructor.

Parameters
pointsPoint cloud
builderKd-tree builder

Member Function Documentation

◆ knn_search() [1/2]

template<typename PointCloud , typename Projection_ = AxisAlignedProjection>
size_t gtsam_points::UnsafeKdTree< PointCloud, Projection_ >::knn_search ( const Eigen::Vector3d &  query_,
int  k,
size_t *  k_indices,
double *  k_sq_dists,
const KnnSetting setting = KnnSetting() 
) const
inline

Find k-nearest neighbors. This method uses dynamic memory allocation.

Parameters
queryQuery point
kNumber of neighbors
k_indicesIndices of neighbors
k_sq_distsSquared distances to neighbors
settingKNN search setting
Returns
Number of found neighbors

◆ knn_search() [2/2]

template<typename PointCloud , typename Projection_ = AxisAlignedProjection>
template<int N>
size_t gtsam_points::UnsafeKdTree< PointCloud, Projection_ >::knn_search ( const Eigen::Vector3d &  query_,
size_t *  k_indices,
double *  k_sq_dists,
const KnnSetting setting = KnnSetting() 
) const
inline

Find k-nearest neighbors. This method uses fixed and static memory allocation. Might be faster for small k.

Parameters
queryQuery point
k_indicesIndices of neighbors
k_sq_distsSquared distances to neighbors
settingKNN search setting
Returns
Number of found neighbors

◆ nearest_neighbor_search()

template<typename PointCloud , typename Projection_ = AxisAlignedProjection>
size_t gtsam_points::UnsafeKdTree< PointCloud, Projection_ >::nearest_neighbor_search ( const Eigen::Vector3d &  query_,
size_t *  k_indices,
double *  k_sq_dists,
const KnnSetting setting = KnnSetting() 
) const
inline

Find the nearest neighbor.

Parameters
queryQuery point
k_indicesIndex of the nearest neighbor
k_sq_distsSquared distance to the nearest neighbor
settingKNN search setting
Returns
Number of found neighbors (0 or 1)

◆ radius_search()

template<typename PointCloud , typename Projection_ = AxisAlignedProjection>
size_t gtsam_points::UnsafeKdTree< PointCloud, Projection_ >::radius_search ( const Eigen::Vector3d &  query_,
double  radius,
std::vector< size_t > &  indices,
std::vector< double > &  sq_dists,
const KnnSetting setting = KnnSetting() 
) const
inline

Find neighbors in a search radius.

Parameters
queryQuery point
radiusSearch radius
indicesIndices of neighbors
sq_distsSquared distances to neighbors
settingKNN search setting
Returns
Number of found neighbors

The documentation for this struct was generated from the following files: