51 #include <sdsl/config.hpp> 52 #include <sdsl/int_vector.hpp> 53 #include <sdsl/rank_support.hpp> 54 #include <sdsl/sdsl_concepts.hpp> 55 #include <sdsl/select_support.hpp> 66 class mapping_wrapper;
68 typedef int_vector<>::size_type size_type;
69 typedef mapping_wrapper char2comp_type;
70 typedef mapping_wrapper comp2char_type;
71 typedef int_vector<64> C_type;
72 typedef uint16_t sigma_type;
73 typedef uint8_t char_type;
74 typedef uint8_t comp_char_type;
75 typedef std::string string_type;
76 typedef byte_alphabet_tag alphabet_category;
77 enum { int_width = 8 };
85 constexpr char_type operator[](char_type
const c)
const noexcept
91 const char2comp_type char2comp;
92 const comp2char_type comp2char;
94 const sigma_type & sigma;
109 plain_byte_alphabet(int_vector_buffer<8> & text_buf, int_vector_size_type len) : C(m_C), sigma(m_sigma)
112 if (0 == len || 0 == text_buf.size())
115 assert(len <= text_buf.size());
118 m_C = int_vector<64>(257, 0);
120 for (size_type i = 0; i < len; ++i)
126 for (
int i = 0; i < 256; ++i)
136 for (
int i = (
int) 256; i > 0; --i)
139 for (
int i = 1; i <= (int) 256; ++i)
140 m_C[i] += m_C[i - 1];
142 assert(C[sigma] == len);
148 m_sigma(strat.m_sigma)
153 m_C(std::move(strat.m_C)),
154 m_sigma(strat.m_sigma)
162 *
this = std::move(tmp);
171 m_C = std::move(strat.m_C);
172 m_sigma = std::move(strat.m_sigma);
177 size_type serialize(std::ostream & out, structure_tree_node * v, std::string name =
"")
const 179 structure_tree_node * child = structure_tree::add_child(v, name, util::class_name(*
this));
180 size_type written_bytes = 0;
181 written_bytes += m_C.serialize(out, child,
"m_C");
182 written_bytes += write_member(m_sigma, out, child,
"m_sigma");
183 structure_tree::add_size(child, written_bytes);
184 return written_bytes;
187 void load(std::istream & in)
190 read_member(m_sigma, in);
Byte alphabet that does no mapping of char_type to comp_char_type and vice versa. ...
Definition: csa_alphabet_strategy.hpp:62
Definition: csa_alphabet_strategy.hpp:57