13 namespace tdc {
namespace esp {
15 template<
typename Source>
30 debug.
block(width, type);
36 size_t j = src.size();
37 for (
size_t i = 0; i < j;) {
38 size_t remaining_len = j - i;
39 switch (remaining_len) {
70 auto type_3_prefix_len = std::min(
iter_log(ctx.alphabet_size),
75 auto type_3_prefix = A.slice(0, type_3_prefix_len);
77 if (type_3_prefix_len == A.size()) {
return; }
80 auto type_2_suffix_size = src.size() - type_3_prefix_len;
83 auto& buf = ctx.scratchpad;
85 buf.reserve(A.cend() - A.cbegin());
86 buf.insert(buf.cbegin(), A.cbegin(), A.cend());
94 for (
uint shrink_i = 0; shrink_i < type_3_prefix_len; shrink_i++) {
95 for (
size_t i = 1; i < buf.size(); i++) {
96 auto left = buf[i - 1];
98 buf[i - 1] =
label(left, right);
113 for(
uint to_replace = 3; to_replace < 6; to_replace++) {
116 if (e == to_replace) {
118 for (
auto n : neighbors) {
if (n == e) { e++; } }
119 for (
auto n : neighbors) {
if (n == e) { e++; } }
137 bool is_high_landmark =
true;
138 for (
auto e : neighbors) {
140 is_high_landmark =
false;
143 if (is_high_landmark) {
151 bool is_low_landmark =
true;
152 for (
auto e : neighbors) {
154 is_low_landmark =
false;
158 if (is_low_landmark) {
160 if ( (!(i > 0) || (landmarks[i - 1] == 0u))
161 && (!(i < buf.size() - 1) || (landmarks[i + 1] == 0u))
179 [&](
size_t left,
size_t right) {
182 ctx.behavior_landmarks_tie_to_right
186 ctx.debug_check_advanced(type_2_suffix_size);
Contains the text compression and encoding framework.
void mb2_reduce_to_3_step(const T &buf)
void mb2_reduce_to_3_start()
uint64_t label(uint64_t left, uint64_t right)
A vector over arbitrary unsigned integer types.
A const view into a slice of memory.
DebugMetablockContext debug
void mb2_high_and_low_landmarks(const T &buf)
void block(size_t width, size_t type)
void debug_check_advanced(size_t len)
void mb2_high_landmarks(const T &buf)
void eager_mb2(const Source &src)
typename uint_dispatch_t< N >::type uint_t
bool check_landmarks(const T &t, bool allow_long=false)
size_t iter_log(size_t n)
MetablockContext(RoundContext< Source > &ctx, DebugMetablockContext dbg)
void mb2_reduce_to_6_start()
void push_back(size_t l, size_t type)
bool no_adjacent_identical(const T &t)
void mb2_reduce_to_6_step(const T &buf)
void landmark_spanner(size_t size, LmPred pred, SpanPush push, bool tie)
void push_block(size_t width, size_t type)
void eager_mb13(const Source &src, size_t t)
void do_for_neighbors(T &t, F f)
void mb2_initial(const T &buf)
RoundContext< Source > & rctx()
uint64_t calc_alphabet_size(const T &t)