Skip to content

Commit 311570a

Browse files
committed
Additional cleanup.
1 parent 283e2e2 commit 311570a

File tree

1 file changed

+6
-21
lines changed
  • jvector-examples/src/main/java/io/github/jbellis/jvector/example/util

1 file changed

+6
-21
lines changed

jvector-examples/src/main/java/io/github/jbellis/jvector/example/util/DataSet.java

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,9 @@ public DataSet(String name,
4242
VectorSimilarityFunction similarityFunction,
4343
List<VectorFloat<?>> baseVectors,
4444
List<VectorFloat<?>> queryVectors,
45-
List<? extends List<Integer>> groundTruth) {
46-
// Delegate with allowEmptyBase set to false.
47-
this(name, similarityFunction, baseVectors, queryVectors, groundTruth, false);
48-
}
49-
50-
// Option to allow empty baseVectors.
51-
protected DataSet(String name,
52-
VectorSimilarityFunction similarityFunction,
53-
List<VectorFloat<?>> baseVectors,
54-
List<VectorFloat<?>> queryVectors,
55-
List<? extends List<Integer>> groundTruth,
56-
boolean allowEmptyBase) {
57-
if (!allowEmptyBase && baseVectors.isEmpty()) {
45+
List<? extends List<Integer>> groundTruth)
46+
{
47+
if (baseVectors.isEmpty()) {
5848
throw new IllegalArgumentException("Base vectors must not be empty");
5949
}
6050
if (queryVectors.isEmpty()) {
@@ -64,7 +54,7 @@ protected DataSet(String name,
6454
throw new IllegalArgumentException("Ground truth vectors must not be empty");
6555
}
6656

67-
if (!baseVectors.isEmpty() && baseVectors.get(0).length() != queryVectors.get(0).length()) {
57+
if (baseVectors.get(0).length() != queryVectors.get(0).length()) {
6858
throw new IllegalArgumentException("Base and query vectors must have the same dimensionality");
6959
}
7060
if (queryVectors.size() != groundTruth.size()) {
@@ -77,13 +67,8 @@ protected DataSet(String name,
7767
this.queryVectors = queryVectors;
7868
this.groundTruth = groundTruth;
7969

80-
if (!baseVectors.isEmpty()) {
81-
System.out.format("%n%s: %d base and %d query vectors created, dimensions %d%n",
82-
name, baseVectors.size(), queryVectors.size(), baseVectors.get(0).length());
83-
} else {
84-
System.out.format("%n%s: 0 base and %d query vectors created%n",
85-
name, queryVectors.size());
86-
}
70+
System.out.format("%n%s: %d base and %d query vectors created, dimensions %d%n",
71+
name, baseVectors.size(), queryVectors.size(), baseVectors.get(0).length());
8772
}
8873

8974
/**

0 commit comments

Comments
 (0)