CGGESX(3)
πΈ NAME πΈ
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/cggesx.f
Okay bestie, welcome to the cggesx.f(3) page from the Library Functions Manual β yes, that exact cggesx.f(3) manual name, and yes, this is the file path, no cap. π
β¨
β¨ SYNOPSIS β¨
π Functions/Subroutines π
subroutine CGGESX (jobvsl, jobvsr, sort, selctg, sense, n, a, lda, b,
ldb, sdim, alpha, beta, vsl, ldvsl, vsr, ldvsr, rconde, rcondv,
work, lwork, rwork, iwork, liwork, bwork, info)
CGGESX β okay so this icon literally computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices. π«Άπ₯ Eigenvalues? slay. Schur form? periodt. Schur vectors? only if you optionally want them, bestie. π
π Function/Subroutine Documentation π
ok so here's the actual signature, bestie β this is what you type, and every single arg matters, no skips:
subroutine CGGESX (character jobvsl, character jobvsr, character sort,
external selctg, character sense, integer n, complex, dimension( lda, *
) a, integer lda, complex, dimension( ldb, * ) b, integer ldb, integer
sdim, complex, dimension( * ) alpha, complex, dimension( * ) beta,
complex, dimension( ldvsl, * ) vsl, integer ldvsl, complex, dimension(
ldvsr, * ) vsr, integer ldvsr, real, dimension( 2 ) rconde, real,
dimension( 2 ) rcondv, complex, dimension( * ) work, integer lwork,
real, dimension( * ) rwork, integer, dimension( * ) iwork, integer
liwork, logical, dimension( * ) bwork, integer info)
and the one-liner that describes the whole vibe: CGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices. that's the whole assignment. π
β¨ Purpose β¨
okay so picture this: you've got a pair of N-by-N complex nonsymmetric matrices β a cute little duo, (A,B). CGGESX computes the generalized eigenvalues for them, plus the complex Schur form (S,T), and, if you ask nicely (aka optionally), the left and/or right matrices of Schur vectors, VSL and VSR.
what you get out of it is the generalized Schur factorization:
(A,B) = ( (VSL) S (VSR)**H, (VSL) T (VSR)**H )
where (VSR)**H is the conjugate-transpose of VSR. the way that conjugate-transpose just shows up and does its thing. π₯
optionally β and this is the extra-credit part, bestie β it orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper triangular matrix S and the upper triangular matrix T. it also computes a reciprocal condition number for the average of the selected eigenvalues (RCONDE), and computes a reciprocal condition number for the right and left deflating subspaces corresponding to the selected eigenvalues (RCONDV). and then the leading columns of VSL and VSR form an orthonormal basis for the corresponding left and right eigenspaces (deflating subspaces). iconic behavior honestly. π
so what even is a generalized eigenvalue for a pair of matrices (A,B)? it's a scalar w, or a ratio alpha/beta = w, such that A - w*B is singular. it's usually represented as the pair (alpha,beta), because there's a reasonable interpretation for beta=0 or for both of them being zero. no cap, that's the definition. π¦
and a pair of matrices (S,T) is in generalized complex Schur form if T is upper triangular with non-negative diagonal and S is upper triangular. that's the finish line. π
π Parameters π
get comfy, there's a lot of them, but we're going through every single one together. group chat style. π«Ά
JOBVSL
JOBVSL is CHARACTER*1
'N'β do not compute the left Schur vectors. we're leaving them alone, not our problem today. π'V'β compute the left Schur vectors. yes ma'am. β¨
JOBVSR
JOBVSR is CHARACTER*1
'N'β do not compute the right Schur vectors.'V'β compute the right Schur vectors. πΈ
SORT
SORT is CHARACTER*1
specifies whether or not to order the eigenvalues on the diagonal of the generalized Schur form.
'N'β eigenvalues are not ordered.'S'β eigenvalues are ordered (seeSELCTG).
SELCTG
SELCTG is a LOGICAL FUNCTION of two COMPLEX arguments. and listen β SELCTG must be declared EXTERNAL in the calling subroutine. do not forget this, it's giving classic "why is my code broken" energy. π
- if
SORT = 'N',SELCTGis not referenced. it's just vibing, unused. - if
SORT = 'S',SELCTGis used to select eigenvalues to sort to the top left of the Schur form.
β οΈ important warning, bestie, read this twice: note that a selected complex eigenvalue may no longer satisfySELCTG(ALPHA(j),BETA(j)) = .TRUE.after ordering, since ordering may change the value of complex eigenvalues (especially if the eigenvalue is ill-conditioned). in this caseINFOis set toN+3β seeINFObelow. the ordering genuinely can move the numbers around, so the thing you selected might not look selected anymore. not a bug, just math being math. π
SENSE
SENSE is CHARACTER*1
determines which reciprocal condition numbers are computed.
'N'β none are computed. we're doing the bare minimum today and that's valid. π'E'β computed for average of selected eigenvalues only.'V'β computed for selected deflating subspaces only.'B'β computed for both. overachiever behavior, we love it. π
ifSENSE = 'E','V', or'B', thenSORTmust equal'S'. that's a hard requirement, not a suggestion.
N
N is INTEGER
the order of the matrices A, B, VSL, and VSR. and N >= 0. zero is allowed, negative is not. π«
A
A is COMPLEX array, dimension (LDA, N)
- on entry, the first of the pair of matrices.
- on exit,
Ahas been overwritten by its generalized Schur formS. yeah she's gone, that's the deal. π₯
LDA
LDA is INTEGER
the leading dimension of A. LDA >= max(1,N). simple as that.
B
B is COMPLEX array, dimension (LDB, N)
- on entry, the second of the pair of matrices.
- on exit,
Bhas been overwritten by its generalized Schur formT. same situation, she's transformed. β¨
LDB
LDB is INTEGER
the leading dimension of B. LDB >= max(1,N).
SDIM
SDIM is INTEGER
- if
SORT = 'N', thenSDIM = 0. - if
SORT = 'S', thenSDIM =number of eigenvalues (after sorting) for whichSELCTGis true. so it's literally "how many did my little function say yes to". π
ALPHA
ALPHA is COMPLEX array, dimension (N) β that's it, that's the whole note. no extra commentary in the source, so I'm not making anything up. moving on. π
BETA
BETA is COMPLEX array, dimension (N)
on exit, ALPHA(j)/BETA(j), j=1,...,N, will be the generalized eigenvalues. ALPHA(j) and BETA(j), j=1,...,N are the diagonals of the complex Schur form (S,T). and BETA(j) will be non-negative real. π
β οΈ note, and this one's a real one: the quotientsALPHA(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,ALPHAwill be always less than and usually comparable withnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B). so don't just divide, bestie, actually think about it first. π
VSL
VSL is COMPLEX array, dimension (LDVSL,N)
if JOBVSL = 'V', VSL will contain the left Schur vectors. not referenced if JOBVSL = 'N'. π¦
LDVSL
LDVSL is INTEGER
the leading dimension of the matrix VSL. LDVSL >=1, and if JOBVSL = 'V', LDVSL >= N.
VSR
VSR is COMPLEX array, dimension (LDVSR,N)
if JOBVSR = 'V', VSR will contain the right Schur vectors. not referenced if JOBVSR = 'N'. π
LDVSR
LDVSR is INTEGER
the leading dimension of the matrix VSR. LDVSR >= 1, and if JOBVSR = 'V', LDVSR >= N.
RCONDE
RCONDE is REAL array, dimension ( 2 )
if SENSE = 'E' or 'B', RCONDE(1) and RCONDE(2) contain the reciprocal condition numbers for the average of the selected eigenvalues. not referenced if SENSE = 'N' or 'V'. π
RCONDV
RCONDV is REAL array, dimension ( 2 )
if SENSE = 'V' or 'B', RCONDV(1) and RCONDV(2) contain the reciprocal condition number for the selected deflating subspaces. not referenced if SENSE = 'N' or 'E'. π§
WORK
WORK is COMPLEX array, dimension (MAX(1,LWORK))
on exit, if INFO = 0, WORK(1) returns the optimal LWORK. she tells you what she wanted. π«Ά
LWORK
LWORK is INTEGER
the dimension of the array WORK.
- if
N = 0,LWORK >= 1 - else if
SENSE = 'E','V', or'B',LWORK >= MAX(1,2*N,2*SDIM*(N-SDIM)) - else
LWORK >= MAX(1,2*N)
note that 2*SDIM*(N-SDIM) <= N*N/2. note also that an error is only returned if LWORK < MAX(1,2*N), but if SENSE = 'E' or 'V' or 'B' this may not be large enough. so like β it won't yell at you, but it also won't be enough. read the room. π
if LWORK = -1, then a workspace query is assumed; the routine only calculates the bound on the optimal size of the WORK array and the minimum size of the IWORK array, returns these values as the first entries of the WORK and IWORK arrays, and no error message related to LWORK or LIWORK is issued by XERBLA. that's the "just asking, not buying" mode. π
RWORK
RWORK is REAL array, dimension ( 8*N )
real workspace. that's the whole description. eight times N. don't skimp. β
IWORK
IWORK is INTEGER array, dimension (MAX(1,LIWORK))
on exit, if INFO = 0, IWORK(1) returns the minimum LIWORK. she's helpful like that. β¨
LIWORK
LIWORK is INTEGER
the dimension of the array WORK. (yes, the docs literally say WORK here and not IWORK β we're all just gonna read past that together, ok? π)
- if
SENSE = 'N'orN = 0,LIWORK >= 1 - otherwise
LIWORK >= N+2
if LIWORK = -1, then a workspace query is assumed; the routine only calculates the bound on the optimal size of the WORK array and the minimum size of the IWORK array, returns these values as the first entries of the WORK and IWORK arrays, and no error message related to LWORK or LIWORK is issued by XERBLA. same deal as LWORK = -1, just for the integer side. π¦
BWORK
BWORK is LOGICAL array, dimension (N)
not referenced if SORT = 'N'. she only clocks in when sorting is on. π
INFO
INFO is INTEGER β this is the receipts section, bestie, read it carefully. π
= 0β successful exit. slay. π< 0β ifINFO = -i, the i-th argument had an illegal value. check your args.= 1,...,Nβ the QZ iteration failed.(A,B)are not in Schur form, butALPHA(j)andBETA(j)should be correct forj=INFO+1,...,N. so partial progress, not a total loss.> Nβ and here's the spicy breakdown:=N+1β other than QZ iteration failed inCHGEQZ.=N+2β after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Generalized Schur form no longer satisfySELCTG=.TRUE.. this could also be caused due to scaling. π roundoff said "not today".=N+3β reordering failed inCTGSEN.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole squad. π«Ά
definition at line 326 of file cggesx.f. β¨
β¨ Author β¨
So basically the whole thing was auto-generated by Doxygen for LAPACK, straight from the source code. Like, nobody hand-wrote this β the docs just spawned themselves from the .f file and honestly? iconic behavior. π
β¨
No cap, that's the entire author credit: Doxygen did the typing, LAPACK provided the source code, and the rest is history. π«Ά
πΈ that's the whole page bestie, ily, go call CGGESX responsibly πΈ
Signing off from LAPACK Version 3.12.0, straight out of /home/abui...RC/cggesx.f(3) β generated automatically by Doxygen for LAPACK from the source code, and now lovingly narrated by me. πππ¦
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms