#include <GammaCompress.hpp>
Inheritance diagram for GammaCompress:

Public Methods | |
| GammaCompress () | |
| void | compress (ostream &os, int n, int *a) |
| int | decompress (istream &is, int *a) |
| int | read (istream &is) |
| const char * | type () |
Private Methods | |
| void | initBitMasks () |
| int | floorlog2 (double x) |
| int | gamma_size (int x) |
| int | gamma_encode (int x, int offset, vector< int > &bv) |
| int | gamma_decode (int *y, int offset, vector< int > &bv) |
| int | read_bits (istream &is, vector< int > &bv, int size) |
| void | write_bits (ostream &os, vector< int > &bv) |
Private Attributes | |
| vector< int > | bv |
Static Private Attributes | |
| char | bits [8] |
GammaCompress
Implementation of the "gamma" method, as described in "Managing Gigabytes" by Witten et al., Chapter 3. (The method is originally attributed to P. Elias.)
|
|
|
|
||||||||||||||||
|
Implements Compress. |
|
||||||||||||
|
Implements Compress. |
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
Implements Compress. |
|
||||||||||||||||
|
|
|
|
Implements Compress. |
|
||||||||||||
|
|
|
|
Initial value:
{
0x80, 0x40, 0x20, 0x10,
0x8, 0x4, 0x2, 0x1,
} |
|
|
|
1.2.16