gghd3(3)
πΈ NAME πΈ
okay so this is gghd3(3) from the Library Functions Manual, and the NAME line is literally gghd3 - gghd3: reduction to Hessenberg, level 3. bestie, it's giving βwe reduce matrices and we do it at level 3,β periodt π
β¨ SYNOPSIS β¨
Functions, aka the whole squad β same energy, different precision:
subroutine cgghd3 (compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z,
ldz, work, lwork, info)
CGGHD3
subroutine dgghd3 (compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z,
ldz, work, lwork, info)
DGGHD3
subroutine sgghd3 (compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z,
ldz, work, lwork, info)
SGGHD3
subroutine zgghd3 (compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z,
ldz, work, lwork, info)
ZGGHD3
π Detailed Description π
This is the part where the page points you at the actual function docs. The main character energy lives under Function Documentation, and yes, the details are lowkey the whole point π«Ά
π§ Function Documentation π§
β¨ subroutine cgghd3 (compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z, ldz, work, lwork, info) β CGGHD3 β¨
Purpose
okay so CGGHD3 takes a pair of complex matrices (A,B) and reduces them to generalized upper Hessenberg form using unitary transformations. A is a general matrix, and B is upper triangular. The generalized eigenvalue problem is:
A*x = lambda*B*x,
and B is typically made upper triangular by computing its QR factorization and moving the unitary matrix Q to the left side of the equation.
This subroutine simultaneously reduces A to a Hessenberg matrix H:
Q**H*A*Z = H
and transforms B to another upper triangular matrix T:
Q**H*B*Z = T
in order to reduce the problem to its standard form:
H*y = lambda*T*y
where y = Z**H*x.
The unitary matrices Q and Z are determined as products of Givens rotations. They may either be formed explicitly, or they may be postmultiplied into input matrices Q1 and Z1, so that:
Q1 * A * Z1**H = (Q1*Q) * H * (Z1*Z)**H
Q1 * B * Z1**H = (Q1*Q) * T * (Z1*Z)**H
If Q1 is the unitary matrix from the QR factorization of B in the original equation A*x = lambda*B*x, then CGGHD3 reduces the original problem to generalized Hessenberg form.
This is a blocked variant of CGGHRD, using matrix-matrix multiplications for parts of the computation to enhance performance. iconic behavior, no cap π
πΈ Parameters πΈ
COMPQβCHARACTER*1.= 'N': do not computeQ;= 'I':Qis initialized to the unit matrix, and the unitary matrixQis returned;= 'V':Qmust contain a unitary matrixQ1on entry, and the productQ1*Qis returned.
COMPZβCHARACTER*1.= 'N': do not computeZ;= 'I':Zis initialized to the unit matrix, and the unitary matrixZis returned;= 'V':Zmust contain a unitary matrixZ1on entry, and the productZ1*Zis returned.
NβINTEGER. The order of the matricesAandB.N >= 0.ILOβINTEGER.IHIβINTEGER.
ILO and IHI mark the rows and columns of A which are to be reduced. It is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to CGGBAL; otherwise they should be set to 1 and N respectively. 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
AβCOMPLEXarray, dimension(LDA, N).
On entry, the N-by-N general matrix to be reduced. On exit, the upper triangle and the first subdiagonal of A are overwritten with the upper Hessenberg matrix H, and the rest is set to zero.
LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).BβCOMPLEXarray, dimension(LDB, N).
On entry, the N-by-N upper triangular matrix B. On exit, the upper triangular matrix T = Q**H B Z. The elements below the diagonal are set to zero.
LDBβINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).QβCOMPLEXarray, dimension(LDQ, N).
On entry, if COMPQ = 'V', the unitary matrix Q1, typically from the QR factorization of B. On exit, if COMPQ='I', the unitary matrix Q, and if COMPQ = 'V', the product Q1*Q. Not referenced if COMPQ='N'.
LDQβINTEGER. The leading dimension of the arrayQ.LDQ >= NifCOMPQ='V'or'I';LDQ >= 1otherwise.ZβCOMPLEXarray, dimension(LDZ, N).
On entry, if COMPZ = 'V', the unitary matrix Z1. On exit, if COMPZ='I', the unitary matrix Z, and if COMPZ = 'V', the product Z1*Z. Not referenced if COMPZ='N'.
LDZβINTEGER. The leading dimension of the arrayZ.LDZ >= NifCOMPZ='V'or'I';LDZ >= 1otherwise.WORKβCOMPLEXarray, dimension(MAX(1,LWORK)).
On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORKβINTEGER. The length of the arrayWORK.LWORK >= 1. For optimum performanceLWORK >= 6*N*NB, whereNBis the optimal blocksize.
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βINTEGER.= 0: successful exit.< 0: ifINFO = -i, thei-th argument had an illegal value.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ Further Details π¦
This routine reduces A to Hessenberg form and maintains B in triangular form using a blocked variant of Moler and Stewart's original algorithm, as described by Kagstrom, Kressner, Quintana-Orti, and Quintana-Orti (BIT 2008).
Definition at line 229 of file cgghd3.f.
β¨ subroutine dgghd3 (compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z, ldz, work, lwork, info) β DGGHD3 β¨
Purpose
DGGHD3 does the same glow-up for a pair of real matrices (A,B) to generalized upper Hessenberg form using orthogonal transformations. A is a general matrix, and B is upper triangular. The generalized eigenvalue problem is:
A*x = lambda*B*x,
and B is typically made upper triangular by computing its QR factorization and moving the orthogonal matrix Q to the left side of the equation.
This subroutine simultaneously reduces A to a Hessenberg matrix H:
Q**T*A*Z = H
and transforms B to another upper triangular matrix T:
Q**T*B*Z = T
in order to reduce the problem to its standard form:
H*y = lambda*T*y
where y = Z**T*x.
The orthogonal matrices Q and Z are determined as products of Givens rotations. They may either be formed explicitly, or they may be postmultiplied into input matrices Q1 and Z1, so that:
Q1 * A * Z1**T = (Q1*Q) * H * (Z1*Z)**T
Q1 * B * Z1**T = (Q1*Q) * T * (Z1*Z)**T
If Q1 is the orthogonal matrix from the QR factorization of B in the original equation A*x = lambda*B*x, then DGGHD3 reduces the original problem to generalized Hessenberg form.
This is a blocked variant of DGGHRD, using matrix-matrix multiplications for parts of the computation to enhance performance. fr fr, it ate π
πΈ Parameters πΈ
COMPQβCHARACTER*1.= 'N': do not computeQ;= 'I':Qis initialized to the unit matrix, and the orthogonal matrixQis returned;= 'V':Qmust contain an orthogonal matrixQ1on entry, and the productQ1*Qis returned.
COMPZβCHARACTER*1.= 'N': do not computeZ;= 'I':Zis initialized to the unit matrix, and the orthogonal matrixZis returned;= 'V':Zmust contain an orthogonal matrixZ1on entry, and the productZ1*Zis returned.
NβINTEGER. The order of the matricesAandB.N >= 0.ILOβINTEGER.IHIβINTEGER.
ILO and IHI mark the rows and columns of A which are to be reduced. It is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to DGGBAL; otherwise they should be set to 1 and N respectively. 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
AAβ aDOUBLE PRECISIONarray, dimension(LDA, N). On entry it's the N-by-N general matrix you're reducing, aka the whole reason we're here π . On exit, the upper triangle and the first subdiagonal ofAare overwritten with the upper Hessenberg matrixH, and the rest is set to zero. so like, your originalA? gone. it ate and left no crumbs πLDAβINTEGER, the leading dimension of the arrayA. NeedsLDA >= max(1,N). disrespect this number and the vibes will be rancid fr.BβDOUBLE PRECISIONarray, dimension(LDB, N). On entry: the N-by-N upper triangular matrixB. On exit: the upper triangular matrixT = Q**T B Z, and the elements below the diagonal are set to zero β¨. she stays triangular, that's her whole brand.LDBβINTEGER, the leading dimension of the arrayB.LDB >= max(1,N). that's the rule, bestie π«ΆQβDOUBLE PRECISIONarray, dimension(LDQ, N). On entry, ifCOMPQ = 'V', this holds the orthogonal matrixQ1β typically from the QR factorization ofB, iykyk. On exit, ifCOMPQ='I'it holds the orthogonal matrixQ, and ifCOMPQ = 'V'it holds the productQ1*Q. Not referenced ifCOMPQ='N'β she's off duty π€LDQβINTEGER, the leading dimension of the arrayQ.LDQ >= NifCOMPQ='V'or'I';LDQ >= 1otherwise. different rules for different girls πΈZβDOUBLE PRECISIONarray, dimension(LDZ, N). On entry, ifCOMPZ = 'V', the orthogonal matrixZ1. On exit, ifCOMPZ='I'the orthogonal matrixZ, and ifCOMPZ = 'V'the productZ1*Z. Not referenced ifCOMPZ='N'. iconic, no notes πLDZβINTEGER, the leading dimension of the arrayZ.LDZ >= NifCOMPZ='V'or'I';LDZ >= 1otherwise. same energy asLDQ, it's giving sisterhood πWORKβDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. she's the scratch queen, treat her right π§LWORKβINTEGER, the length of the arrayWORK.LWORK >= 1. For optimum performanceLWORK >= 6*N*NB, whereNBis the optimal blocksize β like, technically 1 works, but that's not the slay we're going for π
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. so -1 is the "just tell me what you want from me" energy π
INFOβINTEGER. Exit report:= 0: successful exit. we love to see it π< 0: ifINFO = -i, the i-th argument had an illegal value. the callout is COMING π
π¦ Author π¦
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details π
This routine reduces A to Hessenberg form and maintains B in triangular form using a blocked variant of Moler and Stewart's original algorithm, as described by Kagstrom, Kressner, Quintana-Orti, and Quintana-Orti (BIT 2008). historic behaviour, honestly β¨
Definition at line 228 of file dgghd3.f.
π¦ subroutine sgghd3 π¦
Same whole vibe, just in REAL. no cap π«Ά
subroutine sgghd3 (character compq, character compz, integer n, integer ilo,
integer ihi, real, dimension( lda, * ) a, integer lda, real, dimension(
ldb, * ) b, integer ldb, real, dimension( ldq, * ) q, integer ldq, real,
dimension( ldz, * ) z, integer ldz, real, dimension( * ) work, integer
lwork, integer info)
SGGHD3
πΈ Purpose πΈ
SGGHD3 reduces a pair of real matrices (A,B) to generalized upper Hessenberg form using orthogonal transformations, where A is a general matrix and B is upper triangular. The form of the generalized eigenvalue problem is
A*x = lambda*B*x,
and B is typically made upper triangular by computing its QR factorization and moving the orthogonal matrix Q to the left side of the equation. classic move π
This subroutine simultaneously reduces A to a Hessenberg matrix H:
Q**T*A*Z = H
and transforms B to another upper triangular matrix T:
Q**T*B*Z = T
in order to reduce the problem to its standard form
H*y = lambda*T*y
where y = Z**T*x.
The orthogonal matrices Q and Z are determined as products of Givens rotations. They may either be formed explicitly, or they may be postmultiplied into input matrices Q1 and Z1, so that
Q1 * A * Z1**T = (Q1*Q) * H * (Z1*Z)**T
Q1 * B * Z1**T = (Q1*Q) * T * (Z1*Z)**T
If Q1 is the orthogonal matrix from the QR factorization of B in the original equation A*x = lambda*B*x, then SGGHD3 reduces the original problem to generalized Hessenberg form. that's the payoff bestie π
This is a blocked variant of SGGHRD, using matrix-matrix multiplications for parts of the computation to enhance performance. blocked = faster = she's built different π₯
β¨ Parameters β¨
COMPQβCHARACTER*1.= 'N': do not computeQ; (she's not coming to the function π)= 'I':Qis initialized to the unit matrix, and the orthogonal matrixQis returned;= 'V':Qmust contain an orthogonal matrixQ1on entry, and the productQ1*Qis returned.
COMPZβCHARACTER*1.= 'N': do not computeZ;= 'I':Zis initialized to the unit matrix, and the orthogonal matrixZis returned;= 'V':Zmust contain an orthogonal matrixZ1on entry, and the productZ1*Zis returned.
NβINTEGER. The order of the matricesAandB.N >= 0. zero is allowed, she can be nothing, that's valid π¦ILOβINTEGER. (the vibe check partner ofIHI, see below π )IHIβINTEGER.
ILO and IHI mark the rows and columns of A which are to be reduced. It is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to SGGBAL; otherwise they should be set to 1 and N respectively. Also: 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. yes the empty case is flipped, no we do not make the rules π
AβREALarray, dimension(LDA, N). On entry, the N-by-N general matrix to be reduced. On exit, the upper triangle and the first subdiagonal ofAare overwritten with the upper Hessenberg matrixH, and the rest is set to zero. poof. gone. iconic behaviour πLDAβINTEGER, the leading dimension of the arrayA.LDA >= max(1,N). mandatory βBβREALarray, dimension(LDB, N). On entry, the N-by-N upper triangular matrixB. On exit, the upper triangular matrixT = Q**T B Z. The elements below the diagonal are set to zero. she is cleansed β¨LDBβINTEGER, the leading dimension of the arrayB.LDB >= max(1,N). ty bestie π«ΆQβREALarray, dimension(LDQ, N). On entry, ifCOMPQ = 'V', the orthogonal matrixQ1, typically from the QR factorization ofB. On exit, ifCOMPQ='I', the orthogonal matrixQ, and ifCOMPQ = 'V', the productQ1*Q. Not referenced ifCOMPQ='N'. she said "not today" πLDQβINTEGER, the leading dimension of the arrayQ.LDQ >= NifCOMPQ='V'or'I';LDQ >= 1otherwise. conditional queen πZβREALarray, dimension(LDZ, N). On entry, ifCOMPZ = 'V', the orthogonal matrixZ1. On exit, ifCOMPZ='I', the orthogonal matrixZ, and ifCOMPZ = 'V', the productZ1*Z. Not referenced ifCOMPZ='N'. main character of the right-hand side πLDZβINTEGER, the leading dimension of the arrayZ.LDZ >= NifCOMPZ='V'or'I';LDZ >= 1otherwise. same rules, different letter πWORKβREALarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. the workspace, our unsung hero π§LWORKβINTEGER, the length of the arrayWORK.LWORK >= 1. For optimum performanceLWORK >= 6*N*NB, whereNBis the optimal blocksize.
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. so you can just ask "how much do you need from me" and she'll tell you, no nagging π
INFOβINTEGER.= 0: successful exit. π< 0: ifINFO = -i, the i-th argument had an illegal value. somebody's getting read for filth π
π¦ Author π¦
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details π
This routine reduces A to Hessenberg form and maintains B in triangular form using a blocked variant of Moler and Stewart's original algorithm, as described by Kagstrom, Kressner, Quintana-Orti, and Quintana-Orti (BIT 2008). citation slay π
Definition at line 228 of file sgghd3.f.
π
subroutine zgghd3 π
now in COMPLEX*16. the plot thickens π
subroutine zgghd3 (character compq, character compz, integer n, integer ilo,
integer ihi, complex*16, dimension( lda, * ) a, integer lda, complex*16,
dimension( ldb, * ) b, integer ldb, complex*16, dimension( ldq, * ) q,
integer ldq, complex*16, dimension( ldz, * ) z, integer ldz, complex*16,
dimension( * ) work, integer lwork, integer info)
ZGGHD3
π Purpose π
πΈ Parameters πΈ
Okay bestie, this is where we get into the actual arguments. Every single one matters, so pay attention π
COMPQ
COMPQ is CHARACTER*1. It tells the routine what to do with the unitary matrix Q:
= 'N': do not compute Q;= 'I': Q is initialized to the unit matrix, and the unitary matrix Q is returned;= 'V': Q must contain a unitary matrix Q1 on entry, and the product Q1*Q is returned.
COMPZ
COMPZ is CHARACTER*1. Same vibe as COMPQ, but for Z:
= 'N': do not compute Z;= 'I': Z is initialized to the unit matrix, and the unitary matrix Z is returned;= 'V': Z must contain a unitary matrix Z1 on entry, and the product Z1*Z is returned.
N
N is INTEGER. It's the order of the matrices A and B. Constraint: N >= 0.
ILO
ILO is INTEGER.
IHI
IHI is INTEGER.
ILO and IHI mark the rows and columns of A which are to be reduced. It is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to ZGGBAL; otherwise they should be set to 1 and N respectively. Constraints: 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
A
A is COMPLEX*16 array, dimension (LDA, N). On entry, the N-by-N general matrix to be reduced. On exit, the upper triangle and the first subdiagonal of A are overwritten with the upper Hessenberg matrix H, and the rest is set to zero.
LDA
LDA is INTEGER. The leading dimension of the array A. Constraint: LDA >= max(1,N).
B
B is COMPLEX*16 array, dimension (LDB, N). On entry, the N-by-N upper triangular matrix B. On exit, the upper triangular matrix T = Q**H B Z. The elements below the diagonal are set to zero.
LDB
LDB is INTEGER. The leading dimension of the array B. Constraint: LDB >= max(1,N).
Q
Q is COMPLEX*16 array, dimension (LDQ, N). On entry, if COMPQ = 'V', the unitary matrix Q1, typically from the QR factorization of B. On exit, if COMPQ='I', the unitary matrix Q, and if COMPQ = 'V', the product Q1*Q. Not referenced if COMPQ='N'.
LDQ
LDQ is INTEGER. The leading dimension of the array Q. Constraint: LDQ >= N if COMPQ='V' or 'I'; LDQ >= 1 otherwise.
Z
Z is COMPLEX*16 array, dimension (LDZ, N). On entry, if COMPZ = 'V', the unitary matrix Z1. On exit, if COMPZ='I', the unitary matrix Z, and if COMPZ = 'V', the product Z1*Z. Not referenced if COMPZ='N'.
LDZ
LDZ is INTEGER. The leading dimension of the array Z. Constraint: LDZ >= N if COMPZ='V' or 'I'; LDZ >= 1 otherwise.
WORK
WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK
LWORK is INTEGER. The length of the array WORK. Constraint: LWORK >= 1. For optimum performance LWORK >= 6*N*NB, where NB is the optimal blocksize.
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.
INFO
INFO is INTEGER. Exit status:
= 0: successful exit.< 0: ifINFO = -i, thei-th argument had an illegal value.
π Author π
This iconic routine was brought to you by:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details: π
This routine reduces A to Hessenberg form and maintains B in triangular form using a blocked variant of Moler and Stewart's original algorithm, as described by Kagstrom, Kressner, Quintana-Orti, and Quintana-Orti (BIT 2008).
Definition at line 225 of file zgghd3.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
And that's the whole page, bestie! This lil manual page is from LAPACK Version 3.12.0 and it's the gghd3(3) page. 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