15 Meta m(
"phi",
"from_sa");
23 template<
typename textds_t>
28 auto& sa = t.require_sa(cm);
30 const size_t n = t.size();
37 for(
len_t i = 1, prev = sa[0]; i < n; i++) {
38 (*this)[sa[i]] = prev;
41 (*this)[sa[0]] = sa[n-1];
51 debug_check_array_is_initialized();
Contains the text compression and encoding framework.
constexpr uint_fast8_t bits_for(size_t n)
Computes the number of bits required to store the given integer value.
DynamicIntVector iv_t
The type of integer array to use as storage.
Data structures are constructed directly in bit-compressed space (slower construction, but smaller memory usage).
static ds::InputRestrictions restrictions()
PhiFromSA(Env &&env, textds_t &t, CompressMode cm)
Base for data structures that use an integer array as a storage.
CompressMode
Defines when data structures are bit-compressed.
Env & env()
Provides access to the environment that the algorithm works in.
Constructs the Phi array using the suffix array.
fast_t< len_compact_t > len_t
Type to represent an length value.
void set_array(iv_t &&iv)
static void log(const char *key, const T &value)
Logs a user statistic for the current phase.
uint64_t bit_size() const
static auto wrap(const char *title, F func) -> typename std::result_of< F(StatPhase &)>::type
Executes a lambda as a single statistics phase.
constexpr size_t INDEX_FAST_BITS
The amount of bits required to store the binary representation of a value of type len_t...
Data structures are bit-compressed after they have been constructed (fast construction, but possibly high memory peak).
Local environment for a compression/encoding/decompression call.
Interface for algorithms.