• EigenSolver

EigenSolver

Compute eigenvalues and eigenvectors of a regular square matrix using the classical algorithm (lapack function GEEV).

Computing for type matrix<double>

bool  matrix::EigenSolver(
   ENUM_EIG_VECTORS       jobv,     // compute left and right vectors
   vector                 EV,       // vector of computed eigenvalues
   matrix                 VL,       // VL matrix of computed left vectors
   matrix                 VR        // VR matrix of computed right vectors
   );

Computing for type matrix<complex>

bool  matrix::EigenSolver(
   ENUM_EIG_VECTORS       jobv,     // compute left and right vectors
   vectorc                EV,       // vector of computed eigenvalues
   matrixc                VL,       // VL matrix of computed left vectors
   matrixc                VR        // VR matrix of computed right vectors  
   );

Parameters

jobv

[in] ENUM_EIG_VECTORS enumeration value which determines the method for computing left and right eigenvectors.

EV

[out] Vector of eigenvalues.

VL

[out] Matrix of left eigenvectors.

VR

[out] Matrix of right eigenvectors.

Return Value

Return true if successful, otherwise false in case of an error.

Note

Computation depends on the value of the jobv parameter.

If EIGVECTORS_N is set, the left and right vectors are not computed. Only eigenvalues are computed.

With EIGVECTORS_L, only left eigenvectors are computed, right eigenvectors are not computed.

When EIGVECTORS_R is set, only the right eigenvectors are computed, the left vectors are not computed.

With EIGVECTORS_LR, the left and right eigenvectors are computed, Eigenvalues are always computed.

Real (non-complex) matrices can have a complex solution. Therefore, the input vector of eigenvalues must be complex. In case of a complex solution, the error code is set to 4019 (ERR_MATH_OVERFLOW). Otherwise, only the real parts of the complex values of the eigenvalue vector should be used.

ENUM_EIG_VECTORS

An enumeration that specifies whether to calculate eigenvectors.

ID

Description

EIGVECTORS_N

Only eigenvalues are calculated, without vectors.

EIGVECTORS_L

Only left eigenvectors are computed.

EIGVECTORS_R

Only the right eigenvectors are computed.

EIGVECTORS_LR

Left and right eigenvectors are computed, eigenvalues are always computed.