8#ifndef INCLUDED_SDSL_CONSTRUCT_BWT
9#define INCLUDED_SDSL_CONSTRUCT_BWT
37template <u
int8_t t_w
idth>
40 static_assert(t_width == 0 or t_width == 8,
41 "construct_bwt: width must be `0` for integer alphabet and `8` for byte alphabet");
49 size_type n = text.
size();
50 uint8_t bwt_width = text.width();
53 auto gen_bwt = [&n](
auto & bwt,
auto & text,
auto & sa)
55 size_type to_add[2] = {(size_type)-1, n - 1};
56 for (size_type i = 0; i < n; ++i)
58 bwt[i] = text[sa[i] + to_add[sa[i] == 0]];
66 gen_bwt(bwt, text, sa);
70 size_type buffer_size = 1000000;
75 gen_bwt(bwt, text, sa_buf);
int_vector_size_type size_type
size_type size() const noexcept
The number of elements in the int_vector.
static int_vector_mapper< t_width > create(std::string const &key, cache_config &config)
int_vector.hpp contains the sdsl::int_vector class.
int_vector_buffer.hpp contains the sdsl::int_vector_buffer class.
io.hpp contains some methods for reading/writing sdsl structures.
Namespace for the succinct data structure library.
std::string cache_file_name(std::string const &key, cache_config const &config)
Returns the file name of the resource.
void register_cache_file(std::string const &key, cache_config &config)
Register the existing resource specified by the key to the cache.
bool is_ram_file(std::string const &file)
Determines if the given file is a RAM-file.
void construct_bwt(cache_config &config)
Constructs the Burrows and Wheeler Transform (BWT) from text over byte- or integer-alphabet and suffi...
int_vector_mapper< t_width, std::ios_base::in > const read_only_mapper
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.