jlblancoc/nanoflann
nanoflann: a C++11 header-only library for Nearest Neighbor (NN) search with KD-trees
What it solves
nanoflann is a high-performance C++ library designed for fast nearest-neighbor searches in multi-dimensional datasets. It specifically addresses the overhead and memory inefficiency found in earlier libraries like FLANN by providing a header-only implementation that avoids virtual method penalties and unnecessary data duplication.
How it works
The library builds KD-trees to organize data points across various topologies, including Euclidean spaces (R2, R3), 2D rotation groups (SO2), and 3D rotation groups (SO3). It uses a combination of the Curiously Recurring Template Pattern (CRTP) and inlined methods to maximize execution speed. To save memory, it employs an adaptor interface, allowing the library to access the user's existing data directly without copying the entire dataset into a custom matrix.
Who it’s for
It is intended for C++ developers working with point clouds, robotics, and N-dimensional datasets who require extremely fast, thread-safe querying for closest neighbors.
Highlights
- Header-only: No compilation or installation required; simply include the header file.
- Memory Efficient: Uses adaptors to access data in-place, avoiding dataset duplication.
- Flexible Topologies: Supports R^N, SO(2), and SO(3) distance metrics.
- Dynamic Datasets: Provides specialized adaptors for dynamic point clouds, including a self-balancing tree for sliding-window LiDAR maps.
- Thread-Safe: Supports parallel index building and concurrent querying.
- Integration: Works directly with
Eigen::Matrixand standard C++ vectors.
Related
- Project
- Project
- Project
- Project
- Project