criterion/
estimate.rs
1use std::collections::BTreeMap;
2use std::fmt;
3
4use stats::Distribution;
5
6use Estimate;
7
8#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd, Deserialize, Serialize, Debug)]
9pub enum Statistic {
10 Mean,
11 Median,
12 MedianAbsDev,
13 Slope,
14 StdDev,
15}
16
17impl fmt::Display for Statistic {
18 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
19 match *self {
20 Statistic::Mean => f.pad("mean"),
21 Statistic::Median => f.pad("median"),
22 Statistic::MedianAbsDev => f.pad("MAD"),
23 Statistic::Slope => f.pad("slope"),
24 Statistic::StdDev => f.pad("SD"),
25 }
26 }
27}
28
29pub(crate) type Estimates = BTreeMap<Statistic, Estimate>;
30
31pub(crate) type Distributions = BTreeMap<Statistic, Distribution<f64>>;