This commit is contained in:
Vigya Sharma 2024-11-12 16:16:54 -08:00
parent 51396e80ee
commit 0d6f6f103a
1 changed files with 12 additions and 0 deletions

View File

@ -155,10 +155,22 @@ public class MultiVectorSimilarityFunction {
this.aggregation = aggregation; this.aggregation = aggregation;
} }
/**
* Compute similarity between two float multi-vectors.
*
* <p>Expects all component vector values as a single packed float[] for each multi-vector. Uses
* configured aggregation function and vector similarity.
*/
public float compare(float[] t1, float[] t2, int dimension) { public float compare(float[] t1, float[] t2, int dimension) {
return aggregation.aggregate(t1, t2, similarityFunction, dimension); return aggregation.aggregate(t1, t2, similarityFunction, dimension);
} }
/**
* Compute similarity between two byte multi-vectors.
*
* <p>Expects all component vector values as a single packed float[] for each multi-vector. Uses
* configured aggregation function and vector similarity.
*/
public float compare(byte[] t1, byte[] t2, int dimension) { public float compare(byte[] t1, byte[] t2, int dimension) {
return aggregation.aggregate(t1, t2, similarityFunction, dimension); return aggregation.aggregate(t1, t2, similarityFunction, dimension);
} }