SRC/stgevc.f(3)
πΈ NAME πΈ
okay so this page is SRC/stgevc.f β yes, bestie, from the Library Functions Manual, and weβre doing SRC/stgevc.f(3) energy today. π
β¨ SYNOPSIS β¨
π«Ά Functions/Subroutines
subroutine stgevc (side, howmny, select, n, s, lds, p, ldp, vl, ldvl,
vr, ldvr, mm, m, work, info)
STGEVC
π Function/Subroutine Documentation π
subroutine stgevc (character side, character howmny, logical, dimension( * )
select, integer n, real, dimension( lds, * ) s, integer lds, real,
dimension( ldp, * ) p, integer ldp, real, dimension( ldvl, * ) vl,
integer ldvl, real, dimension( ldvr, * ) vr, integer ldvr, integer mm,
integer m, real, dimension( * ) work, integer info)
STGEVC
This is STGEVC, and the vibe is βletβs get those eigenvectors.β π
π Purpose π
OK so STGEVC computes some or all of the right and/or left eigenvectors of a pair of real matrices (S,P), where S is a quasi-triangular matrix and P is upper triangular. Matrix pairs of this type are produced by the generalized Schur factorization of a matrix pair (A,B):
A = Q*S*Z**T, B = Q*P*Z**T
as computed by SGGHRD + SHGEQZ.
The right eigenvector x and the left eigenvector y of (S,P) corresponding to an eigenvalue w are defined by:
S*x = w*P*x, (y**H)*S = w*(y**H)*P,
where y**H denotes the conjugate transpose of y. The eigenvalues are not input to this routine, but are computed directly from the diagonal blocks of S and P.
This routine returns the matrices X and/or Y of right and left eigenvectors of (S,P), or the products Z*X and/or Q*Y, where Z and Q are input matrices. If Q and Z are the orthogonal factors from the generalized Schur factorization of a matrix pair (A,B), then Z*X and Q*Y are the matrices of right and left eigenvectors of (A,B).
πΈ Parameters πΈ
SIDEβ aCHARACTER*1, and it controls which side gets the eigenvector glow-up:'R': compute right eigenvectors only;'L': compute left eigenvectors only;'B': compute both right and left eigenvectors.
HOWMNYβ aCHARACTER*1; it tells us how many eigenvectors to compute and whether to backtransform them:'A': compute all right and/or left eigenvectors;'B': compute all right and/or left eigenvectors, backtransformed by the matrices inVRand/orVL;'S': compute selected right and/or left eigenvectors, specified by the logical arraySELECT.
SELECTβLOGICALarray, dimension(N). IfHOWMNY='S',SELECTspecifies the eigenvectors to be computed. Ifw(j)is a real eigenvalue, the corresponding real eigenvector is computed ifSELECT(j)is.TRUE.. Ifw(j)andw(j+1)are the real and imaginary parts of a complex eigenvalue, the corresponding complex eigenvector is computed if eitherSELECT(j)orSELECT(j+1)is.TRUE., and on exitSELECT(j)is set to.TRUE.andSELECT(j+1)is set to.FALSE.. Not referenced ifHOWMNY = 'A'or'B'.NβINTEGER; the order of the matricesSandP.N >= 0.SβREALarray, dimension(LDS,N); the upper quasi-triangular matrixSfrom a generalized Schur factorization, as computed bySHGEQZ.LDSβINTEGER; the leading dimension of arrayS.LDS >= max(1,N).PβREALarray, dimension(LDP,N); the upper triangular matrixPfrom a generalized Schur factorization, as computed bySHGEQZ.2-by-2diagonal blocks ofPcorresponding to2-by-2blocks ofSmust be in positive diagonal form.LDPβINTEGER; the leading dimension of arrayP.LDP >= max(1,N).VLβREALarray, dimension(LDVL,MM). On entry, ifSIDE = 'L' or 'B'andHOWMNY = 'B',VLmust contain anN-by-NmatrixQ(usually the orthogonal matrixQof left Schur vectors returned bySHGEQZ). On exit, ifSIDE = 'L' or 'B',VLcontains:- if
HOWMNY = 'A', the matrixYof left eigenvectors of(S,P); - if
HOWMNY = 'B', the matrixQ*Y; - if
HOWMNY = 'S', the left eigenvectors of(S,P)specified bySELECT, stored consecutively in the columns ofVL, in the same order as their eigenvalues.
- if
A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive columns, the first holding the real part, and the second the imaginary part.
Not referenced if SIDE = 'R'.
LDVLβINTEGER; the leading dimension of arrayVL.LDVL >= 1, and ifSIDE = 'L' or 'B',LDVL >= N.VRβREALarray, dimension(LDVR,MM). On entry, ifSIDE = 'R' or 'B'andHOWMNY = 'B',VRmust contain anN-by-NmatrixZ(usually the orthogonal matrixZof right Schur vectors returned bySHGEQZ).
On exit, if SIDE = 'R' or 'B', VR contains:
- if
HOWMNY = 'A', the matrixXof right eigenvectors of(S,P); - if
HOWMNY = 'B' or 'b', the matrixZ*X; - if
HOWMNY = 'S' or 's', the right eigenvectors of(S,P)specified bySELECT, stored consecutively in the columns ofVR, in the same order as their eigenvalues.
A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive columns, the first holding the real part and the second the imaginary part.
Not referenced if SIDE = 'L'.
LDVRβINTEGER; the leading dimension of the arrayVR.LDVR >= 1, and ifSIDE = 'R' or 'B',LDVR >= N.MMβINTEGER; the number of columns in the arraysVLand/orVR.MM >= M.MβINTEGER; the number of columns in the arraysVLand/orVRactually used to store the eigenvectors. IfHOWMNY = 'A'or'B',Mis set toN. Each selected real eigenvector occupies one column and each selected complex eigenvector occupies two columns.WORKβREALarray, dimension(6*N).INFOβINTEGER= 0: successful exit.< 0: ifINFO = -i, the i-th argument had an illegal value.> 0: the2-by-2block(INFO:INFO+1)does not have a complex eigenvalue.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ Further Details π¦
Allocation of workspace:
---------- -- ---------
WORK( j ) = 1-norm of j-th column of A, above the diagonal
WORK( N+j ) = 1-norm of j-th column of B, above the diagonal
WORK( 2*N+1:3*N ) = real part of eigenvector
WORK( 3*N+1:4*N ) = imaginary part of eigenvector
WORK( 4*N+1:5*N ) = real part of back-transformed eigenvector
WORK( 5*N+1:6*N ) = imaginary part of back-transformed eigenvector
Rowwise vs. columnwise solution methods:
------- -- ---------- -------- -------
Finding a generalized eigenvector consists basically of solving the singular triangular system
(A - w B) x = 0 (for right) or: (A - w B)**H y = 0 (for left)
Consider finding the i-th right eigenvector (assume all eigenvalues are real). The equation to be solved is:
n i
0 = sum C(j,k) v(k) = sum C(j,k) v(k) for j = i,. . .,1
k=j k=j
where C = (A - w B) (The components v(i+1:n) are 0.)
The method is:
(1) v(i) := 1
for j = i-1,. . .,1:
i
(2) compute s = - sum C(j,k) v(k) and
k=j+1
(3) v(j) := s / C(j,j)
Step 2 is sometimes called the step, since it is an inner product between the j-th row and the portion of the eigenvector that has been computed so far.
The method consists basically in doing the sums for all the rows in parallel. As each v(j) is computed, the contribution of v(j) times the j-th column of C is added to the partial sums. Since FORTRAN arrays are stored columnwise, this has the advantage that at each step, the elements of C that are accessed are adjacent to one another, whereas with the rowwise method, the elements accessed at a step are spaced LDS (and LDP) words apart.
When finding left eigenvectors, the matrix in question is the transpose of the one in storage, so the rowwise method then actually accesses columns of A and B at each step, and so is the preferred method.
π Definition at line 293 of file stgevc.f. π
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
okay bestie, thatβs the whole page π«Ά This cutie is from LAPACK Version 3.12.0, page SRC/stgevc.f(3) β go solve those eigenvectors and slay. π
β¨
π¦ 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