pub fn try_new(mut a: OMatrix<T, D, D>, mut b: OMatrix<T, D, D>) -> Option<Self> {
        assert!(
            a.is_square() && b.is_square(),
            "Unable to compute the generalized eigenvalues of non-square matrices."
        );

        assert!(
            a.shape_generic() ==  b.shape_generic(),
            "Unable to compute the generalized eigenvalues of two square matrices of different dimensions."
        );

        let (nrows, ncols) = a.shape_generic();
        let n = nrows.value();

        let mut info = 0;

        let mut alphar = Matrix::zeros_generic(nrows, Const::<1>);
        let mut alphai = Matrix::zeros_generic(nrows, Const::<1>);
        let mut beta = Matrix::zeros_generic(nrows, Const::<1>);
        let mut vsl = Matrix::zeros_generic(nrows, ncols);
        let mut vsr = Matrix::zeros_generic(nrows, ncols);

        let lwork = T::xggev_work_size(
            b'V',
            b'V',
            n as i32,
            a.as_mut_slice(),
            n as i32,
            b.as_mut_slice(),
            n as i32,
            alphar.as_mut_slice(),
            alphai.as_mut_slice(),
            beta.as_mut_slice(),
            vsl.as_mut_slice(),
            n as i32,
            vsr.as_mut_slice(),
            n as i32,
            &mut info,
        );
        lapack_check!(info);

        let mut work = vec![T::zero(); lwork as usize];

        T::xggev(
            b'V',
            b'V',
            n as i32,
            a.as_mut_slice(),
            n as i32,
            b.as_mut_slice(),
            n as i32,
            alphar.as_mut_slice(),
            alphai.as_mut_slice(),
            beta.as_mut_slice(),
            vsl.as_mut_slice(),
            n as i32,
            vsr.as_mut_slice(),
            n as i32,
            &mut work,
            lwork,
            &mut info,
        );
        lapack_check!(info);

        Some(GeneralizedEigen {
            alphar,
            alphai,
            beta,
            vsl,
            vsr,
        })
    }
/// Attempts to compute the generalized eigenvalues (and eigenvectors) via the raw returns from LAPACK's
/// dggev and sggev routines
///
/// Returns `None` if the method did not converge.
Attempts to compute the generalized eigenvalues (and eigenvectors) via the raw returns from LAPACK's
dggev and sggev routines

Returns `None` if the method did not converge.
Attempts to compute the generalized eigenvalues ( and eigenvectors ) via the raw returns from LAPACK ' s dggev and sggev routines Returns ` None ` if the method did not converge .
pub fn try_new(mut a: OMatrix<T, D, D>, mut b: OMatrix<T, D, D>) -> Option<Self> {
        assert!(
            a.is_square() && b.is_square(),
            "Unable to compute the generalized eigenvalues of non-square matrices."
        );
        assert!(
            a.shape_generic() ==  b.shape_generic(),
            "Unable to compute the generalized eigenvalues of two square matrices of different dimensions."
        );
        let (nrows, ncols) = a.shape_generic();
        let n = nrows.value();
        let mut info = 0;
        let mut alphar = Matrix::zeros_generic(nrows, Const::<1>);
        let mut alphai = Matrix::zeros_generic(nrows, Const::<1>);
        let mut beta = Matrix::zeros_generic(nrows, Const::<1>);
        let mut vsl = Matrix::zeros_generic(nrows, ncols);
        let mut vsr = Matrix::zeros_generic(nrows, ncols);
        let lwork = T::xggev_work_size(
            b'V',
            b'V',
            n as i32,
            a.as_mut_slice(),
            n as i32,
            b.as_mut_slice(),
            n as i32,
            alphar.as_mut_slice(),
            alphai.as_mut_slice(),
            beta.as_mut_slice(),
            vsl.as_mut_slice(),
            n as i32,
            vsr.as_mut_slice(),
            n as i32,
            &mut info,
        );
        lapack_check!(info);
        let mut work = vec![T::zero(); lwork as usize];
        T::xggev(
            b'V',
            b'V',
            n as i32,
            a.as_mut_slice(),
            n as i32,
            b.as_mut_slice(),
            n as i32,
            alphar.as_mut_slice(),
            alphai.as_mut_slice(),
            beta.as_mut_slice(),
            vsl.as_mut_slice(),
            n as i32,
            vsr.as_mut_slice(),
            n as i32,
            &mut work,
            lwork,
            &mut info,
        );
        lapack_check!(info);
        Some(GeneralizedEigen {
            alphar,
            alphai,
            beta,
            vsl,
            vsr,
        })
    }
pub fn try_new ( mut a : OMatrix < T , D , D > , mut b : OMatrix < T , D , D > ) -> Option < Self > { assert ! ( a is_square ( ) b is_square ( ) " " ) ; assert ! ( a shape_generic ( ) b shape_generic ( ) " " ) ; let ( nrows , ncols ) = a . shape_generic ( ) ; let n = nrows . value ( ) ; let mut info = 0 ; let mut alphar = Matrix :: zeros_generic ( nrows , Const :: < 1 > ) ; let mut alphai = Matrix :: zeros_generic ( nrows , Const :: < 1 > ) ; let mut beta = Matrix :: zeros_generic ( nrows , Const :: < 1 > ) ; let mut vsl = Matrix :: zeros_generic ( nrows , ncols ) ; let mut vsr = Matrix :: zeros_generic ( nrows , ncols ) ; let lwork = T :: xggev_work_size ( b'V' , b'V' , n as i32 , a . as_mut_slice ( ) , n as i32 , b . as_mut_slice ( ) , n as i32 , alphar . as_mut_slice ( ) , alphai . as_mut_slice ( ) , beta . as_mut_slice ( ) , vsl . as_mut_slice ( ) , n as i32 , vsr . as_mut_slice ( ) , n as i32 , & mut info , ) ; lapack_check ! ( info ) ; let mut work = vec ! [ T zero ( ) lwork as usize ] ; T :: xggev ( b'V' , b'V' , n as i32 , a . as_mut_slice ( ) , n as i32 , b . as_mut_slice ( ) , n as i32 , alphar . as_mut_slice ( ) , alphai . as_mut_slice ( ) , beta . as_mut_slice ( ) , vsl . as_mut_slice ( ) , n as i32 , vsr . as_mut_slice ( ) , n as i32 , & mut work , lwork , & mut info , ) ; lapack_check ! ( info ) ; Some ( GeneralizedEigen { alphar , alphai , beta , vsl , vsr , } ) }
Attempts to compute the generalized eigenvalues (and eigenvectors) via the raw returns from LAPACK's
dggev and sggev routines
Attempts to compute the generalized eigenvalues ( and eigenvectors ) via the raw returns from LAPACK ' s dggev and sggev routines
a
OMatrix<T, D, D>
b
OMatrix<T, D, D>
a
OMatrix<T, D, D>
b
OMatrix<T, D, D>