#include <Eigen/Core>
#include <algorithm>
#include <array>
#include <cstring>
#include <limits>
|
#define | HAS_NEON 0 |
| High-performance helper class to maintain k smallest distances in sorted order.
|
|
#define | HAS_AVX2 0 |
|
◆ HAS_AVX2
◆ HAS_NEON
High-performance helper class to maintain k smallest distances in sorted order.
Template parameter K allows compile-time optimizations and stack allocation Automatically uses NEON on ARM or AVX2 on x86
Optimizations:
- No dynamic allocation - everything on stack
- SIMD operations for comparisons and shifts (NEON or AVX2)
- Batch insertion support for processing multiple values at once
- Binary search for larger k values
- Compile-time loop unrolling
- Branchless operations where possible