naginterfaces.library.lapackeig.dggevx¶
- naginterfaces.library.lapackeig.dggevx(balanc, jobvl, jobvr, sense, a, b)[source]¶
dggevx
computes for a pair of real nonsymmetric matrices the generalized eigenvalues and, optionally, the left and/or right generalized eigenvectors using the algorithm.Optionally it also computes a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors, reciprocal condition numbers for the eigenvalues, and reciprocal condition numbers for the right eigenvectors.
For full information please refer to the NAG Library document for f08wb
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/f08/f08wbf.html
- Parameters
- balancstr, length 1
Specifies the balance option to be performed.
Do not diagonally scale or permute.
Permute only.
Scale only.
Both permute and scale.
Computed reciprocal condition numbers will be for the matrices after permuting and/or balancing.
Permuting does not change condition numbers (in exact arithmetic), but balancing does.
In the absence of other information, is recommended.
- jobvlstr, length 1
If , do not compute the left generalized eigenvectors.
If , compute the left generalized eigenvectors.
- jobvrstr, length 1
If , do not compute the right generalized eigenvectors.
If , compute the right generalized eigenvectors.
- sensestr, length 1
Determines which reciprocal condition numbers are computed.
None are computed.
Computed for eigenvalues only.
Computed for eigenvectors only.
Computed for eigenvalues and eigenvectors.
- afloat, array-like, shape
The matrix in the pair .
- bfloat, array-like, shape
The matrix in the pair .
- Returns
- afloat, ndarray, shape
has been overwritten. If or or both, then contains the first part of the real Schur form of the ‘balanced’ versions of the input and .
- bfloat, ndarray, shape
has been overwritten.
- alpharfloat, ndarray, shape
The element contains the real part of .
- alphaifloat, ndarray, shape
The element contains the imaginary part of .
- betafloat, ndarray, shape
, for , will be the generalized eigenvalues.
If is zero, then the th eigenvalue is real; if positive, then the th and st eigenvalues are a complex conjugate pair, with negative.
Note: the quotients and may easily overflow or underflow, and may even be zero.
Thus, you should avoid naively computing the ratio .
However, will always be less than and usually comparable with in magnitude, and will always be less than and usually comparable with .
- vlfloat, ndarray, shape
If , the left generalized eigenvectors are stored one after another in the columns of , in the same order as the corresponding eigenvalues. Each eigenvector will be scaled so the largest component will have .
If , is not referenced.
- vrfloat, ndarray, shape
If , the right generalized eigenvectors are stored one after another in the columns of , in the same order as the corresponding eigenvalues. Each eigenvector will be scaled so the largest component will have .
If , is not referenced.
- iloint
and are integer values such that and if and or .
If or , and .
- ihiint
and are integer values such that and if and or .
If or , and .
- lscalefloat, ndarray, shape
Details of the permutations and scaling factors applied to the left side of and .
If is the index of the row interchanged with row , and is the scaling factor applied to row , then:
, for ;
, for ;
, for .
The order in which the interchanges are made is to , then to .
- rscalefloat, ndarray, shape
Details of the permutations and scaling factors applied to the right side of and .
If is the index of the column interchanged with column , and is the scaling factor applied to column , then:
, for ;
if , for ;
if , for .
The order in which the interchanges are made is to , then to .
- abnrmfloat
The -norm of the balanced matrix .
- bbnrmfloat
The -norm of the balanced matrix .
- rcondefloat, ndarray, shape
If or , the reciprocal condition numbers of the eigenvalues, stored in consecutive elements of the array. For a complex conjugate pair of eigenvalues two consecutive elements of are set to the same value. Thus , , and the th columns of and all correspond to the th eigenpair.
If , is not referenced.
- rcondvfloat, ndarray, shape
If or , the estimated reciprocal condition numbers of the eigenvectors, stored in consecutive elements of the array. For a complex eigenvector two consecutive elements of are set to the same value.
If , is not referenced.
- Raises
- NagValueError
- (errno )
On entry, error in parameter .
Constraint: , , or .
- (errno )
On entry, error in parameter .
Constraint: or .
- (errno )
On entry, error in parameter .
Constraint: or .
- (errno )
On entry, error in parameter .
Constraint: , , or .
- (errno )
On entry, error in parameter .
Constraint: .
- (errno )
The iteration failed with an unexpected error, please contact NAG.
- (errno )
A failure occurred in
dtgevc()
while computing generalized eigenvectors.
- Warns
- NagAlgorithmicWarning
- (errno )
The iteration failed. No eigenvectors have been calculated but , and should be correct from element .
- Notes
A generalized eigenvalue for a pair of matrices is a scalar or a ratio , such that is singular. It is usually represented as the pair , as there is a reasonable interpretation for , and even for both being zero.
The right eigenvector corresponding to the eigenvalue of satisfies
The left eigenvector corresponding to the eigenvalue of satisfies
where is the conjugate-transpose of .
All the eigenvalues and, if required, all the eigenvectors of the generalized eigenproblem , where and are real, square matrices, are determined using the algorithm. The algorithm consists of four stages:
is reduced to upper Hessenberg form and at the same time is reduced to upper triangular form.
is further reduced to quasi-triangular form while the triangular form of is maintained. This is the real generalized Schur form of the pair .
The quasi-triangular form of is reduced to triangular form and the eigenvalues extracted. This function does not actually produce the eigenvalues , but instead returns and such that
The division by becomes your responsibility, since may be zero, indicating an infinite eigenvalue. Pairs of complex eigenvalues occur with and complex conjugates, even though and are not conjugate.
If the eigenvectors are required they are obtained from the triangular matrices and then transformed back into the original coordinate system.
For details of the balancing option, see Notes for dggbal.
- References
Anderson, E, Bai, Z, Bischof, C, Blackford, S, Demmel, J, Dongarra, J J, Du Croz, J J, Greenbaum, A, Hammarling, S, McKenney, A and Sorensen, D, 1999, LAPACK Users’ Guide, (3rd Edition), SIAM, Philadelphia, https://www.netlib.org/lapack/lug
Golub, G H and Van Loan, C F, 2012, Matrix Computations, (4th Edition), Johns Hopkins University Press, Baltimore
Wilkinson, J H, 1979, Kronecker’s canonical form and the algorithm, Linear Algebra Appl. (28), 285–303