packages

linalg::factor::eig

On this page

General real eigenproblem: Householder reduction to upper Hessenberg form (orthes), then the Francis double-shift QR iteration to real Schur form (hqr2), as in EISPACK and JAMA. Eigenvectors come from back substitution on the quasi-triangular factor. Backward stable for the Schur form; eigenvectors of ill-conditioned eigenvalues are only as good as their conditioning allows. About 25n^3 with vectors.

Structs

EigSource

pub struct Eig<T>

The eigenvalues and eigenvectors of a real square matrix: A v_j = w_j v_j. Complex eigenvalues come in conjugate pairs, the one with positive imaginary part first; each vector has unit 2-norm.

nabi
use core::array::Matrix;

let r: Matrix<f64> = [[0, -1], [1, 0]];   // a quarter turn
let e = try linalg::eig(r);
let w = e.values();
assert(w[0].re.abs() < 1e-12 && (w[0].im - 1.0).abs() < 1e-12);
  • pub fn values(self) -> Vector<Complex<T>>§

    Source

    The eigenvalues, in the order the QR iteration finds them.

  • pub fn vectors(self) -> Matrix<Complex<T>>§

    Source

    The eigenvectors: column j belongs to values()[j].

SchurSource

pub struct Schur<T>

The real Schur form A = Z T Z^T: Z orthogonal, T upper quasi-triangular with a 1 x 1 block per real eigenvalue and a 2 x 2 block per complex pair.

nabi
use core::array::Matrix;

let a: Matrix<f64> = [[1, 2], [0, 3]];
let s = try linalg::schur(a);
assert(s.t()[1, 0] == 0.0);
  • pub fn t(self) -> Matrix<T>§

    Source

    The quasi-triangular factor T.

  • pub fn z(self) -> Matrix<T>§

    Source

    The orthogonal factor Z.

  • pub fn values(self) -> Vector<Complex<T>>§

    Source

    The eigenvalues, from the diagonal blocks of T.