@@ -42,19 +42,9 @@ public DataSet(String name,
42
42
VectorSimilarityFunction similarityFunction ,
43
43
List <VectorFloat <?>> baseVectors ,
44
44
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 ()) {
58
48
throw new IllegalArgumentException ("Base vectors must not be empty" );
59
49
}
60
50
if (queryVectors .isEmpty ()) {
@@ -64,7 +54,7 @@ protected DataSet(String name,
64
54
throw new IllegalArgumentException ("Ground truth vectors must not be empty" );
65
55
}
66
56
67
- if (! baseVectors . isEmpty () && baseVectors .get (0 ).length () != queryVectors .get (0 ).length ()) {
57
+ if (baseVectors .get (0 ).length () != queryVectors .get (0 ).length ()) {
68
58
throw new IllegalArgumentException ("Base and query vectors must have the same dimensionality" );
69
59
}
70
60
if (queryVectors .size () != groundTruth .size ()) {
@@ -77,13 +67,8 @@ protected DataSet(String name,
77
67
this .queryVectors = queryVectors ;
78
68
this .groundTruth = groundTruth ;
79
69
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 ());
87
72
}
88
73
89
74
/**
0 commit comments