ggesx(3)
okay so bestie, welcome to ggesx(3) from the Library Functions Manual β ggesx: Schur form, expert, and she is iconic π
β¨
π NAME π
ggesxβggesx: Schur form, expert.
β¨ SYNOPSIS β¨
πΈ Functions πΈ
cggesx
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 computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices.
dggesx
subroutine dggesx (jobvsl, jobvsr, sort, selctg, sense, n, a, lda, b,
ldb, sdim, alphar, alphai, beta, vsl, ldvsl, vsr, ldvsr, rconde,
rcondv, work, lwork, iwork, liwork, bwork, info)
DGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices.
sggesx
subroutine sggesx (jobvsl, jobvsr, sort, selctg, sense, n, a, lda, b,
ldb, sdim, alphar, alphai, beta, vsl, ldvsl, vsr, ldvsr, rconde,
rcondv, work, lwork, iwork, liwork, bwork, info)
SGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices.
zggesx
subroutine zggesx (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)
ZGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices.
π¦ Detailed Description π¦
(this section is literally just the heading in this part, bestie β the actual function documentation is right below and itβs giving main character energy)
π Function Documentation π
π subroutine cggesx π
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)
CGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices.
π Purpose π
Okay so hereβs the whole point, bestie: CGGESX computes for a pair of N-by-N complex nonsymmetric matrices (A,B), the generalized eigenvalues, the complex Schur form (S,T), and, optionally, the left and/or right matrices of Schur vectors (VSL and VSR). This gives the generalized Schur factorization:
(A,B) = ( (VSL) S (VSR)**H, (VSL) T (VSR)**H )
where (VSR)**H is the conjugate-transpose of VSR.
Optionally, it also 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; 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). The leading columns of VSL and VSR then form an orthonormal basis for the corresponding left and right eigenspaces (deflating subspaces).
A generalized eigenvalue for a pair of matrices (A,B) is a scalar w or a ratio alpha/beta = w, such that A - w*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0 or for both being zero.
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.
πΈ Parameters πΈ
JOBVSLβJOBVSLisCHARACTER*1.= 'N': do not compute the left Schur vectors;= 'V': compute the left Schur vectors.JOBVSRβJOBVSRisCHARACTER*1.= 'N': do not compute the right Schur vectors;= 'V': compute the right Schur vectors.SORTβSORTisCHARACTER*1. It 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βSELCTGis aLOGICAL FUNCTIONof twoCOMPLEXarguments.SELCTGmust be declaredEXTERNALin the calling subroutine. IfSORT = 'N',SELCTGis not referenced. IfSORT = 'S',SELCTGis used to select eigenvalues to sort to the top left of the Schur form. 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.SENSEβSENSEisCHARACTER*1. It determines which reciprocal condition numbers are computed.= 'N': none are computed;= 'E': computed for average of selected eigenvalues only;= 'V': computed for selected deflating subspaces only;= 'B': computed for both. IfSENSE = 'E','V', or'B',SORTmust equal'S'. No exceptions, bestie.NβNisINTEGER. The order of the matricesA,B,VSL, andVSR.N >= 0.AβAisCOMPLEX array, dimension(LDA, N). On entry, the first of the pair of matrices. On exit,Ahas been overwritten by its generalized Schur formS.LDAβLDAisINTEGER. The leading dimension ofA.LDA >= max(1,N).BβBisCOMPLEX array, dimension(LDB, N). On entry, the second of the pair of matrices. On exit,Bhas been overwritten by its generalized Schur formT.LDBβLDBisINTEGER. The leading dimension ofB.LDB >= max(1,N).SDIMβSDIMisINTEGER. IfSORT = 'N',SDIM = 0. IfSORT = 'S',SDIM = number of eigenvalues (after sorting) for which SELCTG is true.ALPHAβALPHAisCOMPLEX array, dimension(N).BETAβBETAisCOMPLEX array, dimension(N). On exit,ALPHA(j)/BETA(j),j=1,...,N, will be the generalized eigenvalues.ALPHA(j)andBETA(j),j=1,...,Nare the diagonals of the complex Schur form(S,T).BETA(j)will be non-negative real.
Note: 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).
VSLβVSLisCOMPLEX array, dimension(LDVSL,N). IfJOBVSL = 'V',VSLwill contain the left Schur vectors. Not referenced ifJOBVSL = 'N'.LDVSLβLDVSLisINTEGER. The leading dimension of the matrixVSL.LDVSL >=1, and ifJOBVSL = 'V',LDVSL >= N.VSRβVSRisCOMPLEX array, dimension(LDVSR,N). IfJOBVSR = 'V',VSRwill contain the right Schur vectors. Not referenced ifJOBVSR = 'N'.LDVSRβLDVSRisINTEGER. The leading dimension of the matrixVSR.LDVSR >= 1, and ifJOBVSR = 'V',LDVSR >= N.RCONDEβRCONDEisREAL array, dimension( 2 ). IfSENSE = 'E'or'B',RCONDE(1)andRCONDE(2)contain the reciprocal condition numbers for the average of the selected eigenvalues. Not referenced ifSENSE = 'N'or'V'.RCONDVβRCONDVisREAL array, dimension( 2 ). IfSENSE = 'V'or'B',RCONDV(1)andRCONDV(2)contain the reciprocal condition number for the selected deflating subspaces. Not referenced ifSENSE = 'N'or'E'.WORKβWORKisCOMPLEX array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORKisINTEGER. The dimension of the arrayWORK. IfN = 0,LWORK >= 1, else ifSENSE = 'E','V', or'B',LWORK >= MAX(1,2*N,2*SDIM*(N-SDIM)), elseLWORK >= MAX(1,2*N). Note that2*SDIM*(N-SDIM) <= N*N/2. Note also that an error is only returned ifLWORK < MAX(1,2*N), but ifSENSE = 'E'or'V'or'B'this may not be large enough.
IfLWORK = -1, then a workspace query is assumed; the routine only calculates the bound on the optimal size of theWORKarray and the minimum size of theIWORKarray, returns these values as the first entries of theWORKandIWORKarrays, and no error message related toLWORKorLIWORKis issued byXERBLA.
RWORKβRWORKisREAL array, dimension( 8*N ). Real workspace.IWORKβIWORKisINTEGER array, dimension(MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the minimumLIWORK.
LIWORK
(and this is exactly where part 1 of the page cuts off β the LIWORK details roll in with part 2, bestie π)
LIWORKβ she's anINTEGER, and the page says she's the dimension of the arrayWORK(yes, literallyWORKβ copying the manpage exactly, no cap π ). IfSENSE = 'N'orN = 0, thenLIWORK >= 1; otherwiseLIWORK >= 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.
BWORKβBWORKis aLOGICALarray, dimension(N). Bestie, it's not referenced ifSORT = 'N'π«Ά.INFOβINFOisINTEGER, and here's the whole mood:= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value.= 1,...,N: The QZ iteration failed.(A,B)are not in Schur form, butALPHA(j)andBETA(j)should be correct forj=INFO+1,...,N.> N:=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.=N+3: reordering failed inCTGSEN.
π«Ά Author π«Ά
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Definition at line 326 of file cggesx.f
β¨ subroutine dggesx β¨
subroutine dggesx (character jobvsl, character jobvsr, character sort,
external selctg, character sense, integer n, double precision,
dimension( lda, * ) a, integer lda, double precision, dimension( ldb, *
) b, integer ldb, integer sdim, double precision, dimension( * ) alphar,
double precision, dimension( * ) alphai, double precision, dimension( *
) beta, double precision, dimension( ldvsl, * ) vsl, integer ldvsl,
double precision, dimension( ldvsr, * ) vsr, integer ldvsr, double
precision, dimension( 2 ) rconde, double precision, dimension( 2 )
rcondv, double precision, dimension( * ) work, integer lwork, integer,
dimension( * ) iwork, integer liwork, logical, dimension( * ) bwork,
integer info)
DGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices π
π« Purpose π«
DGGESX computes for a pair of N-by-N real nonsymmetric matrices (A,B), the generalized eigenvalues, the real Schur form (S,T), and, optionally, the left and/or right matrices of Schur vectors (VSL and VSR). This gives the generalized Schur factorization
(A,B) = ( (VSL) S (VSR)**T, (VSL) T (VSR)**T )
Optionally, it also orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper quasi-triangular matrix S and the upper triangular matrix T; 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). The leading columns of VSL and VSR then form an orthonormal basis for the corresponding left and right eigenspaces (deflating subspaces) πΈ
A generalized eigenvalue for a pair of matrices (A,B) is a scalar w or a ratio alpha/beta = w, such that A - w*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0 or for both being zero.
A pair of matrices (S,T) is in generalized real Schur form if T is upper triangular with non-negative diagonal and S is block upper triangular with 1-by-1 and 2-by-2 blocks. 1-by-1 blocks correspond to real generalized eigenvalues, while 2-by-2 blocks of S will be by making the corresponding elements of T have the form:
[ a 0 ]
[ 0 b ]
and the pair of corresponding 2-by-2 blocks in S and T will have a complex conjugate pair of generalized eigenvalues π¦
π Parameters π
JOBVSLβCHARACTER*1, bestie:'N': do not compute the left Schur vectors;'V': compute the left Schur vectors.
JOBVSRβCHARACTER*1, same energy on the right side:'N': do not compute the right Schur vectors;'V': compute the right Schur vectors.
SORTβ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β aLOGICAL FUNCTIONof threeDOUBLE PRECISIONarguments.SELCTGmust be declaredEXTERNALin the calling subroutine. IfSORT = 'N',SELCTGis not referenced. IfSORT = 'S',SELCTGis used to select eigenvalues to sort to the top left of the Schur form. An eigenvalue(ALPHAR(j)+ALPHAI(j))/BETA(j)is selected ifSELCTG(ALPHAR(j),ALPHAI(j),BETA(j))is true; i.e. if either one of a complex conjugate pair of eigenvalues is selected, then both complex eigenvalues are selected. Note that a selected complex eigenvalue may no longer satisfySELCTG(ALPHAR(j),ALPHAI(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πSENSEβCHARACTER*1. Determines which reciprocal condition numbers are computed:'N': none are computed;'E': computed for average of selected eigenvalues only;'V': computed for selected deflating subspaces only;'B': computed for both.
If SENSE = 'E', 'V', or 'B', SORT must equal 'S'.
NβINTEGER. The order of the matricesA,B,VSL, andVSR.N >= 0.AβDOUBLE PRECISIONarray, dimension(LDA, N). On entry, the first of the pair of matrices. On exit,Ahas been overwritten by its generalized Schur formS.LDAβINTEGER. The leading dimension ofA.LDA >= max(1,N).BβDOUBLE PRECISIONarray, dimension(LDB, N). On entry, the second of the pair of matrices. On exit,Bhas been overwritten by its generalized Schur formT.LDBβINTEGER. The leading dimension ofB.LDB >= max(1,N).SDIMβINTEGER. IfSORT = 'N',SDIM = 0. IfSORT = 'S',SDIM =number of eigenvalues (after sorting) for whichSELCTGis true. (Complex conjugate pairs for whichSELCTGis true for either eigenvalue count as 2.)ALPHARβDOUBLE PRECISIONarray, dimension(N).ALPHAIβDOUBLE PRECISIONarray, dimension(N).BETAβDOUBLE PRECISIONarray, dimension(N). On exit,(ALPHAR(j) + ALPHAI(j)*i)/BETA(j),j=1,...,N, will be the generalized eigenvalues.ALPHAR(j) + ALPHAI(j)*iandBETA(j),j=1,...,Nare the diagonals of the complex Schur form(S,T)that would result if the 2-by-2 diagonal blocks of the real Schur form of(A,B)were further reduced to triangular form using 2-by-2 complex unitary transformations. 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 quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j) may easily over- or underflow, and BETA(j) may even be zero. Thus, the user should avoid naively computing the ratio. However, ALPHAR and ALPHAI will be always less than and usually comparable with norm(A) in magnitude, and BETA always less than and usually comparable with norm(B).
VSLβDOUBLE PRECISIONarray, dimension(LDVSL,N). IfJOBVSL = 'V',VSLwill contain the left Schur vectors. Not referenced ifJOBVSL = 'N'.LDVSLβINTEGER. The leading dimension of the matrixVSL.LDVSL >=1, and ifJOBVSL = 'V',LDVSL >= N.VSRβDOUBLE PRECISIONarray, dimension(LDVSR,N). IfJOBVSR = 'V',VSRwill contain the right Schur vectors. Not referenced ifJOBVSR = 'N'.LDVSRβINTEGER. The leading dimension of the matrixVSR.LDVSR >= 1, and ifJOBVSR = 'V',LDVSR >= N.RCONDEβDOUBLE PRECISIONarray, dimension( 2 ). IfSENSE = 'E'or'B',RCONDE(1)andRCONDE(2)contain the reciprocal condition numbers for the average of the selected eigenvalues. Not referenced ifSENSE = 'N'or'V'.RCONDVβDOUBLE PRECISIONarray, dimension( 2 ). IfSENSE = 'V'or'B',RCONDV(1)andRCONDV(2)contain the reciprocal condition numbers for the selected deflating subspaces. Not referenced ifSENSE = 'N'or'E'.WORKWORKβ aDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)). Bestie, on exit, ifINFO = 0, thenWORK(1)hands you back the optimalLWORKπ (it's like a little receipt telling you what size you should have used).LWORKβINTEGER, the dimension of theWORKarray. Here's the sizing tea π΅: ifN = 0, thenLWORK >= 1; else ifSENSE = 'E','V', or'B', thenLWORK >= max( 8*N, 6*N+16, 2*SDIM*(N-SDIM) ); otherwiseLWORK >= max( 8*N, 6*N+16 ). Also note that2*SDIM*(N-SDIM) <= N*N/2, and note also that an error is only returned ifLWORK < max( 8*N, 6*N+16)β but ifSENSE = 'E'or'V'or'B', that might legitimately not be large enough π. And ifLWORK = -1, it's a workspace query: the routine only calculates the bound on the optimal size of theWORKarray and the minimum size of theIWORKarray, returns these values as the first entries of theWORKandIWORKarrays, and no error message related toLWORKorLIWORKis issued byXERBLAβ¨.IWORKβ anINTEGERarray, dimension(MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the minimumLIWORKπ«Ά.LIWORKβINTEGER, the dimension of theIWORKarray. IfSENSE = 'N'orN = 0, thenLIWORK >= 1; otherwiseLIWORK >= N+6.
And 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.
BWORKβ aLOGICALarray, dimension(N). Not referenced ifSORT = 'N'π (she simply doesn't get invited to that party).INFOβINTEGER, the vibe check at the end π:= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value, no cap.= 1,...,N: the QZ iteration failed.(A,B)are not in Schur form, butALPHAR(j),ALPHAI(j), andBETA(j)should be correct forj=INFO+1,...,Nπ€.> N:=N+1: something other than QZ iteration failed inDHGEQZ=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 π¬=N+3: reordering failed inDTGSEN
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π§ Further Details:
An approximate (asymptotic) bound on the average absolute error of the selected eigenvalues is
EPS * norm((A, B)) / RCONDE( 1 ).
An approximate (asymptotic) bound on the maximum angular error in the computed deflating subspaces is
EPS * norm((A, B)) / RCONDV( 2 ).
See LAPACK User's Guide, section 4.11 for more information π.
Definition at line 361 of file dggesx.f.
π¦ subroutine sggesx
Okay bestie, deep breath, here comes the real-valued sibling and her signature is a whole mood π:
subroutine sggesx (character jobvsl, character jobvsr, character sort,
external selctg, character sense, integer n, real, dimension( lda, * )
a, integer lda, real, dimension( ldb, * ) b, integer ldb, integer sdim,
real, dimension( * ) alphar, real, dimension( * ) alphai, real,
dimension( * ) beta, real, dimension( ldvsl, * ) vsl, integer ldvsl,
real, dimension( ldvsr, * ) vsr, integer ldvsr, real, dimension( 2 )
rconde, real, dimension( 2 ) rcondv, real, dimension( * ) work, integer
lwork, integer, dimension( * ) iwork, integer liwork, logical,
dimension( * ) bwork, integer info)
SGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices π
β¨ Purpose:
SGGESX computes, for a pair of N-by-N real nonsymmetric matrices (A,B), the generalized eigenvalues, the real Schur form (S,T), and, optionally, the left and/or right matrices of Schur vectors (VSL and VSR). This gives the generalized Schur factorization π¦
(A,B) = ( (VSL) S (VSR)**T, (VSL) T (VSR)**T )
Optionally, it also orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper quasi-triangular matrix S and the upper triangular matrix T; 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) π. The leading columns of VSL and VSR then form an orthonormal basis for the corresponding left and right eigenspaces (deflating subspaces).
A generalized eigenvalue for a pair of matrices (A,B) is 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 being zero πΈ.
A pair of matrices (S,T) is in generalized real Schur form if T is upper triangular with non-negative diagonal and S is block upper triangular with 1-by-1 and 2-by-2 blocks. The 1-by-1 blocks correspond to real generalized eigenvalues, while 2-by-2 blocks of S will be by making the corresponding elements of T have the form:
[ a 0 ]
[ 0 b ]
and the pair of corresponding 2-by-2 blocks in S and T will have a complex conjugate pair of generalized eigenvalues β¨.
π Parameters
JOBVSLβCHARACTER*1.= 'N': do not compute the left Schur vectors;= 'V': compute the left Schur vectors.
JOBVSRβCHARACTER*1.= 'N': do not compute the right Schur vectors;= 'V': compute the right Schur vectors.
SORTβ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β aLOGICAL FUNCTIONof threeREALarguments.SELCTGmust be declaredEXTERNALin the calling subroutine π«‘. IfSORT = 'N',SELCTGis not referenced. IfSORT = 'S',SELCTGis used to select eigenvalues to sort to the top left of the Schur form.
An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected if SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true β i.e. if either one of a complex conjugate pair of eigenvalues is selected, then both complex eigenvalues are selected π―ββοΈ. Note that a selected complex eigenvalue may no longer satisfy SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) = .TRUE. after ordering, since ordering may change the value of complex eigenvalues (especially if the eigenvalue is ill-conditioned); in this case INFO is set to N+3 π.
SENSEβCHARACTER*1. Determines which reciprocal condition numbers are computed.= 'N': none are computed;= 'E': computed for average of selected eigenvalues only;= 'V': computed for selected deflating subspaces only;= 'B': computed for both.
If SENSE = 'E', 'V', or 'B', SORT must equal 'S' β οΈ.
NβINTEGER. The order of the matricesA,B,VSL, andVSR.N >= 0.AβREALarray, dimension(LDA, N). On entry, the first of the pair of matrices. On exit,Ahas been overwritten by its generalized Schur formSπ.LDAβINTEGER. The leading dimension ofA.LDA >= max(1,N).BβREALarray, dimension(LDB, N). On entry, the second of the pair of matrices. On exit,Bhas been overwritten by its generalized Schur formTπ.LDBβINTEGER. The leading dimension ofB.LDB >= max(1,N).SDIMβINTEGER. IfSORT = 'N',SDIM = 0. IfSORT = 'S',SDIM= number of eigenvalues (after sorting) for whichSELCTGis true. (Complex conjugate pairs for whichSELCTGis true for either eigenvalue count as2) π.ALPHARβREALarray, dimension(N).ALPHAIβREALarray, dimension(N).BETAβ β¨ (hold that thought, bestie β this one's deets roll in next)BETAβBETAisREALarray, dimension(N). On exit,(ALPHAR(j) + ALPHAI(j)*i)/BETA(j),j=1,...,N, will be the generalized eigenvalues.ALPHAR(j) + ALPHAI(j)*iandBETA(j),j=1,...,Nare the diagonals of the complex Schur form(S,T)that would result if the 2-by-2 diagonal blocks of the real Schur form of(A,B)were further reduced to triangular form using 2-by-2 complex unitary transformations. 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.
β οΈ bestie pls read this one: the quotientsALPHAR(j)/BETA(j)andALPHAI(j)/BETA(j)may easily over- or underflow, andBETA(j)may even be zero. So like... do not naively compute the ratio, okay? π However,ALPHARandALPHAIwill always be less than and usually comparable withnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B).
VSL
VSLβVSLisREALarray, dimension(LDVSL,N). IfJOBVSL = 'V',VSLwill contain the left Schur vectors. Not referenced ifJOBVSL = 'N'. π
LDVSL
LDVSLβLDVSLisINTEGER. The leading dimension of the matrixVSL.LDVSL >= 1, and ifJOBVSL = 'V',LDVSL >= N.
VSR
VSRβVSRisREALarray, dimension(LDVSR,N). IfJOBVSR = 'V',VSRwill contain the right Schur vectors. Not referenced ifJOBVSR = 'N'. π¦
LDVSR
LDVSRβLDVSRisINTEGER. The leading dimension of the matrixVSR.LDVSR >= 1, and ifJOBVSR = 'V',LDVSR >= N.
RCONDE
RCONDEβRCONDEisREALarray, dimension( 2 ). IfSENSE = 'E'or'B',RCONDE(1)andRCONDE(2)contain the reciprocal condition numbers for the average of the selected eigenvalues. Not referenced ifSENSE = 'N'or'V'. πΈ
RCONDV
RCONDVβRCONDVisREALarray, dimension( 2 ). IfSENSE = 'V'or'B',RCONDV(1)andRCONDV(2)contain the reciprocal condition numbers for the selected deflating subspaces. Not referenced ifSENSE = 'N'or'E'. β¨
WORK
WORKβWORKisREALarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. π
LWORK
LWORKβLWORKisINTEGER. The dimension of the arrayWORK. IfN = 0,LWORK >= 1, else ifSENSE = 'E','V', or'B',LWORK >= max( 8*N, 6*N+16, 2*SDIM*(N-SDIM) ), elseLWORK >= max( 8*N, 6*N+16 ). Note that2*SDIM*(N-SDIM) <= N*N/2. Note also that an error is only returned ifLWORK < max( 8*N, 6*N+16), but ifSENSE = 'E'or'V'or'B'this may not be large enough.
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. π
IWORK
IWORKβIWORKisINTEGERarray, dimension(MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the minimumLIWORK.
LIWORK
LIWORKβLIWORKisINTEGER. The dimension of the arrayIWORK. IfSENSE = 'N'orN = 0,LIWORK >= 1, otherwiseLIWORK >= N+6.
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. π«Ά
BWORK
BWORKβBWORKisLOGICALarray, dimension(N). Not referenced ifSORT = 'N'. π
INFO
INFOβINFOisINTEGER= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value.= 1,...,N: The QZ iteration failed.(A,B)are not in Schur form, butALPHAR(j),ALPHAI(j), andBETA(j)should be correct forj=INFO+1,...,N. π> N:=N+1: other than QZ iteration failed inSHGEQZ=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. π=N+3: reordering failed inSTGSEN.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π₯ Further Details:
An approximate (asymptotic) bound on the average absolute error of the selected eigenvalues is
EPS * norm((A, B)) / RCONDE( 1 ).
An approximate (asymptotic) bound on the maximum angular error in the computed deflating subspaces is
EPS * norm((A, B)) / RCONDV( 2 ).
See LAPACK User's Guide, section 4.11 for more information. π
Definition at line 361 of file sggesx.f.
π§ subroutine zggesx (character jobvsl, character jobvsr, character sort, external selctg, character sense, integer n, complex*16, dimension( lda, * ) a, integer lda, complex*16, dimension( ldb, * ) b, integer ldb, integer sdim, complex*16, dimension( * ) alpha, complex*16, dimension( * ) beta, complex*16, dimension( ldvsl, * ) vsl, integer ldvsl, complex*16, dimension( ldvsr, * ) vsr, integer ldvsr, double precision, dimension( 2 ) rconde, double precision, dimension( 2 ) rcondv, complex*16, dimension( * ) work, integer lwork, double precision, dimension( * ) rwork, integer, dimension( * ) iwork, integer liwork, logical, dimension( * ) bwork, integer info)
subroutine zggesx (character jobvsl, character jobvsr, character sort,
external selctg, character sense, integer n, complex*16, dimension( lda,
* ) a, integer lda, complex*16, dimension( ldb, * ) b, integer ldb,
integer sdim, complex*16, dimension( * ) alpha, complex*16, dimension( *
) beta, complex*16, dimension( ldvsl, * ) vsl, integer ldvsl,
complex*16, dimension( ldvsr, * ) vsr, integer ldvsr, double precision,
dimension( 2 ) rconde, double precision, dimension( 2 ) rcondv,
complex*16, dimension( * ) work, integer lwork, double precision,
dimension( * ) rwork, integer, dimension( * ) iwork, integer liwork,
logical, dimension( * ) bwork, integer info)
ZGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices β¨
π Purpose:
ZGGESX computes for a pair of N-by-N complex nonsymmetric matrices (A,B), the generalized eigenvalues, the complex Schur form (S,T), and, optionally, the left and/or right matrices of Schur vectors (VSL and VSR). This gives the generalized Schur factorization
(A,B) = ( (VSL) S (VSR)**H, (VSL) T (VSR)**H )
where (VSR)**H is the conjugate-transpose of VSR. πͺ
Optionally, it also 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; 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). The leading columns of VSL and VSR then form an orthonormal basis for the corresponding left and right eigenspaces (deflating subspaces). π¦
A generalized eigenvalue for a pair of matrices (A,B) is a scalar w or a ratio alpha/beta = w, such that A - w*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0 or for both being zero. π
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. slay. π
π Parameters
JOBVSL
JOBVSLβJOBVSLisCHARACTER*1= 'N': do not compute the left Schur vectors;= 'V': compute the left Schur vectors.
JOBVSR
JOBVSRβJOBVSRisCHARACTER*1= 'N': do not compute the right Schur vectors;= 'V': compute the right Schur vectors.
SORT
SORTβSORTisCHARACTER*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βSELCTGis aLOGICALFUNCTION of twoCOMPLEX*16arguments.SELCTGmust be declaredEXTERNALin the calling subroutine. IfSORT = 'N',SELCTGis not referenced. IfSORT = 'S',SELCTGis used to select eigenvalues to sort to the top left of the Schur form.
π heads up: 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. not me warning you twice π
SENSE
SENSEβSENSEisCHARACTER*1. Determines which reciprocal condition numbers are computed.= 'N': None are computed;= 'E': Computed for average of selected eigenvalues only;= 'V': Computed for selected deflating subspaces only;= 'B': Computed for both.
If SENSE = 'E', 'V', or 'B', SORT must equal 'S'. π¨
N
NβNisINTEGER. The order of the matricesA,B,VSL, andVSR.N >= 0.
A
AβAisCOMPLEX*16array, dimension(LDA, N). On entry, the first of the pair of matrices. On exit,Ahas been overwritten by its generalized Schur formS. π«ΆLDAβLDAisINTEGER, bestie. It's the leading dimension ofA, and the rule isLDA >= max(1,N). No cap. β¨BβBisCOMPLEX*16 array, dimension (LDB, N). On entry, it's the second of the pair of matrices. On exit,Bhas been overwritten by its generalized Schur formT. She's booked and busy. πLDBβLDBisINTEGER. It's the leading dimension ofB, andLDB >= max(1,N). Respect the leading dimension or catch hands. π«ΆSDIMβSDIMisINTEGER. IfSORT = 'N', thenSDIM = 0. IfSORT = 'S', thenSDIM= number of eigenvalues (after sorting) for whichSELCTGis true.ALPHAβALPHAisCOMPLEX*16 array, dimension (N). That's it, that's the whole entry.BETAβBETAisCOMPLEX*16 array, dimension (N). On exit,ALPHA(j)/BETA(j),j=1,...,N, will be the generalized eigenvalues.ALPHA(j)andBETA(j),j=1,...,Nare the diagonals of the complex Schur form(S,T).BETA(j)will be non-negative real.
Note: 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 likeβ¦ don't just divide and pray, okay? π
VSLβVSLisCOMPLEX*16 array, dimension (LDVSL,N). IfJOBVSL = 'V',VSLwill contain the left Schur vectors. Not referenced ifJOBVSL = 'N'. Left Schur vectors stay iconic. πLDVSLβLDVSLisINTEGER. It's the leading dimension of the matrixVSL.LDVSL >=1, and ifJOBVSL = 'V', thenLDVSL >= N.VSRβVSRisCOMPLEX*16 array, dimension (LDVSR,N). IfJOBVSR = 'V',VSRwill contain the right Schur vectors. Not referenced ifJOBVSR = 'N'. Right Schur vectors, main character energy. πLDVSRβLDVSRisINTEGER. It's the leading dimension of the matrixVSR.LDVSR >= 1, and ifJOBVSR = 'V', thenLDVSR >= N.RCONDEβRCONDEisDOUBLE PRECISION array, dimension ( 2 ). IfSENSE = 'E'or'B',RCONDE(1)andRCONDE(2)contain the reciprocal condition numbers for the average of the selected eigenvalues. Not referenced ifSENSE = 'N'or'V'. Condition number tea, served hot. πRCONDVβRCONDVisDOUBLE PRECISION array, dimension ( 2 ). IfSENSE = 'V'or'B',RCONDV(1)andRCONDV(2)contain the reciprocal condition number for the selected deflating subspaces. Not referenced ifSENSE = 'N'or'E'.WORKβWORKisCOMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. Workspace said "I'll handle it" and honestly she did. β¨LWORKβLWORKisINTEGER. It's the dimension of the arrayWORK.
If N = 0, then LWORK >= 1; else if SENSE = 'E', 'V', or 'B', then 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.
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.
RWORKβRWORKisDOUBLE PRECISION array, dimension ( 8*N ). Real workspace. Keeping it real, literally. πIWORKβIWORKisINTEGER array, dimension (MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the minimumLIWORK.LIWORKβLIWORKisINTEGER. It's the dimension of the arrayIWORK.
If SENSE = 'N' or N = 0, then 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.
BWORKβBWORKisLOGICAL array, dimension (N). Not referenced ifSORT = 'N'. Logic only when needed, periodt. πINFOβINFOisINTEGER. Here's the whole status tea:= 0: successful exit.< 0: ifINFO = -i, the i-th argument had an illegal value.= 1,...,N: The QZ iteration failed.(A,B)are not in Schur form, butALPHA(j)andBETA(j)should be correct forj=INFO+1,...,N.> N:=N+1: other than QZ iteration failed inZHGEQZ=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.=N+3: reordering failed inZTGSEN.
Author πΈ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 326 of file zggesx.f.
Author β¨
Generated automatically by Doxygen for LAPACK from the source code.
Okay that's the whole ggesx(3) page, bestie π β footer source/version: LAPACK Version 3.12.0, page: ggesx(3). Date isn't shown in this excerpt, so no invented timestamp β periodt. Now go hydrate and slay your linear algebra. πβ¨
π¦ 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