pub fn lapack_dgeevx(balance: DgeevxBalance, a: &Matrix) -> Result<DgeevxResult>Expand description
Eigenvalues and left and right eigenvectors of a general real matrix,
“expert” version (igraph_lapack_dgeevx): it also balances the matrix
(see DgeevxBalance) and computes reciprocal condition numbers of the
eigenvalues.
Binds igraph_lapack_dgeevx.
The reciprocal condition numbers of the eigenvectors (rcondv) are not
computed: igraph 1.0.0 and 1.0.1 allocate too small an integer workspace for them.
use igraph::{linalg::*, prelude::*};
let a = Matrix::from_rows(&[[1.0, 1e4], [1e-4, 1.0]]).unwrap();
let r = lapack_dgeevx(DgeevxBalance::Both, &a).unwrap();
let mut re = r.eigen.values_real.clone();
re.sort_by(f64::total_cmp);
assert!((re[0] - 0.0).abs() < 1e-9 && (re[1] - 2.0).abs() < 1e-9);
assert!(r.rconde.iter().all(|&c| c > 0.0 && c <= 1.0 + 1e-12));