From 8404839233680f9f68a471620c65d444a1dcf948 Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Fri, 15 Nov 2019 14:29:18 -0500 Subject: [PATCH] Import IsaacRng from rand_isaac instead of rand. The rand crate removed IsaacRng in the 0.5 -> 0.6 transition, so the benchmarks that use it haven't compiled since 9c37c512039059281b210521cfd53e931f5fa0b5. --- Cargo.toml | 1 + benches/core/matrix.rs | 5 +++-- benches/core/vector.rs | 3 ++- benches/geometry/quaternion.rs | 5 +++-- benches/lib.rs | 6 ++++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 582e0824..1569b0a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,6 +56,7 @@ pest_derive = { version = "2.0", optional = true } [dev-dependencies] serde_json = "1.0" rand_xorshift = "0.2" +rand_isaac = "0.2" ### Uncomment this line before running benchmarks. ### We can't just let this uncommented because that would break ### compilation for #[no-std] because of the terrible Cargo bug diff --git a/benches/core/matrix.rs b/benches/core/matrix.rs index 12fb836d..ac983ff4 100644 --- a/benches/core/matrix.rs +++ b/benches/core/matrix.rs @@ -1,5 +1,6 @@ use na::{DMatrix, DVector, Matrix2, Matrix3, Matrix4, MatrixN, Vector2, Vector3, Vector4, U10}; -use rand::{IsaacRng, Rng}; +use rand::Rng; +use rand_isaac::IsaacRng; use std::ops::{Add, Div, Mul, Sub}; #[path = "../common/macros.rs"] @@ -237,4 +238,4 @@ criterion_group!(matrix, mat_mul_mat, mat100_from_fn, mat500_from_fn, -); \ No newline at end of file +); diff --git a/benches/core/vector.rs b/benches/core/vector.rs index 7d3237e8..fd44aedc 100644 --- a/benches/core/vector.rs +++ b/benches/core/vector.rs @@ -1,5 +1,6 @@ use na::{DVector, Vector2, Vector3, Vector4, VectorN}; -use rand::{IsaacRng, Rng}; +use rand::Rng; +use rand_isaac::IsaacRng; use std::ops::{Add, Div, Mul, Sub}; use typenum::U10000; diff --git a/benches/geometry/quaternion.rs b/benches/geometry/quaternion.rs index dd079aac..326872f3 100644 --- a/benches/geometry/quaternion.rs +++ b/benches/geometry/quaternion.rs @@ -1,5 +1,6 @@ use na::{Quaternion, UnitQuaternion, Vector3}; -use rand::{IsaacRng, Rng}; +use rand::Rng; +use rand_isaac::IsaacRng; use std::ops::{Add, Div, Mul, Sub}; #[path = "../common/macros.rs"] @@ -34,4 +35,4 @@ criterion_group!(quaternion, quaternion_div_s, quaternion_inv, unit_quaternion_inv -); \ No newline at end of file +); diff --git a/benches/lib.rs b/benches/lib.rs index d5333542..e4215a12 100644 --- a/benches/lib.rs +++ b/benches/lib.rs @@ -3,6 +3,7 @@ extern crate nalgebra as na; extern crate rand; +extern crate rand_isaac; extern crate test; extern crate typenum; @@ -10,7 +11,8 @@ extern crate typenum; extern crate criterion; use na::DMatrix; -use rand::{IsaacRng, Rng}; +use rand::Rng; +use rand_isaac::IsaacRng; pub mod core; pub mod geometry; @@ -36,4 +38,4 @@ criterion_main!( linalg::solve, linalg::svd, linalg::symmetric_eigen, -); \ No newline at end of file +);