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> 39 class mapping_wrapper;
41 typedef int_vector<>::size_type size_type;
42 typedef mapping_wrapper char2comp_type;
43 typedef mapping_wrapper comp2char_type;
44 typedef int_vector<64> C_type;
45 typedef uint16_t sigma_type;
46 typedef uint8_t char_type;
47 typedef uint8_t comp_char_type;
49 typedef byte_alphabet_tag alphabet_category;
50 enum { int_width = 8 };
58 constexpr char_type operator[](char_type
const c)
const noexcept
64 const char2comp_type char2comp;
65 const comp2char_type comp2char;
67 const sigma_type & sigma;
82 plain_byte_alphabet(int_vector_buffer<8> & text_buf, int_vector_size_type len) : C(m_C), sigma(m_sigma)
85 if (0 == len || 0 == text_buf.size())
88 assert(len <= text_buf.size());
91 m_C = int_vector<64>(257, 0);
93 for (size_type i = 0; i < len; ++i)
99 for (
int i = 0; i < 256; ++i)
109 for (
int i = (
int) 256; i > 0; --i)
112 for (
int i = 1; i <= (int) 256; ++i)
113 m_C[i] += m_C[i - 1];
115 assert(C[sigma] == len);
121 m_sigma(strat.m_sigma)
126 m_C(std::move(strat.m_C)),
127 m_sigma(strat.m_sigma)
135 *
this = std::move(tmp);
144 m_C = std::move(strat.m_C);
145 m_sigma = std::move(strat.m_sigma);
152 structure_tree_node * child = structure_tree::add_child(v, name, util::class_name(*
this));
153 size_type written_bytes = 0;
154 written_bytes += m_C.serialize(out, child,
"m_C");
155 written_bytes += write_member(m_sigma, out, child,
"m_sigma");
156 structure_tree::add_size(child, written_bytes);
157 return written_bytes;
163 read_member(m_sigma, in);
166 template <
typename archive_t>
167 void CEREAL_SAVE_FUNCTION_NAME(archive_t & ar)
const 170 ar(CEREAL_NVP(m_sigma));
173 template <
typename archive_t>
174 void CEREAL_LOAD_FUNCTION_NAME(archive_t & ar)
177 ar(CEREAL_NVP(m_sigma));
182 return (m_C == other.m_C) && (m_sigma == other.m_sigma);
187 return !(*
this == other);
Byte alphabet that does no mapping of char_type to comp_char_type and vice versa. ...
Definition: csa_alphabet_strategy.hpp:35
Definition: csa_alphabet_strategy.hpp:30