fn delta(n: i32) -> Vec<f64> {
- let mut prio: Vec<f64> = Vec::new();
+ const NAME: &str = "Delta";
const MEAN: f64 = 1.0; // unessential thanks to normalization
- if DEBUG { eprint!("Delta: ") }
+ let mut prio: Vec<f64> = Vec::new();
+ if DEBUG { eprint!("{}: ", NAME) }
for i in 1..n + 1 {
prio.push(MEAN);
if DEBUG {
}
fn exp(n: i32) -> Vec<f64> {
+ const NAME: &str = "Exp";
const RATE: f64 = 1.0; // rate is unessential thanks to normalization
- let mut prio: Vec<f64> = Vec::new();
let dist = Exp::new(RATE).unwrap();
- if DEBUG { eprint!("Exp: ") }
+ let mut prio: Vec<f64> = Vec::new();
+ if DEBUG { eprint!("{}: ", NAME) }
for i in 1..n + 1 {
let f = i as f64 / (n as f64 + 1.0);
let x = dist.inverse_cdf(f);