Implement Default for Quantile

This commit is contained in:
Vinzent Steinberg 2017-06-21 19:23:53 +02:00
parent 01157da831
commit 2b960310ce

View File

@ -1,3 +1,4 @@
use core;
use core::cmp::min;
use conv::{ApproxFrom, ConvAsUtil, ValueFrom};
@ -163,6 +164,13 @@ impl Quantile {
}
}
impl core::default::Default for Quantile {
/// Create a new median estimator.
fn default() -> Quantile {
Quantile::new(0.5)
}
}
#[test]
fn reference() {
let observations = [