Add missing file

This commit is contained in:
Vinzent Steinberg 2017-06-27 09:58:37 +02:00
parent 5d6d67bac9
commit 9daef2c101

13
src/traits.rs Normal file
View File

@ -0,0 +1,13 @@
/// Estimate a statistic of a sequence of numbers ("population").
pub trait Estimate {
/// Add an observation sampled from the population.
fn add(&mut self, x: f64);
/// Estimate the statistic of the population.
fn estimate(&self) -> f64;
}
/// Merge another sample into this one.
pub trait Merge {
fn merge(&mut self, other: &Self);
}