SDSL
3.0.0
Succinct Data Structure Library
|
A namespace for helper functions. More...
Functions | |
template<typename T > | |
std::string | to_string (const T &t, int w=1) |
uint64_t | pid () |
uint64_t | id () |
void | set_zero_bits (nn_dict_dynamic &nn) |
void | set_verbose () |
template<class t_int_vec > | |
void | set_random_bits (t_int_vec &v, int seed=0) |
Sets all bits of the int_vector to pseudo-random bits. More... | |
template<class t_int_vec > | |
void | _set_zero_bits (t_int_vec &v) |
Sets all bits of the int_vector to 0-bits. More... | |
template<class t_int_vec > | |
void | _set_one_bits (t_int_vec &v) |
Sets all bits of the int_vector to 1-bits. More... | |
template<class t_int_vec > | |
void | bit_compress (t_int_vec &v) |
Bit compress the int_vector. More... | |
template<class t_int_vec > | |
void | expand_width (t_int_vec &v, uint8_t new_width) |
Expands the integer width to new_width >= v.width() More... | |
template<class t_int_vec > | |
void | mod (t_int_vec &v, typename t_int_vec::size_type m) |
All elements of v modulo m. More... | |
void | cyclic_shifts (uint64_t *vec, uint8_t &n, uint64_t k, uint8_t int_width) |
template<class t_int_vec > | |
void | set_to_value (t_int_vec &v, uint64_t k) |
Set all entries of int_vector to value k. More... | |
template<class t_int_vec , class t_int_vec_iterator > | |
void | set_to_value (t_int_vec &v, uint64_t k, t_int_vec_iterator it) |
Set all entries of int_vector starting from iterator it to value k. More... | |
template<class t_int_vec > | |
void | set_to_id (t_int_vec &v) |
Sets each entry of the numerical vector v at position $fi. More... | |
template<class t_int_vec > | |
Number of set bits in v t_int_vec::size_type | cnt_one_bits (const t_int_vec &v) |
template<class t_int_vec > | |
Number of occurrences of bit pattern in v t_int_vec::size_type | cnt_onezero_bits (const t_int_vec &v) |
template<class t_int_vec > | |
Number of occurrences of bit pattern in v t_int_vec::size_type | cnt_zeroone_bits (const t_int_vec &v) |
template<class t_int_vec > | |
Get the smallest position f $i geq idx f where a bit is set t_int_vec::size_type | next_bit (const t_int_vec &v, uint64_t idx) |
template<class t_int_vec > | |
Get the greatest position f $i leq idx f where a bit is set t_int_vec::size_type | prev_bit (const t_int_vec &v, uint64_t idx) |
Get the size of a file in bytes size_t | file_size (const std::string &file) |
Returns the basename of a file std::string | basename (std::string file) |
Returns the directory of a file A trailing will be removed std::string | dirname (std::string file) |
Demangle the class name of | typeid (...).name() inline std |
A namespace for helper functions.
void sdsl::util::_set_one_bits | ( | t_int_vec & | v | ) |
Sets all bits of the int_vector to 1-bits.
void sdsl::util::_set_zero_bits | ( | t_int_vec & | v | ) |
Sets all bits of the int_vector to 0-bits.
|
inline |
void sdsl::util::bit_compress | ( | t_int_vec & | v | ) |
Bit compress the int_vector.
Determine the biggest value X and then set the int_width to the smallest possible so that we still can represent X
Number of set bits in v t_int_vec::size_type sdsl::util::cnt_one_bits | ( | const t_int_vec & | v | ) |
v | int_vector object. |
Number of occurrences of bit pattern in v t_int_vec::size_type sdsl::util::cnt_onezero_bits | ( | const t_int_vec & | v | ) |
Number of occurrences of bit pattern in v t_int_vec::size_type sdsl::util::cnt_zeroone_bits | ( | const t_int_vec & | v | ) |
|
inline |
|
inline |
void sdsl::util::expand_width | ( | t_int_vec & | v, |
uint8_t | new_width | ||
) |
|
inline |
uint64_t sdsl::util::id | ( | ) |
void sdsl::util::mod | ( | t_int_vec & | v, |
typename t_int_vec::size_type | m | ||
) |
Get the smallest position f $i geq idx f where a bit is set t_int_vec::size_type sdsl::util::next_bit | ( | const t_int_vec & | v, |
uint64_t | idx | ||
) |
v | The int_vector in which the bit is searched |
idx | The start position for the search ![]() |
uint64_t sdsl::util::pid | ( | ) |
Get the greatest position f $i leq idx f where a bit is set t_int_vec::size_type sdsl::util::prev_bit | ( | const t_int_vec & | v, |
uint64_t | idx | ||
) |
v | The int_vector in which the bit is searched |
idx | The start position for the search ![]() |
void sdsl::util::set_random_bits | ( | t_int_vec & | v, |
int | seed = 0 |
||
) |
Sets all bits of the int_vector to pseudo-random bits.
v | The int_vector whose bits should be set to random bits |
seed | If seed = 0, the time is used to initialize the pseudo random number generator, otherwise the seed parameter is used. |
void sdsl::util::set_to_id | ( | t_int_vec & | v | ) |
Sets each entry of the numerical vector v at position $fi.
void sdsl::util::set_to_value | ( | t_int_vec & | v, |
uint64_t | k | ||
) |
Set all entries of int_vector to value k.
v | The int_vector which should be set |
k | The value which should be inserted into v. |
void sdsl::util::set_to_value | ( | t_int_vec & | v, |
uint64_t | k, | ||
t_int_vec_iterator | it | ||
) |
Set all entries of int_vector starting from iterator it to value k.
v | The int_vector which should be set |
k | The value which should be inserted into v. |
it | The iterator from which on all elements are set to value k. |
|
inline |
Definition at line 399 of file nn_dict_dynamic.hpp.
std::string sdsl::util::to_string | ( | const T & | t, |
int | w = 1 |
||
) |
Demangle the class name of sdsl::util::typeid | ( | ... | ) |
name | A pointer to the result of typeid(...).name() |