More code deduplication
This commit is contained in:
parent
9313307ae9
commit
d5b3fc80ab
@ -76,8 +76,10 @@ mod weighted_mean;
|
||||
mod minmax;
|
||||
mod reduce;
|
||||
mod quantile;
|
||||
mod traits;
|
||||
|
||||
pub use moments::{Mean, Variance, Skewness, Kurtosis, MeanWithError};
|
||||
pub use weighted_mean::{WeightedMean, WeightedMeanWithError};
|
||||
pub use minmax::{Min, Max};
|
||||
pub use quantile::Quantile;
|
||||
pub use traits::{Estimate, Merge};
|
||||
|
@ -83,17 +83,7 @@ impl core::default::Default for Min {
|
||||
}
|
||||
}
|
||||
|
||||
impl core::iter::FromIterator<f64> for Min {
|
||||
fn from_iter<T>(iter: T) -> Min
|
||||
where T: IntoIterator<Item=f64>
|
||||
{
|
||||
let mut a = Min::new();
|
||||
for i in iter {
|
||||
a.add(i);
|
||||
}
|
||||
a
|
||||
}
|
||||
}
|
||||
impl_from_iterator!(Min);
|
||||
|
||||
/// Estimate the maximum of a sequence of numbers ("population").
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user