12 template<
class HashFunction = MixHasher,
class HashManager = SizeManagerDirect>
19 Meta m(
"lz78trie",
"hash_plus",
"Hash Trie+");
29 , m_table(this->
env(),n,remaining_characters)
30 , m_table2(this->
env(),n,remaining_characters)
43 if(m_table2.
empty()) {
44 m_table.collect_stats(
env());
46 m_table2.collect_stats(
env());
55 DCHECK(m_table2.
empty());
70 auto parent = parent_w.
id();
72 if(!m_table2.
empty()) {
75 return node_t(newleaf_id,
true);
77 return node_t(ret.first.value(),
false);
84 if(expected_size < m_table.
table_size()*2.0*0.95) {
89 return node_t(newleaf_id,
true);
91 return node_t(ret.first.value(),
false);
94 inline size_t size()
const {
Contains the text compression and encoding framework.
const size_t & m_remaining_characters
#define tdc_unlikely(x)
Provides a hint to the compiler that x is expected to resolve to false.
uint8_t uliteral_t
Type to represent signed single literals.
std::pair< Iterator, bool > insert(std::pair< key_t, value_t > &&value)
node_t get_rootnode(uliteral_t c) const
Env & env()
Provides access to the environment that the algorithm works in.
Default return type of find_or_insert.
HashTriePlus(Env &&env, const size_t n, const size_t &remaining_characters, factorid_t reserve=0)
void incorporate(T &&o, len_t newsize)
uint32_t factorid_t
Type for the factor indices, bounded by the number of LZ78 trie nodes.
squeeze_node_t create_node(factorid_t id, uliteral_t c)
node_t add_rootnode(uliteral_t c)
HashTriePlus & operator=(HashTriePlus &&other)=default
node_t find_or_insert(const node_t &parent_w, uliteral_t c)
float max_load_factor() const noexcept
Local environment for a compression/encoding/decompression call.
Interface for algorithms.
IF_STATS(MoveGuard m_guard;inline ~HashTriePlus() { if(m_guard) { if(m_table2.empty()) { m_table.collect_stats(env());} else { m_table2.collect_stats(env());} } }) HashTriePlus(HashTriePlus &&other)=default