The OpenD Programming Language

EntropyAccumulator

Members

Functions

entropy
F entropy()
put
void put(Range r)
put
void put(T x)
put
void put(EntropyAccumulator!(U, summation) e)

Variables

summator
Summator!(T, summation) summator;

Examples

test basic functionality

import mir.math.common: approxEqual;
import mir.ndslice.slice: sliced;

EntropyAccumulator!(double, Summation.pairwise) x;
x.put([0.1, 0.2, 0.3].sliced);
assert(x.entropy.approxEqual(-0.913338));
x.put(0.4);
assert(x.entropy.approxEqual(-1.279854));

Meta