SRC/slahqr.f(3)
π SRC/slahqr.f
Okay bestie, welcome to the slahqr page β it lives in the LAPACK library manual (SRC/slahqr.f(3), iykyk) and honestly it's giving "quiet workhorse energy" because this little icon does the actual heavy lifting behind SHSEQR. Let's get into it π«Ά
β¨ SYNOPSIS β¨
Functions/Subroutines
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. Periodt.
π Function/Subroutine Documentation π
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. No cap, that's the whole vibe πΈ
π Purpose:
!>
!> SLAHQR is an auxiliary routine called by SHSEQR to update the
!> eigenvalues and Schur decomposition already computed by SHSEQR, by
!> dealing with the Hessenberg submatrix in rows and columns ILO to
!> IHI.
!>
So like β it's the auxiliary routine, the sidekick, the Robin to SHSEQR's Batman π¦ It updates the eigenvalues and Schur decomposition that SHSEQR already computed, by dealing with the Hessenberg submatrix in rows and columns ILO to IHI. Slay.
β Parameters β
WANTT
!> WANTT is LOGICAL
!> = .TRUE. : the full Schur form T is required;
!> = .FALSE.: only eigenvalues are required.
!>
It's a LOGICAL. Set it .TRUE. if you want the full Schur form T, or .FALSE. if you're just here for the eigenvalues. Choose your fighter π
WANTZ
!> WANTZ is LOGICAL
!> = .TRUE. : the matrix of Schur vectors Z is required;
!> = .FALSE.: Schur vectors are not required.
!>
Also a LOGICAL. .TRUE. = you want the matrix of Schur vectors Z. .FALSE. = you do not require Schur vectors, bestie, and that's valid.
N
!> N is INTEGER
!> The order of the matrix H. N >= 0.
!>
INTEGER, and it's the order of the matrix H. Constraint: N >= 0. Literally cannot be negative, ok?
ILO
!> ILO is INTEGER
!>
ILO is INTEGER. That's it, that's the whole entry π (its whole personality comes out in IHI below).
IHI
!> IHI is INTEGER
!> It is assumed that H is already upper quasi-triangular in
!> rows and columns IHI+1:N, and that H(ILO,ILO-1) = 0 (unless
!> ILO = 1). SLAHQR works primarily with the Hessenberg
!> submatrix in rows and columns ILO to IHI, but applies
!> transformations to all of H if WANTT is .TRUE..
!> 1 <= ILO <= max(1,IHI); IHI <= N.
!>
INTEGER. So here's the assumption the routine rolls in with: H is already upper quasi-triangular in rows and columns IHI+1:N, and H(ILO,ILO-1) = 0 (unless ILO = 1, bestie, exceptions exist). SLAHQR works primarily with the Hessenberg submatrix in rows and columns ILO to IHI, but if WANTT is .TRUE. it applies transformations to all of H. Constraints, and note the max(): 1 <= ILO <= max(1,IHI); IHI <= N.
H
!> H is REAL array, dimension (LDH,N)
!> On entry, the upper Hessenberg matrix H.
!> On exit, if INFO is zero and if WANTT is .TRUE., H is upper
!> quasi-triangular in rows and columns ILO:IHI, with any
!> 2-by-2 diagonal blocks in standard form. If INFO is zero
!> and WANTT is .FALSE., the contents of H are unspecified on
!> exit. The output state of H if INFO is nonzero is given
!> below under the description of INFO.
!>
REAL array, dimension (LDH,N). On entry: the upper Hessenberg matrix H. On exit, depending on the situation:
- If
INFOis zero andWANTTis.TRUE.βHis upper quasi-triangular in rows and columnsILO:IHI, with any 2-by-2 diagonal blocks in standard form β¨ - If
INFOis zero andWANTTis.FALSE.β the contents ofHare unspecified on exit π (yes, literally unspecified β don't go reading it) - If
INFOis nonzero β the output state ofHis given below under the description ofINFO.
LDH
!> LDH is INTEGER
!> The leading dimension of the array H. LDH >= max(1,N).
!>
INTEGER, leading dimension of the array H. Constraint: LDH >= max(1,N). Respect the leading dimension, always π
WR
!> WR is REAL array, dimension (N)
!>
REAL array, dimension (N). (Its whole personality drops in WI, keep reading π)
WI
!> WI is REAL array, dimension (N)
!> The real and imaginary parts, respectively, of the computed
!> eigenvalues ILO to IHI are stored in the corresponding
!> elements of WR and WI. If two eigenvalues are computed as a
!> complex conjugate pair, they are stored in consecutive
!> elements of WR and WI, say the i-th and (i+1)th, with
!> WI(i) > 0 and WI(i+1) < 0. If WANTT is .TRUE., the
!> eigenvalues are stored in the same order as on the diagonal
!> of the Schur form returned in H, with WR(i) = H(i,i), and, if
!> H(i:i+1,i:i+1) is a 2-by-2 diagonal block,
!> WI(i) = sqrt(H(i+1,i)*H(i,i+1)) and WI(i+1) = -WI(i).
!>
REAL array, dimension (N). Okay so the real and imaginary parts, respectively, of the computed eigenvalues ILO to IHI get stored in the corresponding elements of WR and WI. If two eigenvalues come out as a complex conjugate pair, they go in consecutive elements of WR and WI β say the i-th and (i+1)th β with WI(i) > 0 and WI(i+1) < 0. And if WANTT is .TRUE., the eigenvalues are stored in the same order as on the diagonal of the Schur form returned in H, with WR(i) = H(i,i), and if H(i:i+1,i:i+1) is a 2-by-2 diagonal block, then WI(i) = sqrt(H(i+1,i)*H(i,i+1)) and WI(i+1) = -WI(i). The way that's a whole formula ππ
ILOZ
!> ILOZ is INTEGER
!>
ILOZ is INTEGER. Short entry, but it matters β see IHIZ β¬οΈ
IHIZ
!> IHIZ is INTEGER
!> Specify the rows of Z to which transformations must be
!> applied if WANTZ is .TRUE..
!> 1 <= ILOZ <= ILO; IHI <= IHIZ <= N.
!>
INTEGER. These two (ILOZ, IHIZ) specify the rows of Z to which transformations must be applied if WANTZ is .TRUE.. Constraints: 1 <= ILOZ <= ILO; IHI <= IHIZ <= N. Write those down, queen π
Z
!> Z is REAL array, dimension (LDZ,N)
!> If WANTZ is .TRUE., on entry Z must contain the current
!> matrix Z of transformations accumulated by SHSEQR, and on
!> exit Z has been updated; transformations are applied only to
!> the submatrix Z(ILOZ:IHIZ,ILO:IHI).
!> If WANTZ is .FALSE., Z is not referenced.
!>
REAL array, dimension (LDZ,N). If WANTZ is .TRUE., then on entry Z must contain the current matrix Z of transformations accumulated by SHSEQR, and on exit Z has been updated β and note that transformations are applied only to the submatrix Z(ILOZ:IHIZ,ILO:IHI). If WANTZ is .FALSE., Z is not referenced at all. Ghosted π
LDZ
!> LDZ is INTEGER
!> The leading dimension of the array Z. LDZ >= max(1,N).
!>
INTEGER, leading dimension of the array Z. Constraint: LDZ >= max(1,N). Same energy as LDH, honestly.
INFO
!> INFO is INTEGER
!> = 0: successful exit
!> > 0: If INFO = i, SLAHQR failed to compute all the
!> eigenvalues ILO to IHI in a total of 30 iterations
!> per eigenvalue; elements i+1:ihi of WR and WI
!> contain those eigenvalues which have been
!> successfully computed.
!>
!> If INFO > 0 and WANTT is .FALSE., then on exit,
!> the remaining unconverged eigenvalues are the
!> eigenvalues of the upper Hessenberg matrix rows
!> and columns ILO through INFO of the final, output
!> value of H.
!>
!> If INFO > 0 and WANTT is .TRUE., then on exit
!> (*) (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 > 0 and WANTZ is .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.)
!>
INTEGER, and here's the tea:
= 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.- 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.)
β οΈ Okay so real talk:INFO > 0is a failure to converge, not a vibe. It means it hit30iterations per eigenvalue and tapped out. The partial results are still described above β read them carefully, don't just assume everything's fine ππ₯
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ Further Details: π¦
!>
!> 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 SLAHQR 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).
!>
So the lore is: 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 SLAHQR 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). Glow-up confirmed, we love a refined algorithm πβ¨
Definition at line 205 of file slahqr.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
π That's the whole page, bestie! Big sign-off energy: this wasLAPACK, Version3.12.0, and the page you just read isSRC/slahqr.f(3). Go forth and compute those eigenvalues πΈπ«Άπ
π¦ 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