pub trait RandomMatrix where
    Self: Scalar + Lapack
{ fn random_gaussian<R: Rng>(
        dimension: (usize, usize),
        rng: &mut R
    ) -> Array2<Self>; 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

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

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.

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.

Implementations on Foreign Types

Implementors