use rand::{
distributions::{Distribution, Standard},
Rng,
};
pub trait UniformRand: Sized {
fn rand<R: Rng + ?Sized>(rng: &mut R) -> Self;
}
impl<T> UniformRand for T
where
Standard: Distribution<T>,
{
#[inline]
fn rand<R: Rng + ?Sized>(rng: &mut R) -> Self {
rng.sample(Standard)
}
}
pub fn test_rng() -> rand::rngs::StdRng {
use rand::SeedableRng;
let seed = [
1, 0, 0, 0, 23, 0, 0, 0, 200, 1, 0, 0, 210, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
];
rand::rngs::StdRng::from_seed(seed)
}