public final class FastPFOR extends Object implements IntegerCODEC, SkippableIntegerCODEC
For details, please see:
Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second through vectorization Software: Practice & Experience http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract http://arxiv.org/abs/1209.2137
For sufficiently compressible and long arrays, it is faster and better than other PFOR schemes.
Note that this does not use differential coding: if you are working on sorted lists, use IntegratedFastPFOR instead. For multi-threaded applications, each thread should use its own FastPFOR object.Modifier and Type | Field and Description |
---|---|
static int |
BLOCK_SIZE |
static int |
DEFAULT_PAGE_SIZE |
Constructor and Description |
---|
FastPFOR()
Construct the fastPFOR CODEC with default parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
compress(int[] in,
IntWrapper inpos,
int inlength,
int[] out,
IntWrapper outpos)
Compress data from an array to another array.
|
void |
headlessCompress(int[] in,
IntWrapper inpos,
int inlength,
int[] out,
IntWrapper outpos)
Compress data in blocks of BLOCK_SIZE integers (if fewer than BLOCK_SIZE integers
are provided, nothing is done).
|
void |
headlessUncompress(int[] in,
IntWrapper inpos,
int inlength,
int[] out,
IntWrapper outpos,
int mynvalue)
Uncompress data in blocks of integers.
|
String |
toString() |
void |
uncompress(int[] in,
IntWrapper inpos,
int inlength,
int[] out,
IntWrapper outpos)
Uncompress data from an array to another array.
|
public static final int DEFAULT_PAGE_SIZE
public static final int BLOCK_SIZE
public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos)
headlessCompress
in interface SkippableIntegerCODEC
in
- input arrayinpos
- location in the input arrayinlength
- how many integers to compressout
- output arrayoutpos
- where to write in the output arrayIntegerCODEC.compress(int[], IntWrapper, int, int[], IntWrapper)
public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos, int mynvalue)
headlessUncompress
in interface SkippableIntegerCODEC
in
- array containing data in compressed forminpos
- where to start reading in the arrayinlength
- length of the compressed data (ignored by some schemes)out
- array where to write the compressed outputoutpos
- where to write the compressed output in outmynvalue
- number of integers we want to decode, the actual number of integers decoded can be lessIntegerCODEC.compress(int[], IntWrapper, int, int[], IntWrapper)
public void compress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos)
IntegerCODEC
compress
in interface IntegerCODEC
in
- input arrayinpos
- location in the input arrayinlength
- how many integers to compressout
- output arrayoutpos
- where to write in the output arraypublic void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos)
IntegerCODEC
uncompress
in interface IntegerCODEC
in
- array containing data in compressed forminpos
- where to start reading in the arrayinlength
- length of the compressed data (ignored by some
schemes)out
- array where to write the compressed outputoutpos
- where to write the compressed output in outCopyright © 2015. All Rights Reserved.