Interface VectorSimilarityFunctions
MethodHandles are returned to avoid a static reference to MemorySegment, which is not in the currently lowest compile version, JDK 17. Code consuming the method handles will, by definition, require access to MemorySegment.
-
Method Summary
Modifier and TypeMethodDescriptionProduces a method handle returning the dot product of byte (unsigned int7) vectors.Produces a method handle returning the square distance of byte (unsigned int7) vectors.
-
Method Details
-
dotProductHandle7u
MethodHandle dotProductHandle7u()Produces a method handle returning the dot product of byte (unsigned int7) vectors.Unsigned int7 byte vectors have values in the range of 0 to 127 (inclusive).
The type of the method handle will have
int
as return type, The type of its first and second arguments will beMemorySegment
, whose contents is the vector data bytes. The third argument is the length of the vector data. -
squareDistanceHandle7u
MethodHandle squareDistanceHandle7u()Produces a method handle returning the square distance of byte (unsigned int7) vectors.Unsigned int7 byte vectors have values in the range of 0 to 127 (inclusive).
The type of the method handle will have
int
as return type, The type of its first and second arguments will beMemorySegment
, whose contents is the vector data bytes. The third argument is the length of the vector data.
-