|
Zip and Skip Tries
|
Represents an approximate Longest Common Prefix (LCP) length in a memory-efficient format. More...
#include <ZipTrie.hpp>
Public Member Functions | |
| auto | operator<=> (const MemoryEfficientLCP &) const =default |
| Default comparison operator. | |
| unsigned | value () const noexcept |
| Calculates the approximate actual LCP value represented by this struct. | |
| std::ostream & | print (std::ostream &os) const noexcept |
| Prints the LCP representation (e.g., "2^3 * 5") to an output stream. | |
Public Attributes | |
| uint8_t | exp_of_2 = 0 |
| The exponent part of the LCP representation (base 2). | |
| uint8_t | multiple = 0 |
| The multiple (mantissa) part of the LCP representation. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| std::ostream & | operator<< (std::ostream &os, const MemoryEfficientLCP &lcp) |
Overloaded stream insertion operator (<<) for MemoryEfficientLCP. | |
Represents an approximate Longest Common Prefix (LCP) length in a memory-efficient format.
Stores the LCP value approximately as multiple * 2^exp_of_2. This allows representing potentially large LCP values using fewer bits (typically two uint8_t) at the cost of precision for larger values. The scaling depends on the expected maximum size of the trie.
Definition at line 36 of file ZipTrie.hpp.
|
default |
Default comparison operator.
Compares exp_of_2 first, then multiple for tie-breaking. This allows comparing approximate LCP values directly.
|
inlinenoexcept |
Prints the LCP representation (e.g., "2^3 * 5") to an output stream.
| os | The output stream to write to. |
Definition at line 1062 of file ZipTrie.hpp.
|
inlinenoexcept |
Calculates the approximate actual LCP value represented by this struct.
multiple * 2^exp_of_2). Definition at line 1055 of file ZipTrie.hpp.
|
related |
Overloaded stream insertion operator (<<) for MemoryEfficientLCP.
Allows printing MemoryEfficientLCP objects directly to output streams (e.g., std::cout << lcp;). Delegates formatting to the MemoryEfficientLCP::print method.
| os | The output stream (e.g., std::cout, std::ofstream). |
| lcp | The MemoryEfficientLCP object to print. |
Definition at line 1077 of file ZipTrie.hpp.
| uint8_t MemoryEfficientLCP::exp_of_2 = 0 |
The exponent part of the LCP representation (base 2).
Definition at line 39 of file ZipTrie.hpp.
| uint8_t MemoryEfficientLCP::multiple = 0 |
The multiple (mantissa) part of the LCP representation.
Definition at line 41 of file ZipTrie.hpp.