entropiter 0.2.1

A no-dep iterator-compatible frequency and Shannon entropy calculator
Documentation
  • Coverage
  • 0%
    0 out of 18 items documented0 out of 13 items with examples
  • Size
  • Source code size: 8.77 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 698.57 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Herbstein/entropiter
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Herbstein

Entropiter

Easily calculate the frequency and probability of symbol occurrence in an iterator, and effortlessly calculate the entropy.

Usage

To use this library you only need an iterator containing the symbol of your choice, and the choice of histogram backing store to accumulate into. The generic backing stores available are BTreeMapHistogram and HashMapHistogram, while for u8 symbols ByteHistogram is also available.

Example

use entropiter::{FrequencyIteratorExt, HashMapHistogram};

fn main() {
    let shannon_entropy = "shannon".chars().shannon::<HashMapHistogram<_>>().entropy();
    println!("entropy: {}", shannon_entropy);
}