public final class FastPFOR extends Object implements IntegerCODEC
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.Constructor and Description |
---|
FastPFOR()
Construct the fastPFOR CODEC with default parameters.
|
FastPFOR(int pagesize)
Construct the FastPFOR CODEC.
|
Modifier and Type | Method and Description |
---|---|
void |
compress(int[] in,
IntWrapper inpos,
int inlength,
int[] out,
IntWrapper outpos)
Compress data in blocks of 128 integers (if fewer than 128 integers
are provided, nothing is done).
|
String |
toString() |
void |
uncompress(int[] in,
IntWrapper inpos,
int inlength,
int[] out,
IntWrapper outpos)
Uncompress data in blocks of 128 integers.
|
public FastPFOR(int pagesize)
pagesize
- the desired page size (for expert use)public FastPFOR()
public void compress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos)
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 arrayIntegerCODEC.compress(int[], IntWrapper, int, int[], IntWrapper)
public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos)
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 outIntegerCODEC.compress(int[], IntWrapper, int, int[], IntWrapper)
Copyright © 2014. All Rights Reserved.