You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > Matrix Structure > Matrix Methods > Eig Method > Matrix.Eig Method (TVec, TMtxType)
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
Matrix.Eig Method (TVec, TMtxType)

Calculates matrix eigenvalues and eigenvectors.

Syntax
C#
Visual Basic
public TMtx Eig(TVec D, TMtxType MtxType);

Calculates the eigenvalues (stored in vector D elements) and optionally the eigenvectors (stored in matrix the columns of matrices VL and VR) of the calling matrix. The MtxType parameter indicates the calling matrix TMtxType. Depending the type of the calling matrix the Eig method will use specific optimized algorithm. If you don't know the type of the calling matrix, you can not omit the MtxType parameter. To determine the type of matrix use the DetectMtxType method, or set AutoMtxType property to True. 

Depending on the MtxType parameter, the following algorithms will be used : 

1) for symmetric positive definite matrix (mtSymPosDef, mtHermPosDef): a) reduce the calling matrix to tridiagonal form A=Q*T*Q' b) generate matrix Q c) find eigenvalues and eigenvectors of the tridiagonal matrix T. 

2) for symmetric or hermitian matrix (mtSymetric, mtHermitian): a) reduce the calling matrix to tridiagonal form A=Q*T*Q' b) generate matrix Q c) find eigenvalues and eigenvectors of the tridiagonal matrix T. 

3) for general matrix (mtGeneral): A) VectorForm = vfEig: a) perform full balance of the calling matrix b) reduce the calling matrix to Hessenberg form A=Q*H*Q' c) generate matrix Q d) find eigenvalues and left and/or right eigenvectors. e) transform eigenvectors of the balanced matrix back to those of the original matrix. B) VectorForm = vfSchur: a) perform user defined balance of the calling matrix b) reduce the calling matrix to Hessenberg form A=Q*H*Q' c) generate matrix Q d) Find the real Schur form and optionally the eigenvectors Z*T*Z'. Matrix T is the real Schur form and Z are the eigen vectors. e) transform the eigenvectors of the balanced matrix to those of the original matrix. Matrix is in real Schur form, if it is upper quasi-triangular with 1-by-1 and 2-by-2 blocks. 2-by-2 blocks are standardized in the form 

 

[ a b ] [ c a ]

 

where b*c < 0. The eigenvalues of such a block are: a +/- sqrt(bc). 

Note The calling matrix Quadratic property must be true, otherwise an exception is raised. 

This overloaded version calculates the calling matrix eigenvalues and stores them in the vector D. The Vector.Complex and Vector.Length properties of the vector D are adjusted automatically. The MtxType parameter specifies the calling TMtxType. If MtxType parameter is omitted, the default value mtGeneral (general matrix) will be used, but for symmetric matrices the matrix type has to be specified explicitly, because the algorithm for general matrices will fail on the symmetric matrix. The matrix Q is not explicitly generated.

var D: Vector; A,V: Matrix; begin A.SetIt(2,2,False,[1,2, 2,4]); // 2x2, real matrix A.Eig(D,mtSymmetric); // or if eigenvectors are also required A.Eig(V,D,nil,mtSymmetric); // get left eigenvectors end;
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!