SDSL 3.0.1
Succinct Data Structure Library
Loading...
Searching...
No Matches
util.hpp File Reference

util.hpp contains some helper methods for int_vector and other stuff like demangle class names. More...

#include <algorithm>
#include <atomic>
#include <cassert>
#include <chrono>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iosfwd>
#include <mutex>
#include <numeric>
#include <random>
#include <sstream>
#include <stdexcept>
#include <stdint.h>
#include <string.h>
#include <string>
#include <type_traits>
#include <typeinfo>
#include <vector>
#include <sdsl/bits.hpp>
#include <sdsl/config.hpp>
#include <sdsl/ram_fs.hpp>
#include <sdsl/sfstream.hpp>
#include <sys/stat.h>
#include <sys/types.h>
#include <cxxabi.h>
#include <libgen.h>
#include <unistd.h>
#include <sys/resource.h>
#include <sys/time.h>

Go to the source code of this file.

Namespaces

namespace  sdsl
 Namespace for the succinct data structure library.
 
namespace  sdsl::util
 A namespace for helper functions.
 

Macros

#define SDSL_STR(x)   #x
 
#define SDSL_XSTR(s)   SDSL_STR(s)
 

Functions

void sdsl::util::set_verbose ()
 
template<class t_int_vec >
void sdsl::util::set_random_bits (t_int_vec &v, int seed=0)
 Sets all bits of the int_vector to pseudo-random bits.
 
template<class t_int_vec >
void sdsl::util::_set_zero_bits (t_int_vec &v)
 Sets all bits of the int_vector to 0-bits.
 
template<class t_int_vec >
void sdsl::util::_set_one_bits (t_int_vec &v)
 Sets all bits of the int_vector to 1-bits.
 
template<class t_int_vec >
void sdsl::util::bit_compress (t_int_vec &v)
 Bit compress the int_vector.
 
template<class t_int_vec >
void sdsl::util::expand_width (t_int_vec &v, uint8_t new_width)
 Expands the integer width to new_width >= v.width()
 
template<class t_int_vec >
void sdsl::util::mod (t_int_vec &v, typename t_int_vec::size_type m)
 All elements of v modulo m.
 
void sdsl::util::cyclic_shifts (uint64_t *vec, uint8_t &n, uint64_t k, uint8_t int_width)
 
template<class t_int_vec >
void sdsl::util::set_to_value (t_int_vec &v, uint64_t k)
 Set all entries of int_vector to value k.
 
template<class t_int_vec , class t_int_vec_iterator >
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.
 
template<class t_int_vec >
void sdsl::util::set_to_id (t_int_vec &v)
 Sets each entry of the numerical vector v at position $fi.
 
template<class t_int_vec >
Number of set bits in v t_int_vec::size_type sdsl::util::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 sdsl::util::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 sdsl::util::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 sdsl::util::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 sdsl::util::prev_bit (const t_int_vec &v, uint64_t idx)
 
Get the size of a file in bytes size_t sdsl::util::file_size (const std::string &file)
 
Returns the basename of a file std::string sdsl::util::basename (std::string file)
 
Returns the directory of a file A trailing will be removed std::string sdsl::util::dirname (std::string file)
 
Demangle the class name of sdsl::util::typeid (...).name() inline std
 

Detailed Description

util.hpp contains some helper methods for int_vector and other stuff like demangle class names.

Author
Simon Gog

Definition in file util.hpp.

Macro Definition Documentation

◆ SDSL_STR

#define SDSL_STR (   x)    #x

Definition at line 42 of file util.hpp.

◆ SDSL_XSTR

#define SDSL_XSTR (   s)    SDSL_STR(s)

Definition at line 43 of file util.hpp.