Public Types | Public Member Functions | Public Attributes | List of all members
nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance > Struct Template Reference

#include <nanoflann.hpp>

Public Types

typedef KDTreeSingleIndexAdaptor< metric_t, self_t, MatrixType::ColsAtCompileTime, IndexTypeindex_t
 
typedef MatrixType::Index IndexType
 
typedef Distance::template traits< num_t, self_t >::distance_t metric_t
 
typedef MatrixType::Scalar num_t
 
typedef KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distanceself_t
 

Public Member Functions

 KDTreeEigenMatrixAdaptor (const size_t dimensionality, const std::reference_wrapper< const MatrixType > &mat, const int leaf_max_size=10)
 Constructor: takes a const ref to the matrix object with the data points. More...
 
 KDTreeEigenMatrixAdaptor (const self_t &)=delete
 
void query (const num_t *query_point, const size_t num_closest, IndexType *out_indices, num_t *out_distances_sq, const int=10) const
 
 ~KDTreeEigenMatrixAdaptor ()
 
Interface expected by KDTreeSingleIndexAdaptor
const self_tderived () const
 
self_tderived ()
 
size_t kdtree_get_point_count () const
 
num_t kdtree_get_pt (const IndexType idx, size_t dim) const
 
template<class BBOX >
bool kdtree_get_bbox (BBOX &) const
 

Public Attributes

index_tindex
 
const std::reference_wrapper< const MatrixType > m_data_matrix
 

Detailed Description

template<class MatrixType, int DIM = -1, class Distance = nanoflann::metric_L2>
struct nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >

An L2-metric KD-tree adaptor for working with data directly stored in an Eigen Matrix, without duplicating the data storage. Each row in the matrix represents a point in the state space.

Example of usage:

Eigen::Matrix<num_t,Dynamic,Dynamic> mat;
// Fill out "mat"...
typedef KDTreeEigenMatrixAdaptor< Eigen::Matrix<num_t,Dynamic,Dynamic> >
my_kd_tree_t; const int max_leaf = 10; my_kd_tree_t mat_index(mat, max_leaf
); mat_index.index->buildIndex(); mat_index.index->...
Template Parameters
DIMIf set to >0, it specifies a compile-time fixed dimensionality for the points in the data set, allowing more compiler optimizations.
DistanceThe distance metric to use: nanoflann::metric_L1, nanoflann::metric_L2, nanoflann::metric_L2_Simple, etc.

Definition at line 1953 of file nanoflann.hpp.

Member Typedef Documentation

◆ index_t

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
typedef KDTreeSingleIndexAdaptor<metric_t, self_t, MatrixType::ColsAtCompileTime, IndexType> nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::index_t

Definition at line 1961 of file nanoflann.hpp.

◆ IndexType

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
typedef MatrixType::Index nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::IndexType

Definition at line 1956 of file nanoflann.hpp.

◆ metric_t

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
typedef Distance::template traits<num_t, self_t>::distance_t nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::metric_t

Definition at line 1958 of file nanoflann.hpp.

◆ num_t

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
typedef MatrixType::Scalar nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::num_t

Definition at line 1955 of file nanoflann.hpp.

◆ self_t

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
typedef KDTreeEigenMatrixAdaptor<MatrixType, DIM, Distance> nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::self_t

Definition at line 1954 of file nanoflann.hpp.

Constructor & Destructor Documentation

◆ KDTreeEigenMatrixAdaptor() [1/2]

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::KDTreeEigenMatrixAdaptor ( const size_t  dimensionality,
const std::reference_wrapper< const MatrixType > &  mat,
const int  leaf_max_size = 10 
)
inline

Constructor: takes a const ref to the matrix object with the data points.

The kd-tree index for the user to call its methods as usual with any other FLANN index.

Definition at line 1967 of file nanoflann.hpp.

◆ KDTreeEigenMatrixAdaptor() [2/2]

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::KDTreeEigenMatrixAdaptor ( const self_t )
delete

Deleted copy constructor

◆ ~KDTreeEigenMatrixAdaptor()

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::~KDTreeEigenMatrixAdaptor ( )
inline

Definition at line 1988 of file nanoflann.hpp.

Member Function Documentation

◆ derived() [1/2]

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
const self_t& nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::derived ( ) const
inline

Definition at line 2009 of file nanoflann.hpp.

◆ derived() [2/2]

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
self_t& nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::derived ( )
inline

Definition at line 2010 of file nanoflann.hpp.

◆ kdtree_get_bbox()

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
template<class BBOX >
bool nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::kdtree_get_bbox ( BBOX &  ) const
inline

Definition at line 2027 of file nanoflann.hpp.

◆ kdtree_get_point_count()

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
size_t nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::kdtree_get_point_count ( ) const
inline

Definition at line 2013 of file nanoflann.hpp.

◆ kdtree_get_pt()

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
num_t nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::kdtree_get_pt ( const IndexType  idx,
size_t  dim 
) const
inline

Definition at line 2018 of file nanoflann.hpp.

◆ query()

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
void nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::query ( const num_t query_point,
const size_t  num_closest,
IndexType out_indices,
num_t out_distances_sq,
const int  = 10 
) const
inline

Query for the num_closest closest points to a given point (entered as query_point[0:dim-1]). Note that this is a short-cut method for index->findNeighbors(). The user can also call index->... methods as desired.

Note
nChecks_IGNORED is ignored but kept for compatibility with the original FLANN interface.

Definition at line 1998 of file nanoflann.hpp.

Member Data Documentation

◆ index

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
index_t* nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::index

Definition at line 1963 of file nanoflann.hpp.

◆ m_data_matrix

template<class MatrixType , int DIM = -1, class Distance = nanoflann::metric_L2>
const std::reference_wrapper<const MatrixType> nanoflann::KDTreeEigenMatrixAdaptor< MatrixType, DIM, Distance >::m_data_matrix

Definition at line 1990 of file nanoflann.hpp.


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


slam_toolbox
Author(s): Steve Macenski
autogenerated on Mon Feb 28 2022 23:46:50