SRC/dtgevc.f(3)
π SRC/dtgevc.f(3)
okay so bestie, this is the Library Functions Manual page for SRC/dtgevc.f(3), and it is lowkey giving βlinear algebra main characterβ energy. itβs a LAPACK routine page, so grab a lil snack and letβs get into it π
β¨
π NAME
SRC/dtgevc.f β thatβs the name, bestie, short and iconic.
β¨ SYNOPSIS
π Functions/Subroutines
subroutine dtgevc (side, howmny, select, n, s, lds, p, ldp, vl, ldvl,
vr, ldvr, mm, m, work, info)
DTGEVC
π Function/Subroutine Documentation
π« subroutine dtgevc
subroutine dtgevc (character side, character howmny, logical, dimension( * )
select, integer n, double precision, dimension( lds, * ) s, integer lds,
double precision, dimension( ldp, * ) p, integer ldp, double precision,
dimension( ldvl, * ) vl, integer ldvl, double precision, dimension(
ldvr, * ) vr, integer ldvr, integer mm, integer m, double precision,
dimension( * ) work, integer info)
DTGEVC
π¦ Purpose
okay so hereβs the vibe: DTGEVC 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 DGGHRD + DHGEQZ. slay.
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. no cap, they just show up from the diagonal blocks π«
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). periodt π«Ά
πΈ Parameters
SIDEβSIDEisCHARACTER*1.= 'R': compute right eigenvectors only;= 'L': compute left eigenvectors only;= 'B': compute both right and left eigenvectors. πHOWMNYβHOWMNYisCHARACTER*1.= '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βSELECTisLOGICALarray, 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βNisINTEGER. The order of the matricesSandP.N >= 0. πSβSisDOUBLE PRECISIONarray, dimension(LDS,N). The upper quasi-triangular matrixSfrom a generalized Schur factorization, as computed byDHGEQZ. πLDSβLDSisINTEGER. The leading dimension of arrayS.LDS >= max(1,N). β¨PβPisDOUBLE PRECISIONarray, dimension(LDP,N). The upper triangular matrixPfrom a generalized Schur factorization, as computed byDHGEQZ.2-by-2diagonal blocks ofPcorresponding to2-by-2blocks ofSmust be in positive diagonal form. πLDPβLDPisINTEGER. The leading dimension of arrayP.LDP >= max(1,N). πVLβVLisDOUBLE PRECISIONarray, dimension(LDVL,MM). On entry, ifSIDE = 'L'or'B'andHOWMNY = 'B',VLmust contain anN-by-NmatrixQ(usually the orthogonal matrixQof left Schur vectors returned byDHGEQZ). On exit, ifSIDE = 'L'or'B',VLcontains: ifHOWMNY = 'A', the matrixYof left eigenvectors of(S,P); ifHOWMNY = 'B', the matrixQ*Y; ifHOWMNY = 'S', the left eigenvectors of(S,P)specified bySELECT, stored consecutively in the columns ofVL, 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 ifSIDE = 'R'. πLDVLβLDVLisINTEGER. The leading dimension of arrayVL.LDVL >= 1, and ifSIDE = 'L'or'B',LDVL >= N. πVRβVRisDOUBLE PRECISIONarray, dimension(LDVR,MM). On entry, ifSIDE = 'R'or'B'andHOWMNY = 'B',VRmust contain anN-by-NmatrixZ(usually the orthogonal matrixZof right Schur vectors returned byDHGEQZ). On exit, ifSIDE = 'R'or'B',VRcontains: ifHOWMNY = 'A', the matrixXof right eigenvectors of(S,P); ifHOWMNY = 'B'or'b', the matrixZ*X; ifHOWMNY = '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 ifSIDE = 'L'. π«LDVRβLDVRisINTEGER. The leading dimension of the arrayVR.LDVR >= 1, and ifSIDE = 'R'or'B',LDVR >= N. π₯MMβMMisINTEGER. The number of columns in the arraysVLand/orVR.MM >= M. πΈMβMisINTEGER. 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βWORKisDOUBLE PRECISIONarray, dimension(6*N). βINFOβINFOisINTEGER.= 0: successful exit.< 0: ifINFO = -i, thei-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, bestie β the receipts are here:
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 dtgevc.f.
π Author (the generated-by one)
Generated automatically by Doxygen for LAPACK from the source code. π«Ά
okay thatβs the whole page, bestie! source/version: LAPACK Version 3.12.0; page: SRC/dtgevc.f(3); date: not listed in the footer, so thatβs the whole footer vibe. mwah πβ¨πΈ
π¦ 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