

SimdIntersection
- Namespace
- Rowles.LeanLucene.Search.Simd
- Assembly
- Rowles.LeanLucene.dll
Specialised SIMD-accelerated Boolean AND intersection for sorted doc-ID arrays.
internal static class SimdIntersection
SimdIntersection
Remarks
Both input spans must be sorted in ascending order with no duplicates. On hardware that supports 128-bit integer vectors the implementation loads four System.Int32 values at a time and uses a vectorised merge-intersect strategy. A scalar two-pointer fallback is used for tails and unsupported platforms.
Intersect(ReadOnlySpan<int>, ReadOnlySpan<int>, Span<int>)
Computes the intersection of two sorted ascending doc-ID arrays,
writing matched values into result.
IntersectCount(ReadOnlySpan<int>, ReadOnlySpan<int>)
Returns the number of elements common to both sorted ascending arrays without materialising the result set.