8 #ifndef INCLUDED_SDSL_CONSTRUCT_BWT
9 #define INCLUDED_SDSL_CONSTRUCT_BWT
35 template <u
int8_t t_w
idth>
38 static_assert(t_width == 0 or t_width == 8,
39 "construct_bwt: width must be `0` for integer alphabet and `8` for byte alphabet");
48 uint8_t bwt_width = text.
width();
51 auto gen_bwt = [&n](
auto & bwt,
auto & text,
auto & sa) {
53 for (
size_type i = 0; i < n; ++i) { bwt[i] = text[sa[i] + to_add[sa[i] == 0]]; }
60 gen_bwt(bwt, text, sa);
69 gen_bwt(bwt, text, sa_buf);
A generic vector class for integers of width .
static int_vector_mapper< t_width > create(const std::string &key, cache_config &config)
int_vector.hpp contains the sdsl::int_vector class.
constexpr char KEY_TEXT[]
int_vector ::size_type size_type
Namespace for the succinct data structure library.
std::string cache_file_name(const std::string &key, const cache_config &config)
Returns the file name of the resource.
bool is_ram_file(const std::string &file)
Determines if the given file is a RAM-file.
void register_cache_file(const std::string &key, cache_config &config)
Register the existing resource specified by the key to the cache.
void construct_bwt(cache_config &config)
Constructs the Burrows and Wheeler Transform (BWT) from text over byte- or integer-alphabet and suffi...
sfstream.hpp contains a two stream class which can be used to read/write from/to files or strings.
Helper class for construction process.
Helper classes to transform width=0 and width=8 to corresponding bwt key.
Helper classes to transform width=0 and width=8 to corresponding text key.
util.hpp contains some helper methods for int_vector and other stuff like demangle class names.