small_gicp
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
small_gicp::KnnResult< N, IndexTransform > Struct Template Reference

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

#include <knn_result.hpp>

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

Public Member Functions

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

Public Attributes

const IndexTransform index_transform
 Point index transformation (e.g., local point index to global point/voxel index) More...
 
const int capacity
 Maximum number of neighbors to search. More...
 
int num_found_neighbors
 Number of found neighbors. More...
 
size_t * indices
 Indices of neighbors. More...
 
double * distances
 Distances to neighbors. More...
 

Static Public Attributes

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

Detailed Description

template<int N, typename IndexTransform = identity_transform>
struct small_gicp::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>
small_gicp::KnnResult< N, IndexTransform >::KnnResult ( size_t *  indices,
double *  distances,
int  num_neighbors = -1,
const IndexTransform &  index_transform = identity_transform() 
)
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)

Member Function Documentation

◆ buffer_size()

template<int N, typename IndexTransform = identity_transform>
size_t small_gicp::KnnResult< N, IndexTransform >::buffer_size ( ) const
inline

Buffer size (i.e., Maximum number of neighbors)

◆ num_found()

template<int N, typename IndexTransform = identity_transform>
size_t small_gicp::KnnResult< N, IndexTransform >::num_found ( ) const
inline

Number of found neighbors.

◆ push()

template<int N, typename IndexTransform = identity_transform>
void small_gicp::KnnResult< N, IndexTransform >::push ( size_t  index,
double  distance 
)
inline

Push a pair of point index and distance to the result.

Note
The result is sorted by distance in ascending order.

◆ worst_distance()

template<int N, typename IndexTransform = identity_transform>
double small_gicp::KnnResult< N, IndexTransform >::worst_distance ( ) const
inline

Worst distance in the result.

Member Data Documentation

◆ capacity

template<int N, typename IndexTransform = identity_transform>
const int small_gicp::KnnResult< N, IndexTransform >::capacity

Maximum number of neighbors to search.

◆ distances

template<int N, typename IndexTransform = identity_transform>
double* small_gicp::KnnResult< N, IndexTransform >::distances

Distances to neighbors.

◆ index_transform

template<int N, typename IndexTransform = identity_transform>
const IndexTransform small_gicp::KnnResult< N, IndexTransform >::index_transform

Point index transformation (e.g., local point index to global point/voxel index)

◆ indices

template<int N, typename IndexTransform = identity_transform>
size_t* small_gicp::KnnResult< N, IndexTransform >::indices

Indices of neighbors.

◆ INVALID

template<int N, typename IndexTransform = identity_transform>
constexpr size_t small_gicp::KnnResult< N, IndexTransform >::INVALID = std::numeric_limits<size_t>::max()
staticconstexpr

◆ num_found_neighbors

template<int N, typename IndexTransform = identity_transform>
int small_gicp::KnnResult< N, IndexTransform >::num_found_neighbors

Number of found neighbors.


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