A class to encode and decode between Fibonacci and binary code.
More...
#include <coder_fibonacci.hpp >
static uint8_t encoding_length (uint64_t w)
Get the number of bits that are necessary to encode the value w in Fibonacci code.
template<bool t_sumup, bool t_inc, class t_iter >
static uint64_t decode (uint64_t const *data , const size_type start_idx, size_type n, t_iter it=(t_iter) nullptr)
Decode n Fibonacci encoded bits beginning at start_idx in the bitstring "data".
template<bool t_sumup, bool t_inc, class t_iter >
static uint64_t decode1 (uint64_t const *data , const size_type start_idx, size_type n, t_iter it=(t_iter) nullptr)
static uint64_t decode_prefix_sum (uint64_t const *d, const size_type start_idx, size_type n)
Decode n Fibonacci encoded integers beginning at start_idx in the bitstring "data" and return the sum of these values.
static uint64_t decode_prefix_sum (uint64_t const *d, const size_type start_idx, const size_type end_idx, size_type n)
Decode n Fibonacci encoded integers beginning at start_idx and ending at end_idx (exclusive) in the bitstring "data" and return the sum of these values.
template<class int_vector1 , class int_vector2 >
static bool encode (int_vector1 const &v, int_vector2 &z)
template<class int_vector >
static uint64_t * raw_data (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_vector1 , class int_vector2 >
static bool decode (int_vector1 const &z, int_vector2 &v)
template<typename>
class sdsl::coder::fibonacci< typename >
A class to encode and decode between Fibonacci and binary code.
Definition at line 66 of file int_vector.hpp .
◆ size_type
◆ decode() [1/2]
template<typename T >
template<class int_vector1 , class int_vector2 >
◆ decode() [2/2]
template<typename T >
template<bool t_sumup, bool t_inc, class t_iter >
Decode n Fibonacci encoded bits beginning at start_idx in the bitstring "data".
Definition at line 400 of file coder_fibonacci.hpp .
◆ decode1()
template<typename T >
template<bool t_sumup, bool t_inc, class t_iter >
◆ decode_prefix_sum() [1/2]
Decode n Fibonacci encoded integers beginning at start_idx and ending at end_idx (exclusive) in the bitstring "data" and return the sum of these values.
See also decode_prefix_sum
◆ decode_prefix_sum() [2/2]
Decode n Fibonacci encoded integers beginning at start_idx in the bitstring "data" and return the sum of these values.
Parameters
data Pointer to the beginning of the Fibonacci encoded bitstring.
start_idx Index of the first bit to encode the values from.
n Number of values to decode from the bitstring. Attention: There have to be at least n encoded values in the bitstring.
Definition at line 506 of file coder_fibonacci.hpp .
◆ encode() [1/2]
template<typename T >
template<class int_vector1 , class int_vector2 >
◆ encode() [2/2]
Encode one positive integer x to an int_vector at bit position start_idx.
Parameters
x Positive integer to encode.
z Raw data of vector to write the encoded form of x.
offset Start offset to write the encoded form of x in z. .
Definition at line 292 of file coder_fibonacci.hpp .
◆ encoding_length()
Get the number of bits that are necessary to encode the value w in Fibonacci code.
Parameters
w 64bit integer to get the length of its fibonacci encoding. Inclusive the terminating 1 of the code.
Definition at line 169 of file coder_fibonacci.hpp .
◆ raw_data()
◆ data
◆ min_codeword_length
The documentation for this class was generated from the following files:
/builddir/build/BUILD/sdsl-lite-3.0.3-build/sdsl-lite-3.0.3/include/sdsl/coder_fibonacci.hpp
/builddir/build/BUILD/sdsl-lite-3.0.3-build/sdsl-lite-3.0.3/include/sdsl/int_vector.hpp