24 #include <sdsl/config.hpp>
25 #include <sdsl/int_vector.hpp>
26 #include <sdsl/rank_support.hpp>
27 #include <sdsl/sdsl_concepts.hpp>
28 #include <sdsl/select_support.hpp>
41 class mapping_wrapper;
43 typedef int_vector<>::size_type size_type;
44 typedef mapping_wrapper char2comp_type;
45 typedef mapping_wrapper comp2char_type;
46 typedef int_vector<64> C_type;
47 typedef uint16_t sigma_type;
48 typedef uint8_t char_type;
49 typedef uint8_t comp_char_type;
51 typedef byte_alphabet_tag alphabet_category;
52 enum { int_width = 8 };
60 constexpr char_type operator[](char_type
const c)
const noexcept
66 const char2comp_type char2comp;
67 const comp2char_type comp2char;
69 const sigma_type & sigma;
84 plain_byte_alphabet(int_vector_buffer<8> & text_buf, int_vector_size_type len) : C(m_C), sigma(m_sigma)
87 if (0 == len || 0 == text_buf.size())
90 assert(len <= text_buf.size());
93 m_C = int_vector<64>(257, 0);
95 for (size_type i = 0; i < len; ++i)
101 for (
int i = 0; i < 256; ++i)
111 for (
int i = (
int) 256; i > 0; --i)
114 for (
int i = 1; i <= (int) 256; ++i)
115 m_C[i] += m_C[i - 1];
117 assert(C[sigma] == len);
123 m_sigma(strat.m_sigma)
129 m_sigma(strat.m_sigma)
154 structure_tree_node * child = structure_tree::add_child(v, name, util::class_name(*
this));
155 size_type written_bytes = 0;
156 written_bytes += m_C.serialize(out, child,
"m_C");
157 written_bytes += write_member(m_sigma, out, child,
"m_sigma");
158 structure_tree::add_size(child, written_bytes);
159 return written_bytes;
165 read_member(m_sigma, in);
168 template <
typename archive_t>
169 void CEREAL_SAVE_FUNCTION_NAME(archive_t & ar)
const
172 ar(CEREAL_NVP(m_sigma));
175 template <
typename archive_t>
176 void CEREAL_LOAD_FUNCTION_NAME(archive_t & ar)
179 ar(CEREAL_NVP(m_sigma));
184 return (m_C == other.m_C) && (m_sigma == other.m_sigma);
189 return !(*
this == other);