me.lemire.integercompression
Class OptPFDS16
java.lang.Object
me.lemire.integercompression.OptPFDS16
- All Implemented Interfaces:
- IntegerCODEC
public final class OptPFDS16
- extends Object
- implements IntegerCODEC
OptPFD
Follows:
H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
with optimized document ordering, in: WWW 09, 2009, pp. 401--410.
using Simple16 as the secondary coder.
Note that this does not use differential coding: if you are working on
sorted lists, you must compute the deltas separately.
For multi-threaded applications, each thread should use its own OptPFDS16 object.
- Author:
- Daniel Lemire
Field Summary |
protected static int[] |
bits
|
protected static int[] |
invbits
|
Constructor Summary |
OptPFDS16()
Constructor for the OptPFDS16 CODEC. |
Method Summary |
void |
compress(int[] in,
IntWrapper inpos,
int inlength,
int[] out,
IntWrapper outpos)
Compress data from an array to another array. |
protected void |
getBestBFromData(int[] in,
int pos,
IntWrapper bestb,
IntWrapper bestexcept)
|
String |
toString()
|
void |
uncompress(int[] in,
IntWrapper inpos,
int inlength,
int[] out,
IntWrapper outpos)
Uncompress data from an array to another array. |
bits
protected static final int[] bits
invbits
protected static final int[] invbits
OptPFDS16
public OptPFDS16()
- Constructor for the OptPFDS16 CODEC.
compress
public void compress(int[] in,
IntWrapper inpos,
int inlength,
int[] out,
IntWrapper outpos)
- Description copied from interface:
IntegerCODEC
- Compress data from an array to another array.
Both inpos and outpos are modified to represent how much
data was read and written to
if 12 ints (inlength = 12) are compressed to 3 ints, then
inpos will be incremented by 12 while outpos will be
incremented by 3
we use IntWrapper to pass the values by reference.
- Specified by:
compress
in interface IntegerCODEC
- Parameters:
in
- input arrayinpos
- location in the input arrayinlength
- how many integers to compressout
- output arrayoutpos
- where to write in the output array
getBestBFromData
protected void getBestBFromData(int[] in,
int pos,
IntWrapper bestb,
IntWrapper bestexcept)
uncompress
public void uncompress(int[] in,
IntWrapper inpos,
int inlength,
int[] out,
IntWrapper outpos)
- Description copied from interface:
IntegerCODEC
- Uncompress data from an array to another array.
Both inpos and outpos parameters are modified to indicate new positions after read/write.
- Specified by:
uncompress
in interface IntegerCODEC
- Parameters:
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 out
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2013. All Rights Reserved.