public class PForDelta extends Object
Constructor and Description |
---|
PForDelta() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkBigNumbers(int[] inputBlock,
int bits,
int blockSize)
Check if the block contains big numbers that is greater than ((1<<
bits)-1)
|
static int[] |
compressOneBlock(int[] inputBlock,
int bits,
int blockSize)
The core implementation of compressing a block with blockSize
integers using PForDelta with the given parameter b
|
static int[] |
compressOneBlockOpt(int[] inBlock,
int blockSize)
Compress one block of blockSize integers using PForDelta with the
optimal parameter b
|
static int |
decompressBBitSlots(int[] outDecompSlots,
int[] inCompBlock,
int blockSize,
int bits)
Decompress b-bit slots
|
static int |
decompressBlockByS16(int[] outDecompBlock,
int[] inCompBlock,
int inStartOffsetInBits,
int blockSize)
Decompress a block of blockSize integers using Simple16 algorithm
|
static int |
decompressOneBlock(int[] outBlock,
int[] inBlock,
int blockSize)
Decompress one block using PForDelta
|
static int |
estimateCompressedSize(int[] inputBlock,
int bits,
int blockSize)
Estimate the compressed size in ints of a block
|
static int |
readBits(int[] in,
int inOffset,
int bits)
Read a certain number of bits of an integer into an integer array
starting from the given start offset
|
static void |
writeBits(int[] out,
int val,
int outOffset,
int bits)
Write a certain number of bits of an integer into an integer array
starting from the given start offset
|
public static int[] compressOneBlockOpt(int[] inBlock, int blockSize)
inBlock
- the block to be compressedblockSize
- the block sizepublic static int decompressOneBlock(int[] outBlock, int[] inBlock, int blockSize)
outBlock
- the block that was decompressedinBlock
- the block to be decompressedblockSize
- the number of elements in the decompressed blockpublic static int estimateCompressedSize(int[] inputBlock, int bits, int blockSize)
inputBlock
- the block to be compressedbits
- the value of the parameter bblockSize
- the block sizepublic static boolean checkBigNumbers(int[] inputBlock, int bits, int blockSize)
inputBlock
- the block to be compressedbits
- the numbers of bits to decide whether a number is a
big numberblockSize
- the block sizepublic static int[] compressOneBlock(int[] inputBlock, int bits, int blockSize)
inputBlock
- the block to be compressedbits
- the the value of the parameter bblockSize
- the block sizepublic static int decompressBBitSlots(int[] outDecompSlots, int[] inCompBlock, int blockSize, int bits)
outDecompSlots
- decompressed block which is the outputinCompBlock
- the compressed block which is the inputblockSize
- the block sizebits
- the value of the parameter bpublic static int decompressBlockByS16(int[] outDecompBlock, int[] inCompBlock, int inStartOffsetInBits, int blockSize)
outDecompBlock
- the decompressed block which is the outputinCompBlock
- the compressed block which is the inputblockSize
- the block sizeinStartOffsetInBits
- the start offset in bits of the compressed blockpublic static final void writeBits(int[] out, int val, int outOffset, int bits)
out
- the output arrayval
- the integer to be writtenoutOffset
- the start offset in bits in the output arraybits
- the number of bits to be written (bits greater or equal to 0)public static final int readBits(int[] in, int inOffset, int bits)
in
- the input arrayinOffset
- the start offset in bits in the input arraybits
- the number of bits to be read, unlike writeBits(),
readBits() does not deal with bits==0 and thus bits
must be greater than 0. When bits ==0, the calling functions will
just skip the entire bits-bit slots without decoding
themCopyright © 2014. All Rights Reserved.