compare

abstract fun compare(v1: FloatArray, v2: FloatArray): Float

Calculates a similarity score between the two vectors with a specified function. Higher similarity scores correspond to closer vectors.

Return

the value of the similarity function applied to the two vectors

Parameters

v1

a vector

v2

another vector, of the same dimension


abstract fun compare(v1: ByteArray, v2: ByteArray): Float

Calculates a similarity score between the two vectors with a specified function. Higher similarity scores correspond to closer vectors. Each (signed) byte represents a vector dimension.

Return

the value of the similarity function applied to the two vectors

Parameters

v1

a vector

v2

another vector, of the same dimension