SDSL: Succinct Data Structure Library
A C++ template library for succinct data structures
 All Classes Namespaces Files Functions Variables Typedefs Friends
Public Types | Static Public Member Functions | Static Public Attributes
sdsl::coder::elias_delta Class Reference

A class to encode and decode between Elias- $\delta$ and binary code. More...

#include <elias_delta_coder.hpp>

List of all members.

Public Types

typedef uint64_t size_type

Static Public Member Functions

static uint8_t encoding_length (uint64_t)
template<bool sumup, bool increment, class Iterator >
static uint64_t decode (const uint64_t *data, const size_type start_idx, size_type n, Iterator it=(Iterator) NULL)
 Decode n Elias-delta encoded bits beginning at start_idx in the bitstring "data".
static uint64_t decode_prefix_sum (const uint64_t *data, const size_type start_idx, size_type n)
 Decode n EliasDelta encoded integers beginning at start_idx in the bitstring "data" and return the sum of these values.
static uint64_t decode_prefix_sum (const uint64_t *data, const size_type start_idx, const size_type end_idx, size_type n)
template<class int_vector >
static bool encode (const int_vector &v, int_vector &z)
template<class int_vector >
static bool decode (const int_vector &z, int_vector &v)
static void encode (uint64_t x, uint64_t *&z, uint8_t &offset)
 Encode one positive integer x to an int_vector at bit position start_idx.
template<class int_vector >
static uint64_t * raw_data (int_vector &v)

Static Public Attributes

static const uint32_t EliasDeltaPrefixSum [1<< 16]
 Array contains precomputed values for the decoding of the prefix sum of Elias-Delta encoded numbers.
static const uint16_t EliasDeltaPrefixSum8bit [(1<< 8)*8]
static const uint8_t min_codeword_length = 1

Detailed Description

A class to encode and decode between Elias- $\delta$ and binary code.


Member Function Documentation

static uint64_t sdsl::coder::elias_delta::decode_prefix_sum ( const uint64_t *  data,
const size_type  start_idx,
size_type  n 
) [static]

Decode n EliasDelta encoded integers beginning at start_idx in the bitstring "data" and return the sum of these values.

Parameters:
dataPointer to the beginning of the EliasDelta encoded bitstring.
start_idxIndex of the first bit to endcode the values from.
nNumber of values to decode from the bitstring. Attention: There have to be at least n encoded values in the bitstring.

Member Data Documentation

const uint32_t sdsl::coder::elias_delta::EliasDeltaPrefixSum[1<< 16] [static]

Array contains precomputed values for the decoding of the prefix sum of Elias-Delta encoded numbers.

The 8 most significant bits contain the length of decoded bits. The following 8 bits contain the number of decoded values. The last 16 bits contain the sum of the decoded values.


The documentation for this class was generated from the following file: