Avoid iterations: cooling using simulated annealing

This commit is contained in:
Rishabh Maurya 2024-03-14 11:10:12 -07:00
parent 3ad73336ae
commit 35aea56ad4
1 changed files with 6 additions and 2 deletions

View File

@ -472,8 +472,12 @@ public final class BPIndexReorderer {
@Override
public int comparePivot(int j) {
int cmp = Float.compare(pivotBias, biases[j]);
if (cmp == 0) {
int cmp = Float.compare(pivotBias-iter, biases[j]);
if (cmp > 0) {
return cmp;
}
cmp = Float.compare(pivotBias, biases[j]);
if (cmp >= 0) {
// Tie break on the doc ID to preserve doc ID ordering as much as possible
cmp = pivotDoc - docIDs.ints[j];
}