pub trait ScientificRandomExt<A, D: Dimension> {
// Required methods
fn dirichlet<R>(shape: D, alpha: &[f64], rng: &mut Random<R>) -> Self
where A: From<f64>,
R: Rng;
fn von_mises<R>(shape: D, mu: f64, kappa: f64, rng: &mut Random<R>) -> Self
where A: From<f64>,
R: Rng;
fn multivariate_normal<R>(
mean: Vec<f64>,
covariance: Vec<Vec<f64>>,
n_samples: usize,
rng: &mut Random<R>,
) -> Array<A, Ix2>
where A: From<f64>,
R: Rng;
fn categorical<R, T>(
shape: D,
choices: &[T],
probabilities: &[f64],
rng: &mut Random<R>,
) -> Array<T, D>
where T: Clone,
R: Rng;
fn correlated_normal<R>(
shape: D,
correlation_matrix: &Array<f64, Ix2>,
rng: &mut Random<R>,
) -> Self
where A: From<f64>,
R: Rng;
fn sparse<R, Dist>(
shape: D,
density: f64,
distribution: Dist,
rng: &mut Random<R>,
) -> Self
where A: Clone + Default,
R: Rng,
Dist: Distribution<A>;
}Expand description
Scientific computing specific random array extensions
Required Methods§
Sourcefn dirichlet<R>(shape: D, alpha: &[f64], rng: &mut Random<R>) -> Self
fn dirichlet<R>(shape: D, alpha: &[f64], rng: &mut Random<R>) -> Self
Generate random array from Dirichlet distribution
Sourcefn von_mises<R>(shape: D, mu: f64, kappa: f64, rng: &mut Random<R>) -> Self
fn von_mises<R>(shape: D, mu: f64, kappa: f64, rng: &mut Random<R>) -> Self
Generate random array from Von Mises distribution (circular)
Sourcefn multivariate_normal<R>(
mean: Vec<f64>,
covariance: Vec<Vec<f64>>,
n_samples: usize,
rng: &mut Random<R>,
) -> Array<A, Ix2>
fn multivariate_normal<R>( mean: Vec<f64>, covariance: Vec<Vec<f64>>, n_samples: usize, rng: &mut Random<R>, ) -> Array<A, Ix2>
Generate multivariate normal samples
Sourcefn categorical<R, T>(
shape: D,
choices: &[T],
probabilities: &[f64],
rng: &mut Random<R>,
) -> Array<T, D>
fn categorical<R, T>( shape: D, choices: &[T], probabilities: &[f64], rng: &mut Random<R>, ) -> Array<T, D>
Generate samples from categorical distribution
Generate correlated random arrays using Cholesky decomposition
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.