lahqr(3)
π NAME π
okay so this is lahqr from section 3 of the library functions manual (yes bestie, lahqr(3), that's the manual name, noted π) β and it's literally the eig-of-Hessenberg, step-in-hseqr situation. That's the whole name: lahqr: eig of Hessenberg, step in hseqr. Iconic, concise, no notes. π
β¨ SYNOPSIS β¨
π«Ά Functions
subroutine clahqr (wantt, wantz, n, ilo, ihi, h, ldh, w, iloz, ihiz, z, ldz, info)β CLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm.subroutine dlahqr (wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, iloz, ihiz, z, ldz, info)β DLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm.subroutine slahqr (wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, iloz, ihiz, z, ldz, info)β SLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm.subroutine zlahqr (wantt, wantz, n, ilo, ihi, h, ldh, w, iloz, ihiz, z, ldz, info)β ZLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm.
four flavors, one vibe:c= complex,d= double,s= single,z= the complex double one. pick your fighter π
π DETAILED DESCRIPTION π
okay so there's a Detailed Description section and then the Function Documentation β and the function documentation is where it gets good, because every single routine gets the full breakdown. buckle up, we're going parameter by parameter, no skips, no summarizing, we eat the whole plate π
π FUNCTION DOCUMENTATION π
π¦ subroutine clahqr (logical wantt, logical wantz, integer n, integer ilo, integer ihi, complex, dimension( ldh, * ) h, integer ldh, complex, dimension( * ) w, integer iloz, integer ihiz, complex, dimension( ldz, * ) z, integer ldz, integer info)
CLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm.
π Purpose:
!>
!> CLAHQR is an auxiliary routine called by CHSEQR to update the
!> eigenvalues and Schur decomposition already computed by CHSEQR, by
!> dealing with the Hessenberg submatrix in rows and columns ILO to
!> IHI.
!>
like, it's the little helper CHSEQR calls in to clean up the Hessenberg submatrix, rows and columns ILO through IHI. main character energy but make it supportive. π«Ά
πΈ Parameters
WANTTβWANTTis LOGICAL.= .TRUE.: the full Schur form T is required;= .FALSE.: only eigenvalues are required.WANTZβWANTZis LOGICAL.= .TRUE.: the matrix of Schur vectors Z is required;= .FALSE.: Schur vectors are not required.NβNis INTEGER. The order of the matrixH.N >= 0.ILOβILOis INTEGER. (that's it, that's the description, she's mysterious π)IHIβIHIis INTEGER. It is assumed thatHis already upper triangular in rows and columnsIHI+1:N, and thatH(ILO,ILO-1) = 0(unlessILO = 1). CLAHQR works primarily with the Hessenberg submatrix in rows and columnsILOtoIHI, but applies transformations to all ofHifWANTTis.TRUE..1 <= ILO <= max(1,IHI);IHI <= N.HβHis COMPLEX array, dimension(LDH,N). On entry, the upper Hessenberg matrixH. On exit, ifINFOis zero and ifWANTTis.TRUE., thenHis upper triangular in rows and columnsILO:IHI. IfINFOis zero and ifWANTTis.FALSE., then the contents ofHare unspecified on exit. The output state ofHin caseINFis positive is below under the description ofINFO.LDHβLDHis INTEGER. The leading dimension of the arrayH.LDH >= max(1,N).WβWis COMPLEX array, dimension(N). The computed eigenvaluesILOtoIHIare stored in the corresponding elements ofW. IfWANTTis.TRUE., the eigenvalues are stored in the same order as on the diagonal of the Schur form returned inH, withW(i) = H(i,i).ILOZβILOZis INTEGER. (again, no further comment, she said what she said π)IHIZβIHIZis INTEGER. Specify the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= ILO;IHI <= IHIZ <= N.ZβZis COMPLEX array, dimension(LDZ,N). IfWANTZis.TRUE., on entryZmust contain the current matrixZof transformations accumulated by CHSEQR, and on exitZhas been updated; transformations are applied only to the submatrixZ(ILOZ:IHIZ,ILO:IHI). IfWANTZis.FALSE.,Zis not referenced.LDZβLDZis INTEGER. The leading dimension of the arrayZ.LDZ >= max(1,N).INFOβINFOis INTEGER.= 0: successful exit> 0: ifINFO = i, CLAHQR failed to compute all the eigenvaluesILOtoIHIin a total of 30 iterations per eigenvalue; elementsi+1:ihiofWcontain those eigenvalues which have been successfully computed.- If
INFO > 0andWANTTis.FALSE., then on exit, the remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix rows and columnsILOthroughINFOof the final, output value ofH. - If
INFO > 0andWANTTis.TRUE., then on exit
- If
(*) (initial value of H)*U = U*(final value of H)
where U is an orthogonal matrix. The final value of H is upper Hessenberg and triangular in rows and columns INFO+1 through IHI.
- If
INFO > 0andWANTZis.TRUE., then on exit
(final value of Z) = (initial value of Z)*U
where U is the orthogonal matrix in (*) (regardless of the value of WANTT.)
real talk: INFO > 0 means it didn't converge β 30 iterations per eigenvalue and she said "that's all I got". not a crash, just an honest little "here's what I managed π".
β Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π§ Contributors:
!>
!> 02-96 Based on modifications by
!> David Day, Sandia National Laboratory, USA
!>
!> 12-04 Further modifications by
!> Ralph Byers, University of Kansas, USA
!> This is a modified version of CLAHQR from LAPACK version 3.0.
!> It is (1) more robust against overflow and underflow and
!> (2) adopts the more conservative Ahues & Tisseur stopping
!> criterion (LAWN 122, 1997).
!>
Definition at line 193 of file clahqr.f.
π₯ subroutine dlahqr (logical wantt, logical wantz, integer n, integer ilo, integer ihi, double precision, dimension( ldh, * ) h, integer ldh, double precision, dimension( * ) wr, double precision, dimension( * ) wi, integer iloz, integer ihiz, double precision, dimension( ldz, * ) z, integer ldz, integer info)
DLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm.
π Purpose:
!>
!> DLAHQR is an auxiliary routine called by DHSEQR to update the
!> eigenvalues and Schur decomposition already computed by DHSEQR, by
!> dealing with the Hessenberg submatrix in rows and columns ILO to
!> IHI.
!>
same gig, different double-precision queen β she's the auxiliary DHSEQR leans on to update what's already been computed, handling the Hessenberg submatrix in rows and columns ILO to IHI. π
π Parameters
WANTTβWANTTis LOGICAL.= .TRUE.: the full Schur form T is required;= .FALSE.: only eigenvalues are required.WANTZβWANTZis LOGICAL.= .TRUE.: the matrix of Schur vectors Z is required;= .FALSE.: Schur vectors are not required.NβNis INTEGER. The order of the matrixH.N >= 0.ILOβILOis INTEGER.IHIβIHIis INTEGER. It is assumed thatHis already upper quasi-triangular in rows and columnsIHI+1:N, and thatH(ILO,ILO-1) = 0(unlessILO = 1). DLAHQR works primarily with the Hessenberg submatrix in rows and columnsILOtoIHI, but applies transformations to all ofHifWANTTis.TRUE..1 <= ILO <= max(1,IHI);IHI <= N.HβHis DOUBLE PRECISION array, dimension(LDH,N). On entry, the upper Hessenberg matrixH. On exit, ifINFOis zero and ifWANTTis.TRUE.,His upper quasi-triangular in rows and columnsILO:IHI, with any 2-by-2 diagonal blocks in standard form. IfINFOis zero andWANTTis.FALSE., the contents ofHare unspecified on exit. The output state ofHifINFOis nonzero is given below under the description ofINFO.LDHβLDHis INTEGER. The leading dimension of the arrayH.LDH >= max(1,N).WRβWRis DOUBLE PRECISION array, dimension(N). (that's the whole entry, she's a vibe, not a talker β¨)WIβWIis DOUBLE PRECISION array, dimension(N). The real and imaginary parts, respectively, of the computed eigenvaluesILOtoIHIare stored in the corresponding elements ofWRandWI. If two eigenvalues are computed as a complex conjugate pair, they are stored in consecutive elements ofWRandWI, say the i-th and (i+1)th, withWI(i) > 0andWI(i+1) < 0. IfWANTTis.TRUE., the eigenvalues are stored in the same order as on the diagonal of the Schur form returned inH, withWR(i) = H(i,i), and, ifH(i:i+1,i:i+1)is a 2-by-2 diagonal block,WI(i) = sqrt(H(i+1,i)*H(i,i+1))andWI(i+1) = -WI(i).ILOZβILOZis INTEGER.IHIZβIHIZis INTEGER. Specify the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= ILO;IHI <= IHIZ <= N.ZβZis DOUBLE PRECISION array, dimension(LDZ,N). IfWANTZis.TRUE., on entryZmust contain the current matrixZof transformations accumulated by DHSEQR, and on exitZhas been updated; transformations are applied only to the submatrixZ(ILOZ:IHIZ,ILO:IHI). IfWANTZis.FALSE.,Zis not referenced.LDZ
β¦and that's exactly where part 1 cuts off, bestie β LDZ's little description rolls into part 2, so don't go anywhere π«Ά
LDZβINTEGER. bestie this is just the leading dimension of the arrayZ, and it has to beLDZ >= max(1,N). that's it. that's the whole vibe check π
INFO
INFOβ it's anINTEGER, and here's the tea β:= 0: successful exit β¨ slay.> 0: ifINFO = i,DLAHQRfailed to compute all the eigenvaluesILOtoIHIin a total of30iterations per eigenvalue; elementsi+1:ihiofWRandWIcontain those eigenvalues which have been successfully computed. so like... partial credit, honestly π
okay so the rest of theINFO > 0situation is a whole saga, let me break it down: ifINFO > 0andWANTTis.FALSE.: then on exit, the remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix rows and columnsILOthroughINFOof the final, output value ofH. π ifINFO > 0andWANTTis.TRUE.: then on exit(*) (initial value of H)*U = U*(final value of H)whereUis an orthogonal matrix. The final value ofHis upper Hessenberg and triangular in rows and columnsINFO+1throughIHI. β¨ ifINFO > 0andWANTZis.TRUE.: then on exit(final value of Z) = (initial value of Z)*UwhereUis the orthogonal matrix in(*)(regardless of the value ofWANTT.). no cap, that's literally what it says.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π₯ Further Details:
02-96 Based on modifications byDavid Day, Sandia National Laboratory, USA12-04 Further modifications byRalph Byers, University of Kansas, USAThis is a modified version of DLAHQR from LAPACK version 3.0.It is (1) more robust against overflow and underflow and(2) adopts the more conservative Ahues & Tisseur stoppingcriterion (LAWN 122, 1997).
Definition at line 205 of file dlahqr.f.
π subroutine slahqr
subroutine slahqr (logical wantt, logical wantz, integer n, integer ilo,
integer ihi, real, dimension( ldh, * ) h, integer ldh, real, dimension(
* ) wr, real, dimension( * ) wi, integer iloz, integer ihiz, real,
dimension( ldz, * ) z, integer ldz, integer info)
SLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm. π¦ yes she does both shifts, she contains multitudes.
π Purpose:
SLAHQR is an auxiliary routine called by SHSEQR to update theeigenvalues and Schur decomposition already computed by SHSEQR, bydealing with the Hessenberg submatrix in rows and columns ILO toIHI.
so she's the sidekick that does the actual heavy lifting for SHSEQR in that one submatrix, iconic behavior honestly π
β¨ Parameters
WANTT
WANTTβLOGICALbestie:= .TRUE.: the full Schur formTis required;= .FALSE.: only eigenvalues are required.
WANTZ
WANTZβ alsoLOGICAL:= .TRUE.: the matrix of Schur vectorsZis required;= .FALSE.: Schur vectors are not required.
N
NβINTEGER. the order of the matrixH.N >= 0. that's the whole paragraph, she's simple like that π
ILO
ILOβINTEGER. and that's literally all it says here, no elaboration, we move π
IHI
IHIβINTEGER. okay so the assumption is thatHis already upper quasi-triangular in rows and columnsIHI+1:N, and thatH(ILO,ILO-1) = 0(unlessILO = 1).SLAHQRworks primarily with the Hessenberg submatrix in rows and columnsILOtoIHI, but applies transformations to all ofHifWANTTis.TRUE.. constraints:1 <= ILO <= max(1,IHI); IHI <= N.β
H
HβREALarray, dimension(LDH,N).- On entry, the upper Hessenberg matrix
H. - On exit, if
INFOis zero and ifWANTTis.TRUE.,His upper quasi-triangular in rows and columnsILO:IHI, with any 2-by-2 diagonal blocks in standard form. IfINFOis zero andWANTTis.FALSE., the contents ofHare unspecified on exit. The output state ofHifINFOis nonzero is given below under the description ofINFO. π "unspecified" is giving "we don't know her" energy but fr fr that's what it says.
- On entry, the upper Hessenberg matrix
LDH
LDHβINTEGER. the leading dimension of the arrayH.LDH >= max(1,N).
WR
WRβREALarray, dimension(N). yes bestie that's the entire description, the next one explains it π«Ά
WI
WIβREALarray, dimension(N). so the real and imaginary parts, respectively, of the computed eigenvaluesILOtoIHIare stored in the corresponding elements ofWRandWI. If two eigenvalues are computed as a complex conjugate pair, they are stored in consecutive elements ofWRandWI, say the i-th and (i+1)th, withWI(i) > 0andWI(i+1) < 0. IfWANTTis.TRUE., the eigenvalues are stored in the same order as on the diagonal of the Schur form returned inH, withWR(i) = H(i,i), and, ifH(i:i+1,i:i+1)is a 2-by-2 diagonal block,WI(i) = sqrt(H(i+1,i)*H(i,i+1))andWI(i+1) = -WI(i). π₯ that's the formula, memorize it, iykyk
ILOZ
ILOZβINTEGER. again, that's the whole thing. she's mysterious. π¦
IHIZ
IHIZβINTEGER. these specify the rows ofZto which transformations must be applied ifWANTZis.TRUE.. constraints:1 <= ILOZ <= ILO; IHI <= IHIZ <= N.β¨
Z
ZβREALarray, dimension(LDZ,N).- If
WANTZis.TRUE., on entryZmust contain the current matrixZof transformations accumulated bySHSEQR, and on exitZhas been updated; transformations are applied only to the submatrixZ(ILOZ:IHIZ,ILO:IHI). - If
WANTZis.FALSE.,Zis not referenced. she simply doesn't exist to us in that case π
- If
LDZ
LDZβINTEGER. the leading dimension of the arrayZ.LDZ >= max(1,N).
INFO
INFOβINTEGER:= 0: successful exit β> 0: ifINFO = i,SLAHQRfailed to compute all the eigenvaluesILOtoIHIin a total of30iterations per eigenvalue; elementsi+1:ihiofWRandWIcontain those eigenvalues which have been successfully computed.
and here's the rest of theINFO > 0lore, because it's a lot π ifINFO > 0andWANTTis.FALSE.: then on exit, the remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix rows and columnsILOthroughINFOof the final, output value ofH. ifINFO > 0andWANTTis.TRUE.: then on exit(*) (initial value of H)*U = U*(final value of H)whereUis an orthogonal matrix. The final value ofHis upper Hessenberg and triangular in rows and columnsINFO+1throughIHI. ifINFO > 0andWANTZis.TRUE.: then on exit(final value of Z) = (initial value of Z)*UwhereUis the orthogonal matrix in(*)(regardless of the value ofWANTT.). periodt. π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π₯ Further Details:
02-96 Based on modifications byDavid Day, Sandia National Laboratory, USA12-04 Further modifications byRalph Byers, University of Kansas, USAThis is a modified version of SLAHQR from LAPACK version 3.0.It is (1) more robust against overflow and underflow and(2) adopts the more conservative Ahues & Tisseur stoppingcriterion (LAWN 122, 1997).
Definition at line 205 of file slahqr.f.
π subroutine zlahqr
subroutine zlahqr (logical wantt, logical wantz, integer n, integer ilo,
integer ihi, complex*16, dimension( ldh, * ) h, integer ldh, complex*16,
dimension( * ) w, integer iloz, integer ihiz, complex*16, dimension(
ldz, * ) z, integer ldz, integer info)
ZLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm. π¦ she's the complex*16 sister and she ate.
π Purpose:
ZLAHQR is an auxiliary routine called by CHSEQR to update theeigenvalues and Schur decomposition already computed by CHSEQR, bydealing with the Hessenberg submatrix in rows and columns ILO toIHI.
same energy as her real sister, but this time it's CHSEQR calling her up. main character energy fr π
β¨ Parameters
WANTT
WANTTβLOGICAL:= .TRUE.: the full Schur formTis required;= .FALSE.: only eigenvalues are required.
WANTZ
WANTZβLOGICAL:= .TRUE.: the matrix of Schur vectorsZis required;= .FALSE.: Schur vectors are not required.
N
NβINTEGER. the order of the matrixH.N >= 0. short and sweet π
ILO
ILOβINTEGER. that's it bestie, that's the description π
IHI
IHIβINTEGER. so it's assumed thatHis already upper triangular in rows and columnsIHI+1:N, and thatH(ILO,ILO-1) = 0(unlessILO = 1).ZLAHQRworks primarily with the Hessenberg submatrix in rows and columnsILOtoIHI, but applies transformations to all ofHifWANTTis.TRUE.. constraints:1 <= ILO <= max(1,IHI); IHI <= N.β (note: upper triangular here, not quasi-triangular like the real version β she's complex, no 2-by-2 blocks needed π )
H
HβCOMPLEX*16array, dimension(LDH,N).- On entry, the upper Hessenberg matrix
H. - On exit, if
INFOis zero and ifWANTTis.TRUE., thenHis upper triangular in rows and columnsILO:IHI. IfINFOis zero and ifWANTTis.FALSE., then the contents ofHare unspecified on exit. The output state ofHin caseINFis positive is below under the description ofINFO. π yes it saysINFand notINFOin the original, we're not fixing it, we're just noting it, love that for us.
- On entry, the upper Hessenberg matrix
LDH
LDHβINTEGER. the leading dimension of the arrayH.LDH >= max(1,N).
W
Wβ and that's where we're leaving her, because the page keeps going in the next part π«Ά don't worry, she's coming back.WβCOMPLEX*16 array, dimension (N)π The computed eigenvaluesILOtoIHIare stored in the corresponding elements ofW. IfWANTTis.TRUE., the eigenvalues are stored in the same order as on the diagonal of the Schur form returned inH, withW(i) = H(i,i). πILOZβINTEGERβ¨IHIZβINTEGERβ¨ Specify the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= ILO; IHI <= IHIZ <= N.πZβCOMPLEX*16 array, dimension (LDZ,N)π¦ IfWANTZis.TRUE., on entryZmust contain the current matrixZof transformations accumulated byCHSEQR, and on exitZhas been updated; transformations are applied only to the submatrixZ(ILOZ:IHIZ,ILO:IHI). IfWANTZis.FALSE.,Zis not referenced. πLDZβINTEGERβ¨ The leading dimension of the arrayZ.LDZ >= max(1,N). πINFOβINTEGERπ«Ά= 0: successful exit β¨> 0: ifINFO = i,ZLAHQRfailed to compute all the eigenvaluesILOtoIHIin a total of30iterations per eigenvalue; elementsi+1:ihiofWcontain those eigenvalues which have been successfully computed. π- If
INFO > 0andWANTTis.FALSE., then on exit, the remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix rows and columnsILOthroughINFOof the final, output value ofH. π - If
INFO > 0andWANTTis.TRUE., then on exit(*) (initial value of H)*U = U*(final value of H)whereUis an orthogonal matrix. The final value ofHis upper Hessenberg and triangular in rows and columnsINFO+1throughIHI. π₯ - If
INFO > 0andWANTZis.TRUE., then on exit(final value of Z) = (initial value of Z)*UwhereUis the orthogonal matrix in(*)(regardless of the value ofWANTT.) π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π«Ά Contributors π«Ά
02-96Based on modifications by David Day, Sandia National Laboratory, USA12-04Further modifications by Ralph Byers, University of Kansas, USA
This is a modified version of ZLAHQR from LAPACK version 3.0. It is (1) more robust against overflow and underflow and (2) adopts the more conservative Ahues & Tisseur stopping criterion (LAWN 122, 1997). πΈ
Definition at line 193 of file zlahqr.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
and that's the footer vibe: LAPACK Version 3.12.0, page lahqr(3) β mwah, bestie, go compute something iconic πβ¨
π¦ 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