gtsam_points
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
gtsam_points::NearestNeighborSearch Struct Reference

Nearest neighbor search interface. More...

#include <nearest_neighbor_search.hpp>

Inheritance diagram for gtsam_points::NearestNeighborSearch:
Inheritance graph
[legend]

Public Types

using Ptr = std::shared_ptr< NearestNeighborSearch >
 
using ConstPtr = std::shared_ptr< const NearestNeighborSearch >
 

Public Member Functions

virtual size_t knn_search (const double *pt, size_t k, size_t *k_indices, double *k_sq_dists, double max_sq_dist=std::numeric_limits< double >::max()) const
 k-nearest neighbor search
 
virtual size_t radius_search (const double *pt, double radius, std::vector< size_t > &indices, std::vector< double > &sq_dists, int max_num_neighbors=std::numeric_limits< int >::max()) const
 Radius search.
 

Detailed Description

Nearest neighbor search interface.

Member Function Documentation

◆ knn_search()

virtual size_t gtsam_points::NearestNeighborSearch::knn_search ( const double *  pt,
size_t  k,
size_t *  k_indices,
double *  k_sq_dists,
double  max_sq_dist = std::numeric_limits<double>::max() 
) const
inlinevirtual

k-nearest neighbor search

Parameters
ptPoint
kNumber of neighbors
k_indicesIndices of k-nearest neighbors
k_sq_distsSquared distances to the neighbors (sorted in ascending order)

Reimplemented in gtsam_points::IncrementalCovarianceVoxelMap, gtsam_points::IncrementalVoxelMap< VoxelContents >, gtsam_points::IncrementalVoxelMap< GaussianVoxel >, gtsam_points::IncrementalVoxelMap< IncrementalCovarianceContainer >, gtsam_points::IntensityKdTree, gtsam_points::KdTree, gtsam_points::KdTree2< Frame >, and gtsam_points::KdTreeX< D >.

◆ radius_search()

virtual size_t gtsam_points::NearestNeighborSearch::radius_search ( const double *  pt,
double  radius,
std::vector< size_t > &  indices,
std::vector< double > &  sq_dists,
int  max_num_neighbors = std::numeric_limits<int>::max() 
) const
inlinevirtual

Radius search.

Note
There is no assumption and guarantee on the order of points to be selected when max_num_neighbors is specified. (Some algorithms like KdTree tend to first pick closer points though).
Parameters
ptPoint
radiusSearch radius
indicesIndices of neighbors within the radius
sq_distsSquared distances to the neighbors (sorted in ascending order)
max_num_neighborsMaximum number of neighbors
Returns
Number of neighbors

Reimplemented in gtsam_points::KdTree, gtsam_points::KdTree2< Frame >, and gtsam_points::KdTreeX< D >.


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