Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
adaptive_huffman_demo_support.H File Reference

Shared, public-API-only traces for the adaptive Huffman examples. More...

#include <Adaptive_Huffman.H>
#include <ah-errors.H>
#include <tpl_array.H>
#include <cstddef>
#include <cstdint>
#include <ostream>
#include <string>
#include <string_view>
#include <utility>
Include dependency graph for adaptive_huffman_demo_support.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  adaptive_huffman_demo::Display_Node
 One node of a reconstructed display tree. More...
 
struct  adaptive_huffman_demo::Snapshot
 A complete tree for one externally observable encoder state. More...
 
struct  adaptive_huffman_demo::Frame
 One verified encoding event, plus the tree after the event. More...
 

Namespaces

namespace  adaptive_huffman_demo
 

Functions

std::string adaptive_huffman_demo::byte_label (const unsigned char byte)
 Return an unambiguous, terminal-safe label for a byte.
 
std::string adaptive_huffman_demo::next_code (const Aleph::Adaptive_Huffman_Encoder &encoder, const unsigned char byte)
 Probe a byte's code without changing the source encoder.
 
void adaptive_huffman_demo::insert_code (Snapshot &tree, const std::string &code, const int symbol, const std::uint64_t weight)
 Insert a code into the display trie and accumulate its frequency.
 
void adaptive_huffman_demo::position_nodes (Snapshot &tree, const int node, const size_t depth, size_t &next_leaf)
 Assign inorder leaf positions and center parents over children.
 
Snapshot adaptive_huffman_demo::snapshot (const Aleph::Adaptive_Huffman_Encoder &encoder)
 Reconstruct and validate the tree using public encoder operations.
 
Aleph::Array< Frame > adaptive_huffman_demo::trace (const std::string_view input)
 Record an actual online round trip, starting with the empty model.
 
void adaptive_huffman_demo::print_tree (std::ostream &out, const Snapshot &tree, const int node=0, const std::string &indent=" ", const std::string &edge="")
 Print a byte-labelled, edge-labelled tree using portable ASCII.
 

Detailed Description

Shared, public-API-only traces for the adaptive Huffman examples.

Tree snapshots are reconstructed from codes obtained from independent copies of the real encoder. No implementation-detail model is accessed.

Definition in file adaptive_huffman_demo_support.H.