pub fn random_regular<A>(n: usize) -> Array2<A>
where
    A: Scalar + Lapack,
{
    let a: Array2<A> = random((n, n));
    let (q, mut r) = a.qr_into().unwrap();
    for i in 0..n {
        r[(i, i)] = A::one() + A::from_real(r[(i, i)].abs());
    }
    q.dot(&r)
}
/// Generate random regular matrix
///
/// Be sure that this it **NOT** a uniform distribution. Use it only for test purpose.
Generate random regular matrix
Be sure that this it **NOT** a uniform distribution. Use it only for test purpose.
Generate random regular matrix Be sure that this it ** NOT ** a uniform distribution . Use it only for test purpose .
pub fn random_regular<A>(n: usize) -> Array2<A>
where
    A: Scalar + Lapack,
{
    let a: Array2<A> = random((n, n));
    let (q, mut r) = a.qr_into().unwrap();
    for i in 0..n {
        r[(i, i)] = A::one() + A::from_real(r[(i, i)].abs());
    }
    q.dot(&r)
}
pub fn random_regular < A > ( n : usize ) -> Array2 < A > where A : Scalar + Lapack , { let a : Array2 < A > = random ( ( n , n ) ) ; let ( q , mut r ) = a . qr_into ( ) . unwrap ( ) ; for i in 0 .. n { r [ ( i , i ) ] = A :: one ( ) + A :: from_real ( r [ ( i , i ) ] . abs ( ) ) ; } q . dot ( & r ) }
Generate random regular matrix
Be sure that this it **NOT** a uniform distribution.
Generate random regular matrix Be sure that this it ** NOT ** a uniform distribution .
n
usize
n
usize