gtsam_points
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
gtsam_points::KnnResult< N, IndexTransform > Struct Template Reference

K-nearest neighbor search result container. More...

#include <knn_result.hpp>

Collaboration diagram for gtsam_points::KnnResult< N, IndexTransform >:
Collaboration graph
[legend]

Public Member Functions

 KnnResult (size_t *indices, double *distances, int num_neighbors=-1, const IndexTransform &index_transform=IndexTransform(), double max_sq_dist=std::numeric_limits< double >::max())
 Constructor.
 
size_t buffer_size () const
 Buffer size (i.e., Maximum number of neighbors)
 
size_t num_found () const
 Number of found neighbors.
 
double worst_distance () const
 Worst distance in the result.
 
void push (size_t index, double distance)
 Push a pair of point index and distance to the result.
 

Public Attributes

const IndexTransform & index_transform
 
const int capacity
 Maximum number of neighbors to search.
 
int num_found_neighbors
 Number of found neighbors.
 
size_t * indices
 Indices of neighbors.
 
double * distances
 Distances to neighbors.
 

Static Public Attributes

static constexpr size_t INVALID = std::numeric_limits<size_t>::max()
 

Detailed Description

template<int N, typename IndexTransform = identity_transform>
struct gtsam_points::KnnResult< N, IndexTransform >

K-nearest neighbor search result container.

Template Parameters
NNumber of neighbors to search. If N == -1, the number of neighbors is dynamicaly determined.

Constructor & Destructor Documentation

◆ KnnResult()

template<int N, typename IndexTransform = identity_transform>
gtsam_points::KnnResult< N, IndexTransform >::KnnResult ( size_t *  indices,
double *  distances,
int  num_neighbors = -1,
const IndexTransform &  index_transform = IndexTransform(),
double  max_sq_dist = std::numeric_limits<double>::max() 
)
inlineexplicit

Constructor.

Parameters
indicesBuffer to store indices (must be larger than k=max(N, num_neighbors))
distancesBuffer to store distances (must be larger than k=max(N, num_neighbors))
num_neighborsNumber of neighbors to search (must be -1 for static case N > 0)
index_transformIndex transformation function (e.g., local point index -> global voxel + point index)

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