12 typename HashRoller = ZBackupRollingHash,
13 typename HashProber = LinearProber,
14 typename HashManager = SizeManagerPrime,
15 typename HashFunction = NoopHasher
18 typedef typename HashRoller::key_type key_type;
19 mutable HashRoller m_roller;
22 inline key_type hash_node(
uliteral_t c)
const {
29 Meta m(
"lz78trie",
"rolling",
"Rolling Hash Trie");
40 , m_roller(this->
env().env_for_option(
"hash_roller"))
41 , m_table(this->
env(), n, remaining_characters) {
52 m_table.collect_stats(
env());
60 m_table.
insert(std::make_pair<key_type,factorid_t>(hash_node(c),
size()));
77 auto ret = m_table.
insert(std::make_pair(hash_node(c), newleaf_id));
80 return node_t(newleaf_id,
true);
82 return node_t(ret.first.value(),
false);
85 inline size_t size()
const {
Contains the text compression and encoding framework.
RollingTrie & operator=(RollingTrie &&other)=default
uint8_t uliteral_t
Type to represent signed single literals.
std::pair< Iterator, bool > insert(std::pair< key_t, value_t > &&value)
node_t add_rootnode(uliteral_t c)
RollingTrie(Env &&env, const size_t n, const size_t &remaining_characters, factorid_t reserve=0)
node_t get_rootnode(uliteral_t c) const
node_t find_or_insert(const node_t &, uliteral_t c)
Env & env()
Provides access to the environment that the algorithm works in.
Default return type of find_or_insert.
uint32_t factorid_t
Type for the factor indices, bounded by the number of LZ78 trie nodes.
float max_load_factor() const noexcept
Local environment for a compression/encoding/decompression call.
IF_STATS(MoveGuard m_guard;inline ~RollingTrie() { if(m_guard) { m_table.collect_stats(env());} }) RollingTrie(RollingTrie &&other)=default
Interface for algorithms.