Skip to main content

Module utils

Module utils 

Source
Expand description

Helpers and statistics.

CountBitReader and CountBitWriter keep track of the number of bits read or written to a BitRead and BitWrite, respectively, optionally printing on standard error the operations performed on the stream.

DbgBitReader and DbgBitWriter print on standard error all operations performed by a BitRead or BitWrite.

CodesStats keeps track of the space needed to store a stream of integers using different codes.

With the implied feature, it also provides sample_implied_distribution, an infinite iterator that returns samples from the implied distribution of a code, and the helper function get_implied_distribution.

FindChangePoints finds, using exponential search, the points where a non-decreasing monotonic function changes value.

Re-exports§

pub use stats::CodesStats;
pub use stats::CodesStatsWrapper;

Modules§

stats

Structs§

CountBitReader
A wrapper around a BitRead that keeps track of the number of bits read and optionally prints on standard error the operations performed on the stream.
CountBitWriter
A wrapper around a BitWrite that keeps track of the number of bits written and optionally prints on standard error the operations performed on the stream.
DbgBitReader
A wrapper over a BitRead that reports on standard error all operations performed, including all code reads.
DbgBitWriter
A wrapper over a BitWrite that reports on standard error all operations performed, including all code writes.
FindChangePoints
Iterates over the points where the given function changes value. This only works for monotonic non-decreasing functions.