|
static uint8_t | encoding_length (uint64_t w) |
| Get the number of bits that are necessary to encode. More...
|
|
static void | encode (uint64_t x, uint64_t *&z, uint8_t &offset) |
| Encode one positive integer x to an int_vector. More...
|
|
template<class int_vector > |
static bool | encode (const int_vector &v, int_vector &z) |
| Encode integers contained in vector v into vector z. More...
|
|
template<bool t_sumup, bool t_inc, class t_iter > |
static uint64_t | decode (const uint64_t *data, const size_type start_idx, size_type n, t_iter it=(t_iter) nullptr) |
| Decode n comma encoded values beginning at start_idx. More...
|
|
static uint64_t | decode_prefix_sum (const uint64_t *data, const size_type start_idx, size_type n) |
| Decode n comma gamma encoded integers. More...
|
|
static uint64_t | decode_prefix_sum (const uint64_t *data, const size_type start_idx, const size_type end_idx, size_type n) |
| Decode n comma gamma encoded integers. More...
|
|
template<class int_vector > |
static bool | decode (const int_vector &z, int_vector &v) |
| Decode vector z containing comma encoded integers. More...
|
|
template<class int_vector > |
static uint64_t * | raw_data (int_vector &v) |
|
template<uint8_t t_width = 2>
class sdsl::coder::comma< t_width >
A class to encode and decode between comma code and binary code.
- Author
- Uwe Baier
Comma coding works as the following: First of all, comma coding needs a parameter t_width which indicates how big a encoded digit will be (in bits), let's say t_width = 2. By use of t_width one can calculate a base for encoding, in detail this means base = 2^t_width - 1 now, given any number it is encoded as the follows: The number gets displayed in the calculated base, and each digit of the number is saved with t_width bits. To indicate the end of the number, a termination digit is used (namely this is the value base). Example: t_width = 2 => base = 2^2 - 1 = 3 Value to be encoded: 15 15 (base 10) = 120 (base 3) Encoded value: 120 (plus termination digit) = 01 10 00 11 in binary (last digit is termination digit)
- Template Parameters
-
t_width | Width of one digit used in comma code |
Definition at line 47 of file coder_comma.hpp.