Class ForDeltaUtil
java.lang.Object
org.apache.lucene.backward_codecs.lucene912.ForDeltaUtil
Inspired from https://fulmicoton.com/posts/bitpacking/ Encodes multiple integers in a long to get
SIMD-like speedups. If bitsPerValue <= 4 then we pack 8 ints per long else if bitsPerValue
<= 11 we pack 4 ints per long else we pack 2 ints per long
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final long[]private static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate final long[]private static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voiddecode12To32(IndexInput in, long[] tmp, long[] longs) private static voiddecode13To32(IndexInput in, long[] tmp, long[] longs) private static voiddecode14To32(IndexInput in, long[] tmp, long[] longs) private static voiddecode15To32(IndexInput in, long[] tmp, long[] longs) private static voiddecode16To32(IndexInput in, long[] longs) private static voiddecode5To16(IndexInput in, long[] tmp, long[] longs) private static voiddecode6To16(IndexInput in, long[] tmp, long[] longs) private static voiddecode7To16(IndexInput in, long[] tmp, long[] longs) private static voiddecode8To16(IndexInput in, long[] longs) (package private) voiddecodeAndPrefixSum(int bitsPerValue, IndexInput in, long base, long[] longs) Delta-decode 128 integers intolongs.(package private) voiddecodeAndPrefixSum(IndexInput in, long base, long[] longs) Decode deltas, compute the prefix sum and addbaseto all decoded longs.(package private) voidencodeDeltas(long[] longs, DataOutput out) Encode deltas of a strictly monotonically increasing sequence of integers.private static voidinnerPrefixSum16(long[] arr) private static voidinnerPrefixSum32(long[] arr) private static voidinnerPrefixSum8(long[] arr) private static voidprefixSum16(long[] arr, long base) private static voidprefixSum32(long[] arr, long base) private static voidprefixSum8(long[] arr, long base) private static voidprefixSumOfOnes(long[] arr, long base)
-
Field Details
-
ONE_BLOCK_SIZE_FOURTH
private static final int ONE_BLOCK_SIZE_FOURTH- See Also:
-
TWO_BLOCK_SIZE_FOURTHS
private static final int TWO_BLOCK_SIZE_FOURTHS- See Also:
-
THREE_BLOCK_SIZE_FOURTHS
private static final int THREE_BLOCK_SIZE_FOURTHS- See Also:
-
ONE_BLOCK_SIZE_EIGHT
private static final int ONE_BLOCK_SIZE_EIGHT- See Also:
-
TWO_BLOCK_SIZE_EIGHTS
private static final int TWO_BLOCK_SIZE_EIGHTS- See Also:
-
THREE_BLOCK_SIZE_EIGHTS
private static final int THREE_BLOCK_SIZE_EIGHTS- See Also:
-
FOUR_BLOCK_SIZE_EIGHTS
private static final int FOUR_BLOCK_SIZE_EIGHTS- See Also:
-
FIVE_BLOCK_SIZE_EIGHTS
private static final int FIVE_BLOCK_SIZE_EIGHTS- See Also:
-
SIX_BLOCK_SIZE_EIGHTS
private static final int SIX_BLOCK_SIZE_EIGHTS- See Also:
-
SEVEN_BLOCK_SIZE_EIGHTS
private static final int SEVEN_BLOCK_SIZE_EIGHTS- See Also:
-
IDENTITY_PLUS_ONE
private static final long[] IDENTITY_PLUS_ONE -
tmp
private final long[] tmp
-
-
Constructor Details
-
ForDeltaUtil
ForDeltaUtil()
-
-
Method Details
-
prefixSumOfOnes
private static void prefixSumOfOnes(long[] arr, long base) -
prefixSum8
private static void prefixSum8(long[] arr, long base) -
prefixSum16
private static void prefixSum16(long[] arr, long base) -
prefixSum32
private static void prefixSum32(long[] arr, long base) -
innerPrefixSum8
private static void innerPrefixSum8(long[] arr) -
innerPrefixSum16
private static void innerPrefixSum16(long[] arr) -
innerPrefixSum32
private static void innerPrefixSum32(long[] arr) -
encodeDeltas
Encode deltas of a strictly monotonically increasing sequence of integers. The providedlongsare expected to be deltas between consecutive values.- Throws:
IOException
-
decodeAndPrefixSum
Decode deltas, compute the prefix sum and addbaseto all decoded longs.- Throws:
IOException
-
decodeAndPrefixSum
void decodeAndPrefixSum(int bitsPerValue, IndexInput in, long base, long[] longs) throws IOException Delta-decode 128 integers intolongs.- Throws:
IOException
-
decode5To16
- Throws:
IOException
-
decode6To16
- Throws:
IOException
-
decode7To16
- Throws:
IOException
-
decode8To16
- Throws:
IOException
-
decode12To32
- Throws:
IOException
-
decode13To32
- Throws:
IOException
-
decode14To32
- Throws:
IOException
-
decode15To32
- Throws:
IOException
-
decode16To32
- Throws:
IOException
-