TMtx::Eig Method

Overload List

#SignatureDescription
1TMtx *Eig(TVec *D, TMtxType MtxType = TMtxType::mtGeneral);Calculates matrix eigenvalues and eigenvectors.
2TMtx *Eig(TMtx *VL, TVec *D, TMtx *VR = null, TMtxType MtxType = TMtxType::mtGeneral, TVectorForm VectorForm = TVectorForm::vfEig, bool aExpand = true);Calculate the calling matrix eigenvalues and eigenvectors.
3void Eig(TVec *D, TMtx *VL, TMtx *VR);Computes the eigenvalues and left and right eigenvectors of A general matrix.
4void Eig(TVec *D, const TBalanceType Balance, TEigBalancing *BInfo = null, TVec *rconde = null, TVec *rcondv = null, TMtx *VL = null, TMtx *VR = null);Computes the eigenvalues and left and right eigenvectors of A general matrix.

Overload 1: TMtx *Eig(TVec *D, TMtxType MtxType = TMtxType::mtGeneral);

Calculates matrix eigenvalues and eigenvectors.

#NameTypeDescription
1DTVec *
2MtxType = TMtxType::mtGeneralTMtxType
Remarks:

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 TMtx::DetectMtxType method, or set TMtx::AutoMtxType property to True.

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

1) for symmetric positive definite matrix (mtSymPosDef, mtHermPosDef):

1. reduce the calling matrix to tridiagonal form A=Q*T*Q'. 2. generate matrix Q. 3. find eigenvalues and eigenvectors of the tridiagonal matrix T.

2) for symmetric or hermitian matrix (mtSymetric, mtHermitian):

1. reduce the calling matrix to tridiagonal form A=Q*T*Q'. 2. generate matrix Q. 3. find eigenvalues and eigenvectors of the tridiagonal matrix T.

3) for general matrix (mtGeneral):

  • VectorForm = vfEig: 1. perform full balance of the calling matrix, 2. reduce the calling matrix to Hessenberg form A=Q*H*Q', 3. generate matrix Q, 4. find eigenvalues and left and/or right eigenvectors, 5. transform eigenvectors of the balanced matrix back to those of the original matrix.
  • VectorForm = vfSchur: 1. perform user defined balance of the calling matrix, 2. reduce the calling matrix to Hessenberg form A=Q*H*Q', 3. generate matrix Q, 4. Find the real Schur form and optionally the eigenvectors Z*T*Z'. Matrix T is the real Schur form and Z are the eigenvectors. 5. 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 TMtx::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 TMtx::Complex and TMtx::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.

See Also: TMtx::EigGen
Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler

Overload 2: TMtx *Eig(TMtx *VL, TVec *D, TMtx *VR = null, TMtxType MtxType = TMtxType::mtGeneral, TVectorForm VectorForm = TVectorForm::vfEig, bool aExpand = true);

Calculate the calling matrix eigenvalues and eigenvectors.

#NameTypeDescription
1VLTMtx *
2DTVec *
3VR = nullTMtx *
4MtxType = TMtxType::mtGeneralTMtxType
5VectorForm = TVectorForm::vfEigTVectorForm
6aExpand = truebool
Remarks:

Store the eigenvalues in the vector D. The Complex and Length properties of the vector D are adjusted automatically. If VectorForm is vfEig, store the left eigenvectors in matrix VL and the right eigenvectors in the matrix VR. Either of the eigenvector matrices VL and VR can be nil to indicate that they are not required. If the are both nil, an exception is raised. In case of symmetric matrices only VL is checked. The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real and are stored in the columns of the VL and VR matrices. If VectorForm is vfSchur, it will store the real T form in the matrix VL and the eigenvectors Z in the matrix VR. VR can be nil, to indicate that eigenvectors are not required. If VL is nil an exception is raised. The Rows, Cols and Complex properties of matrices VR and VL 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.

Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler

Overload 3: void Eig(TVec *D, TMtx *VL, TMtx *VR);

Computes the eigenvalues and left and right eigenvectors of A general matrix.

#NameTypeDescription
1DTVec *
2VLTMtx *
3VRTMtx *
Remarks:

If VL and VR are not nil, corresponding left and right eigenvectors are computed. Does not work for symmetric matrices. Use EigSym for symmetric matrices.

Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler

Overload 4: void Eig(TVec *D, const TBalanceType Balance, TEigBalancing *BInfo = null, TVec *rconde = null, TVec *rcondv = null, TMtx *VL = null, TMtx *VR = null);

Computes the eigenvalues and left and right eigenvectors of A general matrix.

#NameTypeDescription
1DTVec *
2Balanceconst TBalanceType
3BInfo = nullTEigBalancing *
4rconde = nullTVec *
5rcondv = nullTVec *
6VL = nullTMtx *
7VR = nullTMtx *
Remarks:

If VL and VR are not nil, corresponding left and right eigenvectors are computed. Additionally balancing can be speicifed with Balance. The info about balancing performed is stored in TEigBalancing object. This object can be nil, if no balancing was requested or additional information about balancing is not needed. If assigned the rconde parameter contains reciprocal condition number of the j-th eigenvalue. These reciprocal condition numbers always lie between zero (very badly conditioned) and one (very well conditioned). If assigned the rcondv contains reciprocal condition number of the j-th right eigenvector. Does not work for symmetric matrices. Use EigSym for symmetric matrices.

Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler