C++ API

nanoflann C++ API documentation

nanoflann is a C++ header-only library for building KD-Trees, mostly optimized for 2D or 3D point clouds.

nanoflann does not require compiling or installing, just an #include <nanoflann.hpp> in your code.

Macros that can be defined by the user to configure nanoflann:

  • NANOFLANN_NO_THREADS: If defined, multithreading is disabled, so the library can be used without linking against a threads library. Requesting a multi-threaded index build (n_thread_build != 1) then throws.

  • NANOFLANN_FIRST_MATCH: If defined, in case of a tie in distances the item with the smallest index will be returned.

  • NANOFLANN_NODE_ALIGNMENT: The memory alignment, in bytes, for kd-tree nodes. Default: 16.

Macros defined internally by nanoflann (not meant to be set by the user):

  • NANOFLANN_RESTRICT: Expands to the compiler-specific restrict pointer qualifier (__restrict__, __restrict) when available, empty otherwise.

  • NANOFLANN_NODISCARD: Expands to [[nodiscard]] when the compiler supports it, empty otherwise.

  • NANOFLANN_VERSION: Library version as 0xMmP (M=Major, m=minor, P=patch).

See the README for usage details and examples.

See:

Class Hierarchy

File Hierarchy

Full C++ API

Namespaces

Classes and Structs

Enums

Functions

Defines

Directories

Files