me.lemire.integercompression
Class FastPFOR

java.lang.Object
  extended by me.lemire.integercompression.FastPFOR
All Implemented Interfaces:
IntegerCODEC

public final class FastPFOR
extends Object
implements IntegerCODEC

This is a PFOR Scheme designed by D. Lemire called FastPFOR.

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 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.

Author:
Daniel Lemire

Constructor Summary
FastPFOR()
          Construct the fastPFOR CODEC with default parameters.
FastPFOR(int pagesize)
          Construct the FastPFOR CODEC.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FastPFOR

public FastPFOR(int pagesize)
Construct the FastPFOR CODEC.

Parameters:
pagesize - the desired page size (for expert use)

FastPFOR

public FastPFOR()
Construct the fastPFOR CODEC with default parameters.

Method Detail

compress

public 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).

Specified by:
compress in interface IntegerCODEC
Parameters:
in - input array
inpos - location in the input array
inlength - how many integers to compress
out - output array
outpos - where to write in the output array
See Also:
IntegerCODEC.compress(int[], IntWrapper, int, int[], IntWrapper)

uncompress

public void uncompress(int[] in,
                       IntWrapper inpos,
                       int inlength,
                       int[] out,
                       IntWrapper outpos)
Uncompress data in blocks of 128 integers. In this particular case, the inlength parameter is ignored: it is deduced from the compressed data.

Specified by:
uncompress in interface IntegerCODEC
Parameters:
in - array containing data in compressed form
inpos - where to start reading in the array
inlength - length of the compressed data (ignored by some schemes)
out - array where to write the compressed output
outpos - where to write the compressed output in out
See Also:
IntegerCODEC.compress(int[], IntWrapper, int, int[], IntWrapper)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.