hgeqz(3)
π hgeqz(3) β Library Functions Manual π
okay bestie, welcome to the hgeqz(3) page β this is the generalized Hessenberg eig situation, and yes it's giving big linear-algebra main character energy. Grab a strawberry π and let's get into it.
β¨ NAME β¨
hgeqzβhgeqz: generalized Hessenberg eig
π SYNOPSIS π
Functions
subroutine chgeqz (job, compq, compz, n, ilo, ihi, h, ldh, t, ldt,
alpha, beta, q, ldq, z, ldz, work, lwork, rwork, info)
CHGEQZ
subroutine dhgeqz (job, compq, compz, n, ilo, ihi, h, ldh, t, ldt,
alphar, alphai, beta, q, ldq, z, ldz, work, lwork, info)
DHGEQZ
subroutine shgeqz (job, compq, compz, n, ilo, ihi, h, ldh, t, ldt,
alphar, alphai, beta, q, ldq, z, ldz, work, lwork, info)
SHGEQZ
subroutine zhgeqz (job, compq, compz, n, ilo, ihi, h, ldh, t, ldt,
alpha, beta, q, ldq, z, ldz, work, lwork, rwork, info)
ZHGEQZ
π Detailed Description π
this is the big-picture section, and then Function Documentation does the actual signature + parameter tea π
π οΈ Function Documentation π οΈ
π
chgeqz π
subroutine chgeqz (character job, character compq, character compz, integer
n, integer ilo, integer ihi, complex, dimension( ldh, * ) h, integer
ldh, complex, dimension( ldt, * ) t, integer ldt, complex, dimension( *
) alpha, complex, dimension( * ) beta, complex, dimension( ldq, * ) q,
integer ldq, complex, dimension( ldz, * ) z, integer ldz, complex,
dimension( * ) work, integer lwork, real, dimension( * ) rwork, integer
info)
CHGEQZ
π Purpose π
okay so CHGEQZ computes the eigenvalues of a complex matrix pair (H,T), where H is an upper Hessenberg matrix and T is upper triangular, using the single-shift QZ method. Matrix pairs of this type are produced by the reduction to generalized upper Hessenberg form of a complex matrix pair (A,B):
A = Q1*H*Z1**H, B = Q1*T*Z1**H,
as computed by CGGHRD.
If JOB='S', then the Hessenberg-triangular pair (H,T) is also reduced to generalized Schur form:
H = Q*S*Z**H, T = Q*P*Z**H,
where Q and Z are unitary matrices and S and P are upper triangular.
Optionally, the unitary matrix Q from the generalized Schur factorization may be postmultiplied into an input matrix Q1, and the unitary matrix Z may be postmultiplied into an input matrix Z1. If Q1 and Z1 are the unitary matrices from CGGHRD that reduced the matrix pair (A,B) to generalized Hessenberg form, then the output matrices Q1*Q and Z1*Z are the unitary factors from the generalized Schur factorization of (A,B):
A = (Q1*Q)*S*(Z1*Z)**H, B = (Q1*Q)*P*(Z1*Z)**H.
To avoid overflow, eigenvalues of the matrix pair (H,T) (equivalently, of (A,B)) are computed as a pair of complex values (alpha,beta). If beta is nonzero, lambda = alpha / beta is an eigenvalue of the generalized nonsymmetric eigenvalue problem (GNEP)
A*x = lambda*B*x
and if alpha is nonzero, mu = beta / alpha is an eigenvalue of the alternate form of the GNEP
mu*A*y = B*y.
The values of alpha and beta for the i-th eigenvalue can be read directly from the generalized Schur form: alpha = S(i,i), beta = P(i,i).
Ref: C.B. Moler & G.W. Stewart, , SIAM J. Numer. Anal., 10(1973), pp. 241--256.
π§Ύ Parameters π§Ύ
JOBβJOB is CHARACTER*1= 'E': compute eigenvalues only;= 'S': Computer eigenvalues and the Schur form. yes bestie, the page literally saysComputer, notComputeβ I'm not fixing it, I'm preserving the lore π
COMPQβCOMPQ is CHARACTER*1= 'N': Left Schur vectors (Q) are not computed;= 'I':Qis initialized to the unit matrix and the matrixQof left Schur vectors of(H,T)is returned;= 'V':Qmust contain a unitary matrixQ1on entry and the productQ1*Qis returned.
COMPZβCOMPZ is CHARACTER*1= 'N': Right Schur vectors (Z) are not computed;= 'I':Qis initialized to the unit matrix and the matrixZof right Schur vectors of(H,T)is returned; yes, the page saysQhere underCOMPZ, and I am keeping that exactly as written π= 'V':Zmust contain a unitary matrixZ1on entry and the productZ1*Zis returned.
NβN is INTEGER- The order of the matrices
H,T,Q, andZ.N >= 0.
- The order of the matrices
ILOβILO is INTEGERIHIβIHI is INTEGERILOandIHImark the rows and columns ofHwhich are in Hessenberg form. It is assumed thatAis already upper triangular in rows and columns1:ILO-1andIHI+1:N. IfN > 0,1 <= ILO <= IHI <= N; ifN = 0,ILO=1andIHI=0.
HβH is COMPLEX array, dimension (LDH, N)- On entry, the
N-by-Nupper Hessenberg matrixH. - On exit, if
JOB = 'S',Hcontains the upper triangular matrixSfrom the generalized Schur factorization. - If
JOB = 'E', the diagonal ofHmatches that ofS, but the rest ofHis unspecified.
- On entry, the
LDHβLDH is INTEGER- The leading dimension of the array
H.LDH >= max( 1, N ).
- The leading dimension of the array
TβT is COMPLEX array, dimension (LDT, N)- On entry, the
N-by-Nupper triangular matrixT. - On exit, if
JOB = 'S',Tcontains the upper triangular matrixPfrom the generalized Schur factorization. - If
JOB = 'E', the diagonal ofTmatches that ofP, but the rest ofTis unspecified.
- On entry, the
LDTβLDT is INTEGER- The leading dimension of the array
T.LDT >= max( 1, N ).
- The leading dimension of the array
ALPHAβALPHA is COMPLEX array, dimension (N)- The complex scalars
alphathat define the eigenvalues of GNEP.ALPHA(i) = S(i,i)in the generalized Schur factorization.
- The complex scalars
BETAβBETA is COMPLEX array, dimension (N)- The real non-negative scalars
betathat define the eigenvalues of GNEP.BETA(i) = P(i,i)in the generalized Schur factorization. - yes, the type is
COMPLEXand the blurb calls them real non-negative scalars β that's literally what the page says, bestie π«Ά - Together, the quantities
alpha = ALPHA(j)andbeta = BETA(j)represent the j-th eigenvalue of the matrix pair(A,B), in one of the formslambda = alpha/betaormu = beta/alpha. - Since either
lambdaormumay overflow, they should not, in general, be computed.
- The real non-negative scalars
QβQ is COMPLEX array, dimension (LDQ, N)- On entry, if
COMPQ = 'V', the unitary matrixQ1used in the reduction of(A,B)to generalized Hessenberg form. - On exit, if
COMPQ = 'I', the unitary matrix of left Schur vectors of(H,T), and ifCOMPQ = 'V', the unitary matrix of left Schur vectors of(A,B). - Not referenced if
COMPQ = 'N'.
- On entry, if
LDQβLDQ is INTEGER- The leading dimension of the array
Q.LDQ >= 1. - If
COMPQ='V'or'I', thenLDQ >= N.
- The leading dimension of the array
ZβZ is COMPLEX array, dimension (LDZ, N)- On entry, if
COMPZ = 'V', the unitary matrixZ1used in the reduction of(A,B)to generalized Hessenberg form. - On exit, if
COMPZ = 'I', the unitary matrix of right Schur vectors of(H,T), and ifCOMPZ = 'V', the unitary matrix of right Schur vectors of(A,B). - Not referenced if
COMPZ = 'N'.
- On entry, if
LDZβLDZ is INTEGER- The leading dimension of the array
Z.LDZ >= 1. - If
COMPZ='V'or'I', thenLDZ >= N.
- The leading dimension of the array
WORKβWORK is COMPLEX array, dimension (MAX(1,LWORK))- On exit, if
INFO >= 0,WORK(1)returns the optimalLWORK.
- On exit, if
LWORKβLWORK is INTEGER- The dimension of the array
WORK.LWORK >= max(1,N). - If
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.
- The dimension of the array
RWORKβRWORK is REAL array, dimension (N)INFOβINFO is INTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value= 1,...,N: the QZ iteration did not converge.(H,T)is not in Schur form, butALPHA(i)andBETA(i),i=INFO+1,...,Nshould be correct.= N+1,...,2*N: the shift calculation failed.(H,T)is not in Schur form, butALPHA(i)andBETA(i),i=INFO-N+1,...,Nshould be correct.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π₯ Further Details π₯
We assume that complex ABS works as long as its value is less than overflow.
π Definition at line 281 of file chgeqz.f.
π₯ dhgeqz π₯
subroutine dhgeqz (character job, character compq, character compz, integer
n, integer ilo, integer ihi, double precision, dimension( ldh, * ) h,
integer ldh, double precision, dimension( ldt, * ) t, integer ldt,
double precision, dimension( * ) alphar, double precision, dimension( *
) alphai, double precision, dimension( * ) beta, double precision,
dimension( ldq, * ) q, integer ldq, double precision, dimension( ldz, *
) z, integer ldz, double precision, dimension( * ) work, integer lwork,
integer info)
DHGEQZ
π Purpose π
okay so DHGEQZ is out here computing the eigenvalues of a real matrix pair (H,T) β where H is an upper Hessenberg matrix and T is upper triangular β using the double-shift QZ method. π
and like, where do these pairs even come from? bestie they're produced by the reduction to generalized upper Hessenberg form of a real matrix pair (A,B):
A = Q1*H*Z1**T, B = Q1*T*Z1**T,
as computed by DGGHRD. that's the pipeline, iykyk. β¨
so if JOB='S', the Hessenberg-triangular pair (H,T) also gets reduced to generalized Schur form:
H = Q*S*Z**T, T = Q*P*Z**T,
where Q and Z are orthogonal matrices, P is an upper triangular matrix, and S is a quasi-triangular matrix with 1-by-1 and 2-by-2 diagonal blocks. π
the 1-by-1 blocks correspond to real eigenvalues of the matrix pair (H,T) and the 2-by-2 blocks correspond to complex conjugate pairs of eigenvalues. periodt. π¦
additionally (yes there's more, she's thorough), the 2-by-2 upper triangular diagonal blocks of P corresponding to 2-by-2 blocks of S are reduced to positive diagonal form, i.e., if S(j+1,j) is non-zero, then P(j+1,j) = P(j,j+1) = 0, P(j,j) > 0, and P(j+1,j+1) > 0. πΈ
optionally, the orthogonal matrix Q from the generalized Schur factorization may be postmultiplied into an input matrix Q1, and the orthogonal matrix Z may be postmultiplied into an input matrix Z1. and if Q1 and Z1 are the orthogonal matrices from DGGHRD that reduced the matrix pair (A,B) to generalized upper Hessenberg form, then the output matrices Q1*Q and Z1*Z are the orthogonal factors from the generalized Schur factorization of (A,B):
A = (Q1*Q)*S*(Z1*Z)**T, B = (Q1*Q)*P*(Z1*Z)**T.
iconic behavior honestly. π
to avoid overflow, eigenvalues of the matrix pair(H,T)(equivalently, of(A,B)) are computed as a pair of values(alpha,beta), wherealphais complex andbetareal. so ifbetais nonzero,lambda = alpha / betais an eigenvalue of the generalized nonsymmetric eigenvalue problem (GNEP)A*x = lambda*B*xβ and ifalphais nonzero,mu = beta / alphais an eigenvalue of the alternate form of the GNEPmu*A*y = B*y. real eigenvalues can be read directly from the generalized Schur form:alpha = S(i,i),beta = P(i,i). π«Ά
Ref: C.B. Moler & G.W. Stewart, , SIAM J. Numer. Anal., 10(1973), pp. 241--256. (yes the double comma is in the original, no i'm not fixing it, it's part of the lore π―οΈ)
β¨ Parameters β¨
JOBβJOB is CHARACTER*1= 'E': Compute eigenvalues only;= 'S': Compute eigenvalues and the Schur form.
COMPQβCOMPQ is CHARACTER*1= 'N': Left Schur vectors (Q) are not computed;= 'I':Qis initialized to the unit matrix and the matrixQof left Schur vectors of(H,T)is returned;= 'V':Qmust contain an orthogonal matrixQ1on entry and the productQ1*Qis returned.
COMPZβCOMPZ is CHARACTER*1= 'N': Right Schur vectors (Z) are not computed;= 'I':Zis initialized to the unit matrix and the matrixZof right Schur vectors of(H,T)is returned;= 'V':Zmust contain an orthogonal matrixZ1on entry and the productZ1*Zis returned.
NβN is INTEGER. the order of the matricesH,T,Q, andZ.N >= 0. πILOβILO is INTEGERIHIβIHI is INTEGER.ILOandIHImark the rows and columns ofHwhich are in Hessenberg form. it is assumed thatAis already upper triangular in rows and columns1:ILO-1andIHI+1:N. ifN > 0,1 <= ILO <= IHI <= N; ifN = 0,ILO=1andIHI=0.HβH is DOUBLE PRECISION array, dimension (LDH, N). on entry, theN-by-Nupper Hessenberg matrixH. on exit, ifJOB = 'S',Hcontains the upper quasi-triangular matrixSfrom the generalized Schur factorization. ifJOB = 'E', the diagonal blocks ofHmatch those ofS, but the rest ofHis unspecified β don't go poking at it, bestie. πLDHβLDH is INTEGER. the leading dimension of the arrayH.LDH >= max( 1, N ).TβT is DOUBLE PRECISION array, dimension (LDT, N). on entry, theN-by-Nupper triangular matrixT. on exit, ifJOB = 'S',Tcontains the upper triangular matrixPfrom the generalized Schur factorization; 2-by-2 diagonal blocks ofPcorresponding to 2-by-2 blocks ofSare reduced to positive diagonal form, i.e., ifH(j+1,j)is non-zero, thenT(j+1,j) = T(j,j+1) = 0,T(j,j) > 0, andT(j+1,j+1) > 0. ifJOB = 'E', the diagonal blocks ofTmatch those ofP, but the rest ofTis unspecified. βLDTβLDT is INTEGER. the leading dimension of the arrayT.LDT >= max( 1, N ).ALPHARβALPHAR is DOUBLE PRECISION array, dimension (N). the real parts of each scalaralphadefining an eigenvalue of GNEP.ALPHAIβALPHAI is DOUBLE PRECISION array, dimension (N). the imaginary parts of each scalaralphadefining an eigenvalue of GNEP. ifALPHAI(j)is zero, then thej-th eigenvalue is real; if positive, then thej-th and(j+1)-st eigenvalues are a complex conjugate pair, withALPHAI(j+1) = -ALPHAI(j). cute lil pair, honestly π¦BETAβBETA is DOUBLE PRECISION array, dimension (N). the scalarsbetathat define the eigenvalues of GNEP. together, the quantitiesalpha = (ALPHAR(j),ALPHAI(j))andbeta = BETA(j)represent thej-th eigenvalue of the matrix pair(A,B), in one of the formslambda = alpha/betaormu = beta/alpha. since eitherlambdaormumay overflow, they should not, in general, be computed. π«ΆQβQ is DOUBLE PRECISION array, dimension (LDQ, N). on entry, ifCOMPQ = 'V', the orthogonal matrixQ1used in the reduction of(A,B)to generalized Hessenberg form. on exit, ifCOMPQ = 'I', the orthogonal matrix of left Schur vectors of(H,T), and ifCOMPQ = 'V', the orthogonal matrix of left Schur vectors of(A,B). not referenced ifCOMPQ = 'N'.LDQβLDQ is INTEGER. the leading dimension of the arrayQ.LDQ >= 1. ifCOMPQ='V'or'I', thenLDQ >= N.ZβZ is DOUBLE PRECISION array, dimension (LDZ, N). on entry, ifCOMPZ = 'V', the orthogonal matrixZ1used in the reduction of(A,B)to generalized Hessenberg form. on exit, ifCOMPZ = 'I', the orthogonal matrix of right Schur vectors of(H,T), and ifCOMPZ = 'V', the orthogonal matrix of right Schur vectors of(A,B). not referenced ifCOMPZ = 'N'.LDZβLDZ is INTEGER. the leading dimension of the arrayZ.LDZ >= 1. ifCOMPZ='V'or'I', thenLDZ >= N.WORKβWORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)). on exit, ifINFO >= 0,WORK(1)returns the optimalLWORK. πLWORKβLWORK is INTEGER. the dimension of the arrayWORK.LWORK >= max(1,N).- if
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. (it's giving "just asking, not committing" energy π )
- if
INFOβINFO is INTEGER= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value= 1,...,N: the QZ iteration did not converge.(H,T)is not in Schur form, butALPHAR(i),ALPHAI(i), andBETA(i),i=INFO+1,...,Nshould be correct.= N+1,...,2*N: the shift calculation failed.(H,T)is not in Schur form, butALPHAR(i),ALPHAI(i), andBETA(i),i=INFO-N+1,...,Nshould be correct.
read the INFO values carefully bestie β a nonzero return doesn't mean everything's trash, it means some of it is correct and some of it isn't, and the exact range matters. π
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Further Details π
iteration counters, bestie:
JITERβ counts iterations.IITERβ counts iterations run sinceILASTwas last changed. this is therefore reset only when a 1-by-1 or 2-by-2 block deflates off the bottom. π
Definition at line 301 of file dhgeqz.f.
π¦ SHGEQZ π¦
subroutine shgeqz (character job, character compq, character compz, integer
n, integer ilo, integer ihi, real, dimension( ldh, * ) h, integer ldh,
real, dimension( ldt, * ) t, integer ldt, real, dimension( * ) alphar,
real, dimension( * ) alphai, real, dimension( * ) beta, real, dimension(
ldq, * ) q, integer ldq, real, dimension( ldz, * ) z, integer ldz, real,
dimension( * ) work, integer lwork, integer info)
β¨ Purpose β¨
SHGEQZ computes the eigenvalues of a real matrix pair (H,T), where H is an upper Hessenberg matrix and T is upper triangular, using the double-shift QZ method. periodt π
Matrix pairs of this type are produced by the reduction to generalized upper Hessenberg form of a real matrix pair (A,B):
A = Q1*H*Z1**T, B = Q1*T*Z1**T,
as computed by SGGHRD.
If JOB='S', then the Hessenberg-triangular pair (H,T) is also reduced to generalized Schur form,
H = Q*S*Z**T, T = Q*P*Z**T,
where Q and Z are orthogonal matrices, P is an upper triangular matrix, and S is a quasi-triangular matrix with 1-by-1 and 2-by-2 diagonal blocks.
The 1-by-1 blocks correspond to real eigenvalues of the matrix pair (H,T) and the 2-by-2 blocks correspond to complex conjugate pairs of eigenvalues. the way that math lines up is honestly iconic β¨
Additionally, the 2-by-2 upper triangular diagonal blocks of P corresponding to 2-by-2 blocks of S are reduced to positive diagonal form, i.e., if S(j+1,j) is non-zero, then P(j+1,j) = P(j,j+1) = 0, P(j,j) > 0, and P(j+1,j+1) > 0.
Optionally, the orthogonal matrix Q from the generalized Schur factorization may be postmultiplied into an input matrix Q1, and the orthogonal matrix Z may be postmultiplied into an input matrix Z1. If Q1 and Z1 are the orthogonal matrices from SGGHRD that reduced the matrix pair (A,B) to generalized upper Hessenberg form, then the output matrices Q1*Q and Z1*Z are the orthogonal factors from the generalized Schur factorization of (A,B):
A = (Q1*Q)*S*(Z1*Z)**T, B = (Q1*Q)*P*(Z1*Z)**T.
To avoid overflow, eigenvalues of the matrix pair (H,T) (equivalently, of (A,B)) are computed as a pair of values (alpha,beta), where alpha is complex and beta real. If beta is nonzero, lambda = alpha / beta is an eigenvalue of the generalized nonsymmetric eigenvalue problem (GNEP)
A*x = lambda*B*x
and if alpha is nonzero, mu = beta / alpha is an eigenvalue of the alternate form of the GNEP
mu*A*y = B*y.
Real eigenvalues can be read directly from the generalized Schur form: alpha = S(i,i), beta = P(i,i). iykyk π¦
Ref: C.B. Moler & G.W. Stewart, , SIAM J. Numer. Anal., 10(1973), pp. 241--256.
β¨ Parameters β¨
JOBβJOBisCHARACTER*1= 'E': Compute eigenvalues only;= 'S': Compute eigenvalues and the Schur form.
COMPQβCOMPQisCHARACTER*1= 'N': Left Schur vectors (Q) are not computed;= 'I':Qis initialized to the unit matrix and the matrixQof left Schur vectors of(H,T)is returned;= 'V':Qmust contain an orthogonal matrixQ1on entry and the productQ1*Qis returned.
COMPZβCOMPZisCHARACTER*1= 'N': Right Schur vectors (Z) are not computed;= 'I':Zis initialized to the unit matrix and the matrixZof right Schur vectors of(H,T)is returned;= 'V':Zmust contain an orthogonal matrixZ1on entry and the productZ1*Zis returned.
NβNisINTEGERβ the order of the matricesH,T,Q, andZ.N >= 0.ILOβILOisINTEGERβ that's literally all this page says about it here, bestie. π«ΆIHIβIHIisINTEGERβILOandIHImark the rows and columns ofHwhich are in Hessenberg form. It is assumed thatAis already upper triangular in rows and columns1:ILO-1andIHI+1:N. IfN > 0,1 <= ILO <= IHI <= N; ifN = 0,ILO=1andIHI=0.HβHisREAL array, dimension (LDH, N)β On entry, the N-by-N upper Hessenberg matrixH. On exit, ifJOB = 'S',Hcontains the upper quasi-triangular matrixSfrom the generalized Schur factorization. IfJOB = 'E', the diagonal blocks ofHmatch those ofS, but the rest ofHis unspecified.LDHβLDHisINTEGERβ the leading dimension of the arrayH.LDH >= max( 1, N ).TβTisREAL array, dimension (LDT, N)β On entry, the N-by-N upper triangular matrixT. On exit, ifJOB = 'S',Tcontains the upper triangular matrixPfrom the generalized Schur factorization; 2-by-2 diagonal blocks ofPcorresponding to 2-by-2 blocks ofSare reduced to positive diagonal form, i.e., ifH(j+1,j)is non-zero, thenT(j+1,j) = T(j,j+1) = 0,T(j,j) > 0, andT(j+1,j+1) > 0. IfJOB = 'E', the diagonal blocks ofTmatch those ofP, but the rest ofTis unspecified.LDTβLDTisINTEGERβ the leading dimension of the arrayT.LDT >= max( 1, N ).ALPHARβALPHARisREAL array, dimension (N)β the real parts of each scalaralphadefining an eigenvalue of GNEP.ALPHAIβALPHAIisREAL array, dimension (N)β the imaginary parts of each scalaralphadefining an eigenvalue of GNEP. 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) = -ALPHAI(j).BETAβBETAisREAL array, dimension (N)β the scalarsbetathat define the eigenvalues of GNEP. Together, the quantitiesalpha = (ALPHAR(j),ALPHAI(j))andbeta = BETA(j)represent the j-th eigenvalue of the matrix pair(A,B), in one of the formslambda = alpha/betaormu = beta/alpha. Since eitherlambdaormumay overflow, they should not, in general, be computed. do not come for those unless you want overflow chaos πQβQisREAL array, dimension (LDQ, N)β On entry, ifCOMPQ = 'V', the orthogonal matrixQ1used in the reduction of(A,B)to generalized Hessenberg form. On exit, ifCOMPQ = 'I', the orthogonal matrix of left Schur vectors of(H,T), and ifCOMPQ = 'V', the orthogonal matrix of left Schur vectors of(A,B). Not referenced ifCOMPQ = 'N'.LDQβLDQisINTEGERβ the leading dimension of the arrayQ.LDQ >= 1. IfCOMPQ='V'or'I', thenLDQ >= N.ZβZisREAL array, dimension (LDZ, N)β On entry, ifCOMPZ = 'V', the orthogonal matrixZ1used in the reduction of(A,B)to generalized Hessenberg form. On exit, ifCOMPZ = 'I', the orthogonal matrix of right Schur vectors of(H,T), and ifCOMPZ = 'V', the orthogonal matrix of right Schur vectors of(A,B). Not referenced ifCOMPZ = 'N'.LDZβLDZisINTEGERβ the leading dimension of the arrayZ.LDZ >= 1. IfCOMPZ='V'or'I', thenLDZ >= N.WORKβWORKisREAL array, dimension (MAX(1,LWORK))β On exit, ifINFO >= 0,WORK(1)returns the optimalLWORK.LWORKβLWORKisINTEGERβ the dimension of the arrayWORK.LWORK >= max(1,N). IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.INFOβINFOisINTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value= 1,...,N: the QZ iteration did not converge.(H,T)is not in Schur form, butALPHAR(i),ALPHAI(i), andBETA(i),i=INFO+1,...,Nshould be correct.= N+1,...,2*N: the shift calculation failed.(H,T)is not in Schur form, butALPHAR(i),ALPHAI(i), andBETA(i),i=INFO-N+1,...,Nshould be correct.
πΈ Author πΈ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ Further Details π¦
Iteration counters:
JITER-- counts iterations.IITER-- counts iterations run sinceILASTwas last changed. This is therefore reset only when a 1-by-1 or 2-by-2 block deflates off the bottom.
Definition at line 301 of file shgeqz.f.
subroutine zhgeqz (character job, character compq, character compz, integer
n, integer ilo, integer ihi, complex*16, dimension( ldh, * ) h, integer
ldh, complex*16, dimension( ldt, * ) t, integer ldt, complex*16,
dimension( * ) alpha, complex*16, dimension( * ) beta, complex*16,
dimension( ldq, * ) q, integer ldq, complex*16, dimension( ldz, * ) z,
integer ldz, complex*16, dimension( * ) work, integer lwork, double
precision, dimension( * ) rwork, integer info)
π ZHGEQZ π
Purpose
okay so, back to the glow-up of (H,T) β ZHGEQZ computes the eigenvalues of a complex matrix pair (H,T), where H is an upper Hessenberg matrix and T is an upper triangular matrix, using the single-shift QZ method. Matrix pairs of this type are produced by the reduction to generalized upper Hessenberg form of a complex matrix pair (A,B):
A = Q1*H*Z1**H, B = Q1*T*Z1**H,
as computed by ZGGHRD.
If JOB='S', then the Hessenberg-triangular pair (H,T) is also reduced to generalized Schur form,
H = Q*S*Z**H, T = Q*P*Z**H,
where Q and Z are unitary matrices and S and P are upper triangular. Obsessed with a triangular glow-up.
Optionally, the unitary matrix Q from the generalized Schur factorization may be postmultiplied into an input matrix Q1, and the unitary matrix Z may be postmultiplied into an input matrix Z1. If Q1 and Z1 are the unitary matrices from ZGGHRD that reduced the matrix pair (A,B) to generalized Hessenberg form, then the output matrices Q1*Q and Z1*Z are the unitary factors from the generalized Schur factorization of (A,B):
A = (Q1*Q)*S*(Z1*Z)**H, B = (Q1*Q)*P*(Z1*Z)**H.
To avoid overflow, eigenvalues of the matrix pair (H,T) (equivalently, of (A,B)) are computed as a pair of complex values (alpha,beta). If beta is nonzero, lambda = alpha / beta is an eigenvalue of the generalized nonsymmetric eigenvalue problem (GNEP)
A*x = lambda*B*x
and if alpha is nonzero, mu = beta / alpha is an eigenvalue of the alternate form of the GNEP
mu*A*y = B*y.
The values of alpha and beta for the i-th eigenvalue can be read directly from the generalized Schur form: alpha = S(i,i), beta = P(i,i). iykyk β theyβre right there on the diagonal.
Ref: C.B. Moler & G.W. Stewart, , SIAM J. Numer. Anal., 10(1973), pp. 241--256.
π Parameters π
JOBβCHARACTER*1='E': Compute eigenvalues only;='S': Computer eigenvalues and the Schur form. (the original really says βComputerβ β keeping the detail, bestie π)
COMPQβCHARACTER*1='N': Left Schur vectors (Q) are not computed;='I':Qis initialized to the unit matrix and the matrixQof left Schur vectors of(H,T)is returned;='V':Qmust contain a unitary matrixQ1on entry and the productQ1*Qis returned.
COMPZβCHARACTER*1='N': Right Schur vectors (Z) are not computed;='I':Qis initialized to the unit matrix and the matrixZof right Schur vectors of(H,T)is returned; (yes, this line saysQβ original typo preserved π«Ά)='V':Zmust contain a unitary matrixZ1on entry and the productZ1*Zis returned.
NβINTEGER; the order of the matricesH,T,Q, andZ.N >= 0.ILOβINTEGER(no extra lore in the original, it just exists β¨)IHIβINTEGER;ILOandIHImark the rows and columns ofHwhich are in Hessenberg form. It is assumed thatAis already upper triangular in rows and columns1:ILO-1andIHI+1:N. IfN > 0,1 <= ILO <= IHI <= N; ifN = 0,ILO=1andIHI=0.HβCOMPLEX*16array, dimension(LDH, N). On entry, the N-by-N upper Hessenberg matrixH. On exit, ifJOB = 'S',Hcontains the upper triangular matrixSfrom the generalized Schur factorization. IfJOB = 'E', the diagonal ofHmatches that ofS, but the rest ofHis unspecified.LDHβINTEGER; the leading dimension of the arrayH.LDH >= max( 1, N ).TβCOMPLEX*16array, dimension(LDT, N). On entry, the N-by-N upper triangular matrixT. On exit, ifJOB = 'S',Tcontains the upper triangular matrixPfrom the generalized Schur factorization. IfJOB = 'E', the diagonal ofTmatches that ofP, but the rest ofTis unspecified.LDTβINTEGER; the leading dimension of the arrayT.LDT >= max( 1, N ).ALPHAβCOMPLEX*16array, dimension(N). The complex scalarsalphathat define the eigenvalues of GNEP.ALPHA(i) = S(i,i)in the generalized Schur factorization.BETAβCOMPLEX*16array, dimension(N). The real non-negative scalarsbetathat define the eigenvalues of GNEP.BETA(i) = P(i,i)in the generalized Schur factorization.
Together, the quantities alpha = ALPHA(j) and beta = BETA(j) represent the j-th eigenvalue of the matrix pair (A,B), in one of the forms lambda = alpha/beta or mu = beta/alpha. Since either lambda or mu may overflow, they should not, in general, be computed. (do not casually compute them, bestie π)
QβCOMPLEX*16array, dimension(LDQ, N). On entry, ifCOMPQ = 'V', the unitary matrixQ1used in the reduction of(A,B)to generalized Hessenberg form. On exit, ifCOMPQ = 'I', the unitary matrix of left Schur vectors of(H,T), and ifCOMPQ = 'V', the unitary matrix of left Schur vectors of(A,B). Not referenced ifCOMPQ = 'N'.LDQβINTEGER; the leading dimension of the arrayQ.LDQ >= 1. IfCOMPQ='V'or'I', thenLDQ >= N.ZβCOMPLEX*16array, dimension(LDZ, N). On entry, ifCOMPZ = 'V', the unitary matrixZ1used in the reduction of(A,B)to generalized Hessenberg form. On exit, ifCOMPZ = 'I', the unitary matrix of right Schur vectors of(H,T), and ifCOMPZ = 'V', the unitary matrix of right Schur vectors of(A,B). Not referenced ifCOMPZ = 'N'.LDZβINTEGER; the leading dimension of the arrayZ.LDZ >= 1. IfCOMPZ='V'or'I', thenLDZ >= N.WORKβCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO >= 0,WORK(1)returns the optimalLWORK.LWORKβINTEGER; the dimension of the arrayWORK.LWORK >= max(1,N).
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.
RWORKβDOUBLE PRECISIONarray, dimension(N).INFOβINTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value= 1,...,N: the QZ iteration did not converge.(H,T)is not in Schur form, butALPHA(i)andBETA(i),i=INFO+1,...,Nshould be correct.= N+1,...,2*N: the shift calculation failed.(H,T)is not in Schur form, butALPHA(i)andBETA(i),i=INFO-N+1,...,Nshould be correct.
πΈ Author πΈ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ Further Details: π¦
We assume that complex ABS works as long as its value is less than overflow.
Definition at line 281 of file zhgeqz.f.
Author: Generated automatically by Doxygen for LAPACK from the source code.
byeee π β source/version: LAPACK Version 3.12.0; page: hgeqz(3); and the footerβs date slot is doing its tiny end-of-page moment. 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