SRC/sggevx.f(3)
๐ฆ SRC/sggevx.f ๐ฆ
from the Library Functions Manual โ this is the SRC/sggevx.f(3) page, bestie, and it's a whole vibe.
๐ท๏ธ NAME
SRC/sggevx.f
โจ SYNOPSIS โจ
๐ Functions/Subroutines ๐
subroutine sggevx (balanc, jobvl, jobvr, sense, n, a, lda, b, ldb, alphar, alphai, beta, vl, ldvl, vr, ldvr, ilo, ihi, lscale, rscale, abnrm, bbnrm, rconde, rcondv, work, lwork, iwork, bwork, info)โ SGGEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices.
๐ Function/Subroutine Documentation ๐
subroutine sggevx (character balanc, character jobvl, character jobvr,
character sense, integer n, real, dimension( lda, * ) a, integer lda,
real, dimension( ldb, * ) b, integer ldb, real, dimension( * ) alphar,
real, dimension( * ) alphai, real, dimension( * ) beta, real, dimension(
ldvl, * ) vl, integer ldvl, real, dimension( ldvr, * ) vr, integer ldvr,
integer ilo, integer ihi, real, dimension( * ) lscale, real, dimension(
* ) rscale, real abnrm, real bbnrm, real, dimension( * ) rconde, real,
dimension( * ) rcondv, real, dimension( * ) work, integer lwork,
integer, dimension( * ) iwork, logical, dimension( * ) bwork, integer
info)
SGGEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices.
๐ฏ Purpose ๐ฏ
okay so SGGEVX computes, for a pair of N-by-N real nonsymmetric matrices (A,B), the generalized eigenvalues โ and optionally the left and/or right generalized eigenvectors. โจ
Optionally also, it computes a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors (ILO, IHI, LSCALE, RSCALE, ABNRM, and BBNRM), reciprocal condition numbers for the eigenvalues (RCONDE), and reciprocal condition numbers for the right eigenvectors (RCONDV). ๐
A generalized eigenvalue for a pair of matrices (A,B) is a scalar lambda or a ratio alpha/beta = lambda, such that A - lambda*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0, and even for both being zero.
The right eigenvector v(j) corresponding to the eigenvalue lambda(j) of (A,B) satisfies
A * v(j) = lambda(j) * B * v(j) .
The left eigenvector u(j) corresponding to the eigenvalue lambda(j) of (A,B) satisfies
u(j)**H * A = lambda(j) * u(j)**H * B.
where u(j)**H is the conjugate-transpose of u(j).
๐ธ Parameters ๐ธ
BALANCโBALANCisCHARACTER*1. Specifies the balance option to be performed.= 'N':do not diagonally scale or permute;= 'P':permute only;= 'S':scale only;= 'B':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.
JOBVLโJOBVLisCHARACTER*1.= 'N':do not compute the left generalized eigenvectors;= 'V':compute the left generalized eigenvectors.
JOBVRโJOBVRisCHARACTER*1.= 'N':do not compute the right generalized eigenvectors;= 'V':compute the right generalized eigenvectors.
SENSEโSENSEisCHARACTER*1. Determines which reciprocal condition numbers are computed.= 'N':none are computed;= 'E':computed for eigenvalues only;= 'V':computed for eigenvectors only;= 'B':computed for eigenvalues and eigenvectors.
NโNisINTEGER. The order of the matricesA,B,VL, andVR.N >= 0.AโAisREAL array, dimension (LDA, N). On entry, the matrixAin the pair(A,B). On exit,Ahas been overwritten. IfJOBVL='V'orJOBVR='V'or both, thenAcontains the first part of the real Schur form of the versions of the inputAandB.LDAโLDAisINTEGER. The leading dimension ofA.LDA >= max(1,N).BโBisREAL array, dimension (LDB, N). On entry, the matrixBin the pair(A,B). On exit,Bhas been overwritten. IfJOBVL='V'orJOBVR='V'or both, thenBcontains the second part of the real Schur form of the versions of the inputAandB.LDBโLDBisINTEGER. The leading dimension ofB.LDB >= max(1,N).ALPHARโALPHARisREAL array, dimension (N).ALPHAIโALPHAIisREAL array, dimension (N).BETAโBETAisREAL array, dimension (N). On exit,(ALPHAR(j) + ALPHAI(j)*i)/BETA(j),j=1,...,N, will be the generalized eigenvalues. IfALPHAI(j)is zero, then the j-th eigenvalue is real; if positive, then the j-th and(j+1)-st eigenvalues are a complex conjugate pair, withALPHAI(j+1)negative.
Note: the quotientsALPHAR(j)/BETA(j)andALPHAI(j)/BETA(j)may easily over- or underflow, andBETA(j)may even be zero. Thus, the user should avoid naively computing the ratioALPHA/BETA. However,ALPHARandALPHAIwill be always less than and usually comparable withnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B).
VLโVLisREAL array, dimension (LDVL,N). IfJOBVL = 'V', the left eigenvectorsu(j)are stored one after another in the columns ofVL, in the same order as their eigenvalues. If the j-th eigenvalue is real, thenu(j) = VL(:,j), the j-th column ofVL. If the j-th and(j+1)-th eigenvalues form a complex conjugate pair, thenu(j) = VL(:,j)+i*VL(:,j+1)andu(j+1) = VL(:,j)-i*VL(:,j+1). Each eigenvector will be scaled so the largest component haveabs(real part) + abs(imag. part) = 1. Not referenced ifJOBVL = 'N'.LDVLโLDVLisINTEGER. The leading dimension of the matrixVL.LDVL >= 1, and ifJOBVL = 'V',LDVL >= N.VRโVRisREAL array, dimension (LDVR,N). IfJOBVR = 'V', the right eigenvectorsv(j)are stored one after another in the columns ofVR, in the same order as their eigenvalues. If the j-th eigenvalue is real, thenv(j) = VR(:,j), the j-th column ofVR. If the j-th and(j+1)-th eigenvalues form a complex conjugate pair, thenv(j) = VR(:,j)+i*VR(:,j+1)andv(j+1) = VR(:,j)-i*VR(:,j+1). Each eigenvector will be scaled so the largest component haveabs(real part) + abs(imag. part) = 1. Not referenced ifJOBVR = 'N'.LDVRโLDVRisINTEGER. The leading dimension of the matrixVR.LDVR >= 1, and ifJOBVR = 'V',LDVR >= N.ILOโILOisINTEGER.IHIโIHIisINTEGER.ILOandIHIare integer values such that on exitA(i,j) = 0andB(i,j) = 0ifi > jandj = 1,...,ILO-1ori = IHI+1,...,N. IfBALANC = 'N'or'S',ILO = 1andIHI = N.LSCALEโLSCALEisREAL array, dimension (N). Details of the permutations and scaling factors applied to the left side ofAandB. IfPL(j)is the index of the row interchanged with rowj, andDL(j)is the scaling factor applied to rowj, then
LSCALE(j) = PL(j) for j = 1,...,ILO-1
= DL(j) for j = ILO,...,IHI
= PL(j) for j = IHI+1,...,N.
The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.
RSCALEโRSCALEisREAL array, dimension (N). Details of the permutations and scaling factors applied to the right side ofAandB. IfPR(j)is the index of the column interchanged with columnj, andDR(j)is the scaling factor applied to columnj, then
RSCALE(j) = PR(j) for j = 1,...,ILO-1
= DR(j) for j = ILO,...,IHI
= PR(j) for j = IHI+1,...,N
The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.
ABNRMโABNRMisREAL. The one-norm of the balanced matrixA.BBNRMโBBNRMisREAL. The one-norm of the balanced matrixB.RCONDEโRCONDEisREAL array, dimension (N). IfSENSE = 'E'or'B', the reciprocal condition numbers of the eigenvalues, stored in consecutive elements of the array. For a complex conjugate pair of eigenvalues two consecutive elements ofRCONDEare set to the same value. ThusRCONDE(j),RCONDV(j), and the j-th columns ofVLandVRall correspond to the j-th eigenpair. IfSENSE = 'N'or'V',RCONDEis not referenced.RCONDVRCONDVโREALarray, dimension(N). IfSENSE = 'V'orSENSE = 'B', this is where the estimated reciprocal condition numbers of the eigenvectors live, stored in consecutive elements of the array. For a complex eigenvector, two consecutive elements ofRCONDVare set to the same value. If the eigenvalues cannot be reordered to computeRCONDV(j), thenRCONDV(j)is set to0; this can only occur when the true value would be very small anyway. IfSENSE = 'N'orSENSE = 'E',RCONDVis not referenced. ๐
๐ผ WORK
WORK โ REAL array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. That's the little receipt LAPACK hands back. ๐งพ
๐ ๏ธ LWORK
LWORK โ INTEGER. This is the dimension of the array WORK. The floor is LWORK >= max(1,2*N). Then, depending on the options:
- If
BALANC = 'S'orBALANC = 'B', orJOBVL = 'V', orJOBVR = 'V', thenLWORK >= max(1,6*N). - If
SENSE = 'E', thenLWORK >= max(1,10*N). - If
SENSE = 'V'orSENSE = 'B', thenLWORK >= 2*N*N+8*N+16.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. โจ
๐งฎ IWORK
IWORK โ INTEGER array, dimension (N+6). If SENSE = 'E', IWORK is not referenced.
๐ง BWORK
BWORK โ LOGICAL array, dimension (N). If SENSE = 'N', BWORK is not referenced.
๐ฆ INFO
INFO โ INTEGER. The vibe check:
= 0: successful exit.< 0: ifINFO = -i, the i-th argument had an illegal value.= 1,...,N: The QZ iteration failed. No eigenvectors have been calculated, butALPHAR(j),ALPHAI(j), andBETA(j)should be correct forj=INFO+1,...,N.> N:=N+1: other than QZ iteration failed inSHGEQZ.=N+2: error return fromSTGEVC.
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ Further Details
Balancing a matrix pair (A,B) is a two-step glow-up: first, permuting rows and columns to isolate eigenvalues; second, applying diagonal similarity transformation to the rows and columns to make the rows and columns as close in norm as possible. The computed reciprocal condition numbers correspond to the balanced matrix. Permuting rows and columns will not change the condition numbers (in exact arithmetic) but diagonal scaling will. For further explanation of balancing, see section 4.11.1.2 of LAPACK Users' Guide.
An approximate error bound on the chordal distance between the i-th computed generalized eigenvalue w and the corresponding exact eigenvalue lambda is
chord(w, lambda) <= EPS * norm(ABNRM, BBNRM) / RCONDE(I)
An approximate error bound for the angle between the i-th computed eigenvector VL(i) or VR(i) is given by
EPS * norm(ABNRM, BBNRM) / DIF(i).
For further explanation of the reciprocal condition numbers RCONDE and RCONDV, see section 4.11 of LAPACK User's Guide.
Definition at line 387 of file sggevx.f.
๐ Author
Generated automatically by Doxygen for LAPACK from the source code.
๐ That's the whole tea, bestie โ footer says LAPACK Version 3.12.0, source SRC/sggevx.f(3) (and ngl, it didn't give us a date, so no cap on that). ๐
๐ฆ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 ยท custom
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms