Skip to content

Bump rand from 0.8 to 0.9 #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lax/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ intel-mkl-system = ["intel-mkl-src/mkl-dynamic-lp64-seq"]

[dependencies]
thiserror = "2.0.0"
cauchy = "0.4.0"
cauchy = {git="https://github.com/Dirreke/cauchy.git", branch="bump-rand"}
num-traits = "0.2.14"
lapack-sys = "0.15.0"
katexit = "0.1.2"
Expand Down
8 changes: 4 additions & 4 deletions ndarray-linalg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ intel-mkl-static = ["lax/intel-mkl-static"]
intel-mkl-system = ["lax/intel-mkl-system"]

[dependencies]
cauchy = "0.4.0"
cauchy = {git="https://github.com/Dirreke/cauchy.git", branch="bump-rand"}
katexit = "0.1.2"
num-complex = "0.4.0"
num-complex = {git="https://github.com/Dirreke/num-complex.git", branch="bump-rand"}
num-traits = "0.2.14"
rand = "0.8.3"
rand = "0.9"
thiserror = "2.0.0"

[dependencies.ndarray]
Expand All @@ -52,7 +52,7 @@ paste = "1.0.5"
criterion = "0.5.1"
# Keep the same version as ndarray's dependency!
approx = { version = "0.5", features = ["num-complex"] }
rand_pcg = "0.3.1"
rand_pcg = "0.9"

[[bench]]
name = "truncated_eig"
Expand Down
22 changes: 11 additions & 11 deletions ndarray-linalg/src/generate.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Generator functions for matrices

use ndarray::*;
use rand::prelude::*;
use rand::Rng;

use super::convert::*;
use super::error::*;
Expand All @@ -24,7 +24,7 @@

/// Generate random array with given shape
///
/// - This function uses [rand::thread_rng].
/// - This function uses [rand::rng].
/// See [random_using] for using another RNG
pub fn random<A, S, Sh, D>(sh: Sh) -> ArrayBase<S, D>
where
Expand All @@ -33,7 +33,7 @@
D: Dimension,
Sh: ShapeBuilder<Dim = D>,
{
let mut rng = thread_rng();
let mut rng = rand::rng();
random_using(sh, &mut rng)
}

Expand All @@ -55,13 +55,13 @@
///
/// - Be sure that this it **NOT** a uniform distribution.
/// Use it only for test purpose.
/// - This function uses [rand::thread_rng].
/// - This function uses [rand::rng].
/// See [random_unitary_using] for using another RNG.
pub fn random_unitary<A>(n: usize) -> Array2<A>
where
A: Scalar + Lapack,
{
let mut rng = thread_rng();
let mut rng = rand::rng();

Check warning on line 64 in ndarray-linalg/src/generate.rs

View check run for this annotation

Codecov / codecov/patch

ndarray-linalg/src/generate.rs#L64

Added line #L64 was not covered by tests
random_unitary_using(n, &mut rng)
}

Expand All @@ -84,13 +84,13 @@
///
/// - Be sure that this it **NOT** a uniform distribution.
/// Use it only for test purpose.
/// - This function uses [rand::thread_rng].
/// - This function uses [rand::rng].
/// See [random_regular_using] for using another RNG.
pub fn random_regular<A>(n: usize) -> Array2<A>
where
A: Scalar + Lapack,
{
let mut rng = rand::thread_rng();
let mut rng = rand::rng();

Check warning on line 93 in ndarray-linalg/src/generate.rs

View check run for this annotation

Codecov / codecov/patch

ndarray-linalg/src/generate.rs#L93

Added line #L93 was not covered by tests
random_regular_using(n, &mut rng)
}

Expand All @@ -114,14 +114,14 @@

/// Random Hermite matrix
///
/// - This function uses [rand::thread_rng].
/// - This function uses [rand::rng].
/// See [random_hermite_using] for using another RNG.
pub fn random_hermite<A, S>(n: usize) -> ArrayBase<S, Ix2>
where
A: Scalar,
S: DataOwned<Elem = A> + DataMut,
{
let mut rng = rand::thread_rng();
let mut rng = rand::rng();

Check warning on line 124 in ndarray-linalg/src/generate.rs

View check run for this annotation

Codecov / codecov/patch

ndarray-linalg/src/generate.rs#L124

Added line #L124 was not covered by tests
random_hermite_using(n, &mut rng)
}

Expand All @@ -147,15 +147,15 @@
/// Random Hermite Positive-definite matrix
///
/// - Eigenvalue of matrix must be larger than 1 (thus non-singular)
/// - This function uses [rand::thread_rng].
/// - This function uses [rand::rng].
/// See [random_hpd_using] for using another RNG.
///
pub fn random_hpd<A, S>(n: usize) -> ArrayBase<S, Ix2>
where
A: Scalar,
S: DataOwned<Elem = A> + DataMut,
{
let mut rng = rand::thread_rng();
let mut rng = rand::rng();

Check warning on line 158 in ndarray-linalg/src/generate.rs

View check run for this annotation

Codecov / codecov/patch

ndarray-linalg/src/generate.rs#L158

Added line #L158 was not covered by tests
random_hpd_using(n, &mut rng)
}

Expand Down