From 0faada0687c519dd9d3d87d96811e1f8b8d16dfe Mon Sep 17 00:00:00 2001 From: Vinzent Steinberg Date: Fri, 6 Jul 2018 10:56:35 +0200 Subject: [PATCH] Fix benchmarks --- benches/kurtosis.rs | 7 ++++--- benches/mean.rs | 7 ++++--- benches/min.rs | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/benches/kurtosis.rs b/benches/kurtosis.rs index 0dfb3e5..8a25050 100644 --- a/benches/kurtosis.rs +++ b/benches/kurtosis.rs @@ -9,14 +9,15 @@ use bencher::Bencher; /// Create a random vector by sampling from a normal distribution. fn initialize_vec() -> Vec { - use rand::distributions::{Normal, IndependentSample}; + use rand::distributions::{Normal, Distribution}; use rand::{XorShiftRng, SeedableRng}; let normal = Normal::new(2.0, 3.0); let n = 1_000_000; let mut values = Vec::with_capacity(n); - let mut rng = XorShiftRng::from_seed([1, 2, 3, 4]); + let mut rng = XorShiftRng::from_seed( + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); for _ in 0..n { - values.push(normal.ind_sample(&mut rng)); + values.push(normal.sample(&mut rng)); } values } diff --git a/benches/mean.rs b/benches/mean.rs index 0e0ab32..eb9d8ed 100644 --- a/benches/mean.rs +++ b/benches/mean.rs @@ -10,14 +10,15 @@ use bencher::Bencher; /// Create a random vector by sampling from a normal distribution. fn initialize_vec() -> Vec { - use rand::distributions::{Normal, IndependentSample}; + use rand::distributions::{Normal, Distribution}; use rand::{XorShiftRng, SeedableRng}; let normal = Normal::new(2.0, 3.0); let n = 1_000_000; let mut values = Vec::with_capacity(n); - let mut rng = XorShiftRng::from_seed([1, 2, 3, 4]); + let mut rng = XorShiftRng::from_seed( + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); for _ in 0..n { - values.push(normal.ind_sample(&mut rng)); + values.push(normal.sample(&mut rng)); } values } diff --git a/benches/min.rs b/benches/min.rs index df045a4..c508121 100644 --- a/benches/min.rs +++ b/benches/min.rs @@ -10,14 +10,15 @@ use bencher::Bencher; /// Create a random vector of random floats in [0, 1]. fn initialize_vec() -> Vec { - use rand::distributions::{Range, IndependentSample}; + use rand::distributions::{Range, Distribution}; use rand::{XorShiftRng, SeedableRng}; let range = Range::new(0.0, 1.0); let n = 1_000_000; let mut values = Vec::with_capacity(n); - let mut rng = XorShiftRng::from_seed([1, 2, 3, 4]); + let mut rng = XorShiftRng::from_seed( + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); for _ in 0..n { - values.push(range.ind_sample(&mut rng)); + values.push(range.sample(&mut rng)); } values }