/// Computes the QR factorization of a matrix.
Computes the QR factorization of a matrix.
Computes the QR factorization of a matrix .
pub fn geqrf<A, S>(a: &mut ArrayBase<S, Ix2>) -> Array1<A>
where
    A: Scalar + Div<<A as Scalar>::Real, Output = A> + MulAssign<<A as Scalar>::Real>,
    S: DataMut<Elem = A>,
{
    let min_dim = cmp::min(a.nrows(), a.ncols());
    let mut tau = Array1::<A>::zeros(min_dim);
    for i in 0..min_dim {
        let bottom = a.nrows();
        let (beta, _, t) = lapack::larfg(a[(i, i)], a.column_mut(i).slice_mut(s![i + 1..bottom]));
        tau[i] = t;
        if i < a.ncols() {
            a[(i, i)] = A::one();
            let v = a.column(i).slice(s![i..]).to_owned();
            lapack::larf::left(&v, t.conj(), &mut a.slice_mut(s![i.., i + 1..]));
            a[(i, i)] = beta.into();
        }
    }
    tau
}
pub fn geqrf < A , S > ( a : & mut ArrayBase < S , Ix2 > ) -> Array1 < A > where A : Scalar + Div < < A as Scalar > :: Real , Output = A > + MulAssign < < A as Scalar > :: Real > , S : DataMut < Elem = A > , { let min_dim = cmp :: min ( a . nrows ( ) , a . ncols ( ) ) ; let mut tau = Array1 :: < A > :: zeros ( min_dim ) ; for i in 0 .. min_dim { let bottom = a . nrows ( ) ; let ( beta , _ , t ) = lapack :: larfg ( a [ ( i , i ) ] , a . column_mut ( i ) . slice_mut ( s ! [ i 1 bottom ] ) ) ; tau [ i ] = t ; if i < a . ncols ( ) { a [ ( i , i ) ] = A :: one ( ) ; let v = a . column ( i ) . slice ( s ! [ i ] ) . to_owned ( ) ; lapack :: larf :: left ( & v , t . conj ( ) , & mut a . slice_mut ( s ! [ i i 1 ] ) ) ; a [ ( i , i ) ] = beta . into ( ) ; } } tau }
Computes the QR factorization of a matrix.
Computes the QR factorization of a matrix .
a
&mut ArrayBase<S, Ix2>