Registry / utility / flann
library2022-10-28vcpkgunverified

Fast Library for Approximate Nearest Neighbors, providing efficient high-dimensional nearest neighbor search.

vcpkg install flann
INSTALL
IMPORT
SIG · FLANN
F
flann
utilitycppv2022-10-28
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

flann/flann.hpp
✓ #include <flann/flann.hpp>

Build a KD-tree index and perform a nearest neighbor search.

#include <flann/flann.hpp> #include <iostream> #include <vector> int main() { std::vector<float> dataset = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}; flann::Matrix<float> data(dataset.data(), 3, 2); flann::Index<flann::L2<float>> index(data, flann::KDTreeIndexParams(4)); index.buildIndex(); std::vector<float> query = {1.5f, 2.5f}; flann::Matrix<float> query_mat(query.data(), 1, 2); std::vector<int> indices(1); std::vector<float> distances(1); index.knnSearch(query_mat, indices, distances, 1); std::cout << "Nearest neighbor index: " << indices[0] << std::endl; return 0; }
Debug
Known issues
gotchaFLANN can be header-only or compiled; ensure the correct CMake target is used.
fix
Use flann::flann for the compiled version or flann::flann_cpp for header-only.
affects: all
Upgrade
Version history
2022-10-28latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources

No resource links recorded.

flann — pip install flann · libregistry