Contents Previous Next Subchapters Current Chapters-> kron inv trace det logdet rank cond null orth pinv cholesky lu svd qr qred eigen geneig eigsym symeig schur levinson tridiag BlockTriDiag Parent Chapters-> Omatrix6 linear geneig Search Tools-> contents reference index search

Generalized Eigenvalues and Eigenvectors of a General Matrix
 Syntax `lam = geneig(`A`, `B`)` `[`E`, `Lam`] = geneig(`A`, `B` )` `[`E`, `Alp`, `Beta`] = geneig(`A`, `B` )` See Also eig , eigen , svd

Description
Computes the generalized eigenvalues of the matrix pair A, B, where a and b are square real, double-precision or complex matrix. The matrices A and B must have the same dimension. ``` ```The return value `lam` is a complex column vector, with the same row dimension as A, containing the generalized eigenvalues. ``` ```The return value Lam is a complex diagonal matrix with the same dimensions as A and with the generalized eigenvalues along its diagonal. ``` ```The return values Alp and Beta are a complex diagonal matrices with the same dimensions as A and with ```      Beta * Lam = Alp ```This is a more stable form for representing the generalized eigenvalues. ``` ```The return value E is a matrix with the same dimensions as A and with each of its columns corresponding to a generalized eigenvector. For each eigenvector is scaled so that its Euclidean norm is one; i.e., for each `i`, ```             __________________________      1 =   /       2                2          \/ E(i, 1)  + ... + E(i, n) ```where n is the row dimension of A. ``` ```The return values satisfy the following two equations ```             A * E = B * E * Lam      A * E * Beta = B * E * Alp  ```and the vector lam is equal to the diagonal of Lam.

Example
If you enter ```      A        = {[1., 2.], [3., 4.]}      B        = identity(2)      [E, Lam] = geneig(A, B)      print E, Lam ``` O-Matrix will respond ```      {      [ (0.824565,0) , (0.415974,0) ]      [ (-0.565767,0) , (0.909377,0) ]      }      {      [ (-0.372281,0) , (0,0) ]      [ (0,0) , (5.37228,0) ]      } ``` Note that coercion converted the argument B from an integer matrix to a real matrix before the calculation was done.

Mlmode
In Mlmode , this function is called `eig` instead of `geneig`. If in Mlmode you enter ```      A      = {[1., 2.], [3., 4.]}      B      = eye(2)      [E, Lam] = eig(A, B)      E, Lam ``` O-Matrix will respond ```      {      [ (0.824565,0) , (0.415974,0) ]      [ (-0.565767,0) , (0.909377,0) ]      }      {      [ (-0.372281,0) , (0,0) ]      [ (0,0) , (5.37228,0) ]      } ```