Add missing file
This commit is contained in:
parent
5d6d67bac9
commit
9daef2c101
13
src/traits.rs
Normal file
13
src/traits.rs
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user