/// Returns singular values ordered by magnitude with indices.
Returns singular values ordered by magnitude with indices.
Returns singular values ordered by magnitude with indices .
fn singular_values_with_indices(&self) -> (Array1<A>, Vec<usize>) {
        // numerate eigenvalues
        let mut a = self.eigvals.iter().enumerate().collect::<Vec<_>>();
        // sort by magnitude
        a.sort_by(|(_, x), (_, y)| x.partial_cmp(&y).unwrap().reverse());
        // calculate cut-off magnitude (borrowed from scipy)
        let cutoff = A::epsilon() * // float precision
                     A::correction() * // correction term (see trait below)
                     *a[0].1; // max eigenvalue
        // filter low singular values away
        let (values, indices): (Vec<A>, Vec<usize>) = a
            .into_iter()
            .filter(|(_, x)| *x > &cutoff)
            .map(|(a, b)| (b.sqrt(), a))
            .unzip();
        (Array1::from(values), indices)
    }
fn singular_values_with_indices ( & self ) -> ( Array1 < A > , Vec < usize > ) { // numerate eigenvalues let mut a = self . eigvals . iter ( ) . enumerate ( ) . collect :: < Vec < _ > > ( ) ; // sort by magnitude a . sort_by ( | ( _ , x ) , ( _ , y ) | x . partial_cmp ( & y ) . unwrap ( ) . reverse ( ) ) ; // calculate cut-off magnitude (borrowed from scipy) let cutoff = A :: epsilon ( ) * // float precision A :: correction ( ) * // correction term (see trait below) * a [ 0 ] . 1 ; // max eigenvalue // filter low singular values away let ( values , indices ) : ( Vec < A > , Vec < usize > ) = a . into_iter ( ) . filter ( | ( _ , x ) | * x > & cutoff ) . map ( | ( a , b ) | ( b . sqrt ( ) , a ) ) . unzip ( ) ; ( Array1 :: from ( values ) , indices ) }
Returns singular values ordered by magnitude with indices.
Returns singular values ordered by magnitude with indices .
&self