2019-06-10
2019-06-10 本文已影响0人
v_changpengfei
实现类 DeltaPackedLongValues
PackedInts.Mutable mutable = PackedInts.getMutable(numValues, bitsRequired, acceptableOverheadRatio);
@Override
void pack(long[] values, int numValues, int block, float acceptableOverheadRatio) {
long min = values[0];
for (int i = 1; i < numValues; ++i) {//取最小值
min = Math.min(min, values[i]);
}
for (int i = 0; i < numValues; ++i) {//所有值减去最小值
values[i] -= min;
}
super.pack(values, numValues, block, acceptableOverheadRatio);
mins[block] = min;
}
``
实现类 MonotonicLongValues