DataTransferKit - Multiphysics Solution Transfer Services
2.0
|
#include <DTK_nanoflann.hpp>
Public Member Functions | |
KDTreeEigenMatrixAdaptor (const int dimensionality, const MatrixType &mat, const int leaf_max_size=10) | |
Constructor: takes a const ref to the matrix object with the data points. More... | |
void | query (const num_t *query_point, const size_t num_closest, IndexType *out_indices, num_t *out_distances_sq, const int nChecks_IGNORED=10) const |
Interface expected by KDTreeSingleIndexAdaptor | |
const self_t & | derived () const |
self_t & | derived () |
size_t | kdtree_get_point_count () const |
num_t | kdtree_distance (const num_t *p1, const size_t idx_p2, size_t size) const |
num_t | kdtree_get_pt (const size_t idx, int dim) const |
template<class BBOX > | |
bool | kdtree_get_bbox (BBOX &bb) const |
A simple 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:
DIM | If set to >0, it specifies a compile-time fixed dimensionality for the points in the data set, allowing more compiler optimizations. |
Distance | The distance metric to use: nanoflann::metric_L1, nanoflann::metric_L2, nanoflann::metric_L2_Simple, etc. |
IndexType | The type for indices in the KD-tree index (typically, size_t of int) |
Definition at line 1642 of file DTK_nanoflann.hpp.
|
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 1655 of file DTK_nanoflann.hpp.
|
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.
Definition at line 1680 of file DTK_nanoflann.hpp.