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

Three guided demonstrations of adaptive Huffman coding. More...

#include <Adaptive_Huffman.H>
#include <ah-errors.H>
#include "adaptive_huffman_demo_support.H"
#include <algorithm>
#include <cstddef>
#include <exception>
#include <iomanip>
#include <iostream>
#include <string>
#include <string_view>
Include dependency graph for adaptive_huffman_example.cc:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 Run the guided, self-checking adaptive Huffman demonstrations.
 

Detailed Description

Three guided demonstrations of adaptive Huffman coding.

Build: cmake –build build –target adaptive_huffman_example Run: ./build/Examples/adaptive_huffman_example [text]

Demonstrates exact transmitted bits and tree snapshots, adaptation to changing frequencies, and binary data received in arbitrarily cut chunks. All demonstrations verify their decoded output. Display trees use only public encoder operations.

Definition in file adaptive_huffman_example.cc.

Function Documentation

◆ main()

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

Run the guided, self-checking adaptive Huffman demonstrations.

Parameters
argcNumber of command-line arguments.
argvOptional short trace text in argv[1]; –help prints usage.
Returns
Zero on success; one if arguments or verification fail.

Definition at line 181 of file adaptive_huffman_example.cc.

References ah_invalid_argument_if, Aleph::and, and Aleph::error().