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

Generate an offline, interactive gallery of real FGK tree states. More...

#include <Adaptive_Huffman.H>
#include <ah-errors.H>
#include <tpl_array.H>
#include "adaptive_huffman_demo_support.H"
#include <algorithm>
#include <cstddef>
#include <exception>
#include <fstream>
#include <iostream>
#include <locale>
#include <ostream>
#include <string>
#include <string_view>
Include dependency graph for adaptive_huffman_visual_example.cc:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 Generate a self-contained, self-checking adaptive Huffman gallery.
 

Detailed Description

Generate an offline, interactive gallery of real FGK tree states.

Build: cmake –build build –target adaptive_huffman_visual_example Run: ./build/Examples/adaptive_huffman_visual_example [output.html] [text]

Without custom text, three scenarios illustrate first appearances, repeated words, and a changing source distribution. The generated HTML includes SVG trees, a byte-by-byte timeline, current codes and actual bit costs. It needs no server, network resources, or extra dependencies. Every frame comes from a verified encoding/decoding step of the public API.

Definition in file adaptive_huffman_visual_example.cc.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Generate a self-contained, self-checking adaptive Huffman gallery.

Parameters
argcNumber of command-line arguments.
argvOptional output path, then optional custom text of at most 32 bytes.
Returns
Zero on success; one for invalid arguments, I/O or verification errors.

Definition at line 369 of file adaptive_huffman_visual_example.cc.

References ah_invalid_argument_if, ah_runtime_error_unless, Aleph::and, Aleph::Array< T >::append(), Aleph::error(), output, and Aleph::Array< T >::size().