Section navigation

Public classStatic SimdVectorOps

Namespace
Rowles.LeanCorpus.Search.Simd
Assembly
Rowles.LeanCorpus.dll

Public SIMD vector primitives for similarity calculations and normalisation.

public static class SimdVectorOps
Inheritance
SimdVectorOps

Public method CosineSimilarity(ReadOnlySpan<float>, ReadOnlySpan<float>)

Computes cosine similarity, returning zero for empty or mismatched vectors.

Public method DotProduct(ReadOnlySpan<float>, ReadOnlySpan<float>)

Computes the dot product of two equal-length vectors.

Public method Normalise(ReadOnlySpan<float>)

Allocates and returns an L2-normalised copy of a vector.

Public method NormaliseInPlace(Span<float>)

L2-normalises a vector in place.

Public method SquaredNorm(ReadOnlySpan<float>)

Computes the squared L2 norm of a vector.