Trait RandomMatrix

Source
pub trait RandomMatrix
where Self: Scalar + Lapack,
{ // Required method fn random_gaussian<R: Rng>( dimension: (usize, usize), rng: &mut R, ) -> Array2<Self>; // Provided methods fn random_orthogonal_matrix<R: Rng>( dimension: (usize, usize), rng: &mut R, ) -> Array2<Self> { ... } fn random_approximate_low_rank_matrix<R: Rng>( dimension: (usize, usize), sigma_max: f64, sigma_min: f64, rng: &mut R, ) -> Array2<Self> { ... } }

Required Methods§

Source

fn random_gaussian<R: Rng>( dimension: (usize, usize), rng: &mut R, ) -> Array2<Self>

Generate a random Gaussian matrix.

§Arguments
  • dimension: Tuple (rows, cols) specifying the number of rows and columns.
  • rng: The random number generator to use.

Provided Methods§

Source

fn random_orthogonal_matrix<R: Rng>( dimension: (usize, usize), rng: &mut R, ) -> Array2<Self>

Generate a random matrix with orthogonal rows or columns.

This function creates a normally distributed (m, n) random matrix, orthogonalizes it and returns the resulting orthogonal matrix.

If m > n then the returned matrix has orthogonal columns. If n > m the returned matrix has orthogonalized rows.

§Arguments
  • dimension: Tuple (rows, cols) specifying the number of rows and columns.
  • rng: The random number generator to use.
Source

fn random_approximate_low_rank_matrix<R: Rng>( dimension: (usize, usize), sigma_max: f64, sigma_min: f64, rng: &mut R, ) -> Array2<Self>

Generate a random approximate low-rank matrix.

This function generates a random approximate low-rank matrix with singular values logarithmically distributed between ’sigma_maxandsigma_min`.

§Arguments
  • dimension: Tuple (rows, cols) specifying the number of rows and columns.
  • sigma_max: Maximum singular value.
  • sigma_min: Minimum singular value.
  • rng: The random number generator to use.

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.

Implementations on Foreign Types§

Source§

impl RandomMatrix for f32

Source§

fn random_gaussian<R: Rng>( dimension: (usize, usize), rng: &mut R, ) -> Array2<f32>

Source§

impl RandomMatrix for f64

Source§

fn random_gaussian<R: Rng>( dimension: (usize, usize), rng: &mut R, ) -> Array2<f64>

Source§

impl RandomMatrix for Complex<f32>

Source§

fn random_gaussian<R: Rng>( dimension: (usize, usize), rng: &mut R, ) -> Array2<Complex<f32>>

Source§

impl RandomMatrix for Complex<f64>

Source§

fn random_gaussian<R: Rng>( dimension: (usize, usize), rng: &mut R, ) -> Array2<Complex<f64>>

Implementors§