Description
integer arithmetic codes.
Description
The Variety module provides functions to optimally encode and decode sequences of value-base pairs assuming uniform probability.
If codes get too large and slow to process, Variety.Bounded provides a similar interface with a precision parameter at small cost to code length.
The Combinatorics module provides functions to optimally encode and decode (rank and unrank) common combinatorial objects.
The Elias module provides entirely non-parametric encoding and decoding of positive integers. The usual definition doesn't allow for an encoding of 0, so a mapping is baked into the functions in Elias.Natural that shifts the number line by 1.