6 namespace tdc {
namespace esp {
7 static_assert(
sizeof(std::array<size_t, 2>) ==
sizeof(
size_t) * 2,
"Something is not right");
13 std::vector<std::array<size_t, 2>>
rules;
18 inline SLP(std::vector<std::array<size_t, 2>>&& r,
28 }
else for (
auto r : rules[rule - GRAMMAR_PD_ELLIDED_PREFIX]) {
48 DCHECK_GE(n, GRAMMAR_PD_ELLIDED_PREFIX);
52 inline const std::array<size_t, 2>&
node(
size_t n)
const {
62 return slp->
rules[i][1];
65 return slp->
rules[i][1];
67 inline size_t size()
const {
68 return slp->
rules.size();
Contains the text compression and encoding framework.
std::vector< std::array< size_t, 2 > > rules
size_t GRAMMAR_PD_ELLIDED_PREFIX
std::ostream & derive_text(std::ostream &o) const
const std::array< size_t, 2 > & node(size_t n) const
SLP(std::vector< std::array< size_t, 2 >> &&r, size_t root, bool e)
std::string derive_text_s() const
size_t & operator[](size_t i)
size_t node_idx(size_t n) const
void derive_text_rec(std::ostream &o, size_t rule) const
const size_t & operator[](size_t i) const