com.kamikaze.pfordelta
Class Simple16
java.lang.Object
com.kamikaze.pfordelta.Simple16
public class Simple16
- extends Object
Implementation of the Simple16 algorithm for sorted integer arrays. The basic ideas are based on papers from
1. http://www2008.org/papers/pdf/p387-zhangA.pdf
2. http://www2009.org/proceedings/pdf/p401.pdf
The maximum possible integer value Simple16 can encode is < 2^28 (this is dertermined by the Simple16 algorithm itself).
Therefore, in order to use Simple16, the application must write their own code to encode numbers in the range of [2^28, 2^32).
A simple way is just write those numbers as 32-bit integers (that is, no compression for very big numbers).
Method Summary |
static int |
s16Compress(int[] out,
int outOffset,
int[] in,
int inOffset,
int n,
int blockSize)
Compress an integer array using Simple16 |
static int |
s16Decompress(int[] out,
int outOffset,
int[] in,
int inOffset,
int n)
Decompress an integer array using Simple16 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Simple16
public Simple16()
s16Compress
public static final int s16Compress(int[] out,
int outOffset,
int[] in,
int inOffset,
int n,
int blockSize)
- Compress an integer array using Simple16
- Parameters:
out
- the compressed outputoutOffset
- the offset of the output in the number of integersin
- the integer input arrayinOffset
- the offset of the input in the number of integersn
- the number of elements to be compressed
- Returns:
- the number of compressed integers
s16Decompress
public static final int s16Decompress(int[] out,
int outOffset,
int[] in,
int inOffset,
int n)
- Decompress an integer array using Simple16
- Parameters:
out
- the decompressed outputoutOffset
- the offset of the output in the number of integersin
- the compressed input arrayinOffset
- the offset of the input in the number of integersn
- the number of elements to be compressed
- Returns:
- the number of processed integers
Copyright © 2013. All Rights Reserved.