$ show ZJULearning/efanna
EFANNA is a header-only C++ library for approximate nearest neighbor (ANN) search. It builds an index combining a k-nearest neighbors graph and tree structures (KD-trees or hash tables) to enable efficient search on high-dimensional data. The library provides optimized distance computations with SSE/AVX intrinsics and a matrix class for SIMD-friendly data access. Key functionalities include index building, saving/loading indices, and performing ANN search via command-line examples or a MATLAB interface. The architecture is modular, with core algorithms in base_index.hpp and specialized index implementations in kdtreeub_index.hpp and hashing_index.hpp.
The LLM identified 2 files worth highlighting for reuse:
Provides highly optimized L2 distance metrics (SSE/AVX) for squared Euclidean distance computation. Uses intrinsics to process multiple elements per cycle, significantly accelerating distance calculations in ANN search. Self-contained and dependency-free beyond standard headers, making it reusable in any project requiring high-performance distance computation.
Implements a lightweight matrix wrapper that adjusts column stride for SIMD alignment (SSE/AVX) without copying data. Enables efficient memory access patterns for vectorized operations. The class is self-contained, depends only on standard headers, and can be extracted for use in any numerical computing project requiring aligned memory access for SIMD instructions.