13 template<
typename text_t = TextDS<>>
21 Meta m(
"compressor",
"bwt",
"BWT Compressor");
32 DCHECK(in.ends_with(uint8_t(0)));
36 const len_t input_size = t.size();
43 const auto& sa = t.require_sa();
44 for(
size_t i = 0; i < input_size; ++i) {
62 ostream << decoded_string <<
'\0';
Contains the text compression and encoding framework.
std::string decode_bwt(const bwt_t &bwt)
Decodes a BWT It is assumed that the BWT is stored in a container with access to operator[] and ...
std::string vec_to_debug_string(const T &s, size_t indent=0)
Builds the string representation of a vector of byte values, sorrounded by square brackets ([ and ])...
#define tdc_unlikely(x)
Provides a hint to the compiler that x is expected to resolve to false.
Base for data compressors.
text_t::value_type bwt(const text_t &text, const sa_t &sa, const size_t i)
Computes the value BWT[i] of a text T given its suffix array SA Runs in O(1) time since BWT[i] = SA[(...
Env & env()
Provides access to the environment that the algorithm works in.
OutputStream as_stream() const
Creates a stream that allows for character-wise output.
virtual void compress(Input &input, Output &output) override
Compress the given input to the given output.
An abstraction layer for algorithm output.
fast_t< len_compact_t > len_t
Type to represent an length value.
virtual void decompress(Input &input, Output &output) override
Decompress the given input to the given output.
static auto wrap(const char *title, F func) -> typename std::result_of< F(StatPhase &)>::type
Executes a lambda as a single statistics phase.
Compressor(Compressor const &)=default
Manages text related data structures.