pub trait OptimizedArrayRandom<T, D>where
D: Dimension,{
// Required methods
fn random_bulk<R, Dist>(
shape: D,
distribution: Dist,
rng: &mut Random<R>,
) -> Self
where R: Rng,
Dist: Distribution<T> + Copy;
fn random_using_bulk<R, F>(shape: D, rng: &mut Random<R>, f: F) -> Self
where R: Rng,
F: FnMut(&mut Random<R>) -> T;
}Expand description
Trait for optimized random array generation
This trait provides bulk array generation methods that use a single RNG instance for all elements, dramatically improving performance compared to RNG-per-element approaches.
Required Methods§
Sourcefn random_bulk<R, Dist>(
shape: D,
distribution: Dist,
rng: &mut Random<R>,
) -> Self
fn random_bulk<R, Dist>( shape: D, distribution: Dist, rng: &mut Random<R>, ) -> Self
Generate a random array using a single RNG instance (bulk operation)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.