adding a few toString methods for HNSW scoring classes (#13694)

This commit is contained in:
Michael McCandless 2024-08-28 10:15:40 -04:00 committed by GitHub
parent 385f56ba22
commit d55b92bae0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 30 additions and 1 deletions

View File

@ -156,7 +156,12 @@ public class ProfileResults {
/** Process all the JFR files passed in args and print a merged summary. */ /** Process all the JFR files passed in args and print a merged summary. */
public static void printReport( public static void printReport(
List<String> files, String mode, int stacksize, int count, boolean lineNumbers, boolean frameTypes) List<String> files,
String mode,
int stacksize,
int count,
boolean lineNumbers,
boolean frameTypes)
throws IOException { throws IOException {
if (!"cpu".equals(mode) && !"heap".equals(mode)) { if (!"cpu".equals(mode) && !"heap".equals(mode)) {
throw new IllegalArgumentException("tests.profile.mode must be one of (cpu,heap)"); throw new IllegalArgumentException("tests.profile.mode must be one of (cpu,heap)");

View File

@ -116,6 +116,11 @@ public class DefaultFlatVectorScorer implements FlatVectorsScorer {
public RandomVectorScorerSupplier copy() throws IOException { public RandomVectorScorerSupplier copy() throws IOException {
return new ByteScoringSupplier(vectors, similarityFunction); return new ByteScoringSupplier(vectors, similarityFunction);
} }
@Override
public String toString() {
return "ByteScoringSupplier(similarityFunction=" + similarityFunction + ")";
}
} }
/** RandomVectorScorerSupplier for Float vector */ /** RandomVectorScorerSupplier for Float vector */
@ -148,6 +153,11 @@ public class DefaultFlatVectorScorer implements FlatVectorsScorer {
public RandomVectorScorerSupplier copy() throws IOException { public RandomVectorScorerSupplier copy() throws IOException {
return new FloatScoringSupplier(vectors, similarityFunction); return new FloatScoringSupplier(vectors, similarityFunction);
} }
@Override
public String toString() {
return "FloatScoringSupplier(similarityFunction=" + similarityFunction + ")";
}
} }
/** A {@link RandomVectorScorer} for float vectors. */ /** A {@link RandomVectorScorer} for float vectors. */

View File

@ -170,5 +170,12 @@ public class ScalarQuantizedVectorScorer implements FlatVectorsScorer {
return new ScalarQuantizedRandomVectorScorerSupplier( return new ScalarQuantizedRandomVectorScorerSupplier(
similarity, vectorSimilarityFunction, values.copy()); similarity, vectorSimilarityFunction, values.copy());
} }
@Override
public String toString() {
return "ScalarQuantizedRandomVectorScorerSupplier(vectorSimilarityFunction="
+ vectorSimilarityFunction
+ ")";
}
} }
} }

View File

@ -301,5 +301,12 @@ public class Lucene99ScalarQuantizedVectorScorer implements FlatVectorsScorer {
public ScalarQuantizedRandomVectorScorerSupplier copy() throws IOException { public ScalarQuantizedRandomVectorScorerSupplier copy() throws IOException {
return new ScalarQuantizedRandomVectorScorerSupplier(values.copy(), vectorSimilarityFunction); return new ScalarQuantizedRandomVectorScorerSupplier(values.copy(), vectorSimilarityFunction);
} }
@Override
public String toString() {
return "ScalarQuantizedRandomVectorScorerSupplier(vectorSimilarityFunction="
+ vectorSimilarityFunction
+ ")";
}
} }
} }