@@ -189,6 +189,7 @@ void estimators_from_tables_generic(
189
189
dt += index .ksub ;
190
190
}
191
191
}
192
+
192
193
if (C::cmp (heap_dis[0 ], dis)) {
193
194
heap_pop<C>(k, heap_dis, heap_ids);
194
195
heap_push<C>(k, heap_dis, heap_ids, dis, j);
@@ -203,17 +204,18 @@ ResultHandlerCompare<C, false>* make_knn_handler(
203
204
idx_t k,
204
205
size_t ntotal,
205
206
float * distances,
206
- idx_t * labels) {
207
+ idx_t * labels,
208
+ const IDSelector* sel = nullptr ) {
207
209
using HeapHC = HeapHandler<C, false >;
208
210
using ReservoirHC = ReservoirHandler<C, false >;
209
211
using SingleResultHC = SingleResultHandler<C, false >;
210
212
211
213
if (k == 1 ) {
212
- return new SingleResultHC (n, ntotal, distances, labels);
214
+ return new SingleResultHC (n, ntotal, distances, labels, sel );
213
215
} else if (impl % 2 == 0 ) {
214
- return new HeapHC (n, ntotal, k, distances, labels);
216
+ return new HeapHC (n, ntotal, k, distances, labels, sel );
215
217
} else /* if (impl % 2 == 1) */ {
216
- return new ReservoirHC (n, ntotal, k, 2 * k, distances, labels);
218
+ return new ReservoirHC (n, ntotal, k, 2 * k, distances, labels, sel );
217
219
}
218
220
}
219
221
0 commit comments