compute 0.2.3

A crate for statistical computing.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use compute::distributions::{Distribution, Normal};
use compute::statistics::*;
use criterion::{black_box, criterion_group, criterion_main, Criterion};

pub fn criterion_mean(c: &mut Criterion) {
    let v = Normal::new(0., 100.).sample_n(1e6 as usize);
    c.bench_function("mean 1e6", |b| b.iter(|| mean(black_box(&v))));
    c.bench_function("welford mean 1e6", |b| {
        b.iter(|| welford_mean(black_box(&v)))
    });
}

criterion_group!(benches, criterion_mean);
criterion_main!(benches);