15 template<
typename sa_t>
32 Meta m(
"lcp",
"compressed_lcp");
42 inline void encode_unary(
len_t x) {
51 template<
typename textds_t>
56 static_assert(std::is_same<sa_t, typename textds_t::sa_type>(),
57 "Suffix Array type mismatch!");
60 m_sa = &tds.require_sa(cm);
61 auto& plcp = tds.require_plcp(cm);
64 m_max = plcp.max_lcp();
68 encode_unary(plcp[0] + 1);
69 for(
size_t i = 1; i < m_size; i++) {
70 encode_unary(plcp[i] - plcp[i-1] + 1);
82 const len_t j = (*m_sa)[i];
83 return m_select(j+1) - 2*j - 1;
90 inline size_t size()
const {
95 throw std::runtime_error(
"not supported");
99 throw std::runtime_error(
"not supported");
len_t operator[](len_t i) const
Contains the text compression and encoding framework.
CompressedLCP(Env &&env, textds_t &tds, CompressMode cm)
static ds::InputRestrictions restrictions()
A vector over arbitrary unsigned integer types.
Constructs the LCP array from the Suffix and PLCP arrays, storing it in a manner as described by Fisc...
void emplace_back(Args &&... args)
CompressMode
Defines when data structures are bit-compressed.
Env & env()
Provides access to the environment that the algorithm works in.
fast_t< len_compact_t > len_t
Type to represent an length value.
static auto wrap(const char *title, F func) -> typename std::result_of< F(StatPhase &)>::type
Executes a lambda as a single statistics phase.
IntVector< dynamic_t > DynamicIntVector
Represents an integer vector with unspecified (dynamic) bit width.
Local environment for a compression/encoding/decompression call.
Interface for algorithms.