pub trait DistributionExt<T>: Sized + Distribution<T> {
// Provided methods
fn random_array<R, Dim>(
&self,
rng: &mut Random<R>,
shape: Dim,
) -> ArrayBase<OwnedRepr<T>, Dim>
where R: Rng,
Dim: Dimension,
Self: Copy { ... }
fn sample_vec<R>(&self, rng: &mut Random<R>, size: usize) -> Vec<T>
where R: Rng,
Self: Copy { ... }
}Expand description
Extension trait for distributions to create arrays directly
This provides a consistent interface for generating random arrays across the SCIRS2 ecosystem.
Provided Methods§
Sourcefn random_array<R, Dim>(
&self,
rng: &mut Random<R>,
shape: Dim,
) -> ArrayBase<OwnedRepr<T>, Dim>
fn random_array<R, Dim>( &self, rng: &mut Random<R>, shape: Dim, ) -> ArrayBase<OwnedRepr<T>, Dim>
Create a random array with values from this distribution
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".