SLAQR4(3)
πΈ SLAQR4(3) β slaqr4.f, aka the LAPACK subroutine that's literally the main character of the multi-shift QR algorithm π
okay so bestie, you know how the file lives at /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/slaqr4.f? that's the whole NAME of this page, no cap β it's a Fortran source file in LAPACK, and this is its manual page (the man name is slaqr4.f(3), keep that in your back pocket π«Ά).
β¨ SYNOPSIS β¨
Functions/Subroutines π¦
subroutine SLAQR4 (wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, iloz,
ihiz, z, ldz, work, lwork, info)
SLAQR4 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur decomposition. that's the whole vibe π₯
π Function/Subroutine Documentation
the full signature, iconically long π
subroutine SLAQR4 (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, real, dimension( * ) work, integer
lwork, integer info)
SLAQR4 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur decomposition. (yes i said it twice, it's that important β¨)
π Purpose
okay so here's what's actually going on, listen up:
- SLAQR4 implements one level of recursion for SLAQR0. it's a complete implementation of the small bulge multi-shift QR algorithm. it may be called by
SLAQR0and, for large enough deflation window size, it may be called bySLAQR3. this subroutine is identical toSLAQR0except that it callsSLAQR2instead ofSLAQR3. tiny detail, huge consequences, iykyk π - SLAQR4 computes the eigenvalues of a Hessenberg matrix
Hand, optionally, the matricesTandZfrom the Schur decompositionH = Z T Z**T, whereTis an upper quasi-triangular matrix (the Schur form), andZis the orthogonal matrix of Schur vectors. iconic behavior, honestly π - optionally
Zmay be postmultiplied into an input orthogonal matrixQso that this routine can give the Schur factorization of a matrixAwhich has been reduced to the Hessenberg formHby the orthogonal matrixQ:A = Q*H*Q**T = (QZ)*T*(QZ)**T. slay π
πΈ Parameters
the cast of characters, one by one π§
WANTTβ WANTT isLOGICAL- =
.TRUE.: the full Schur formTis required; - =
.FALSE.: only eigenvalues are required.
- =
WANTZβ WANTZ isLOGICAL- =
.TRUE.: the matrix of Schur vectorsZis required; - =
.FALSE.: Schur vectors are not required.
- =
Nβ N isINTEGER- The order of the matrix
H.N >= 0.
- The order of the matrix
ILOβ ILO isINTEGER(that's it, that's the whole description, short king π)IHIβ IHI isINTEGER- It is assumed that
His already upper triangular in rows and columns1:ILO-1andIHI+1:Nand, ifILO > 1,H(ILO,ILO-1)is zero.ILOandIHIare normally set by a previous call toSGEBAL, and then passed toSGEHRDwhen the matrix output bySGEBALis reduced to Hessenberg form. Otherwise,ILOandIHIshould be set to1andN, respectively. IfN > 0, then1 <= ILO <= IHI <= N. IfN = 0, thenILO = 1andIHI = 0. π«Ά
- It is assumed that
Hβ H isREALarray, dimension(LDH,N)- On entry, the upper Hessenberg matrix
H. - On exit, if
INFO = 0andWANTTis.TRUE., thenHcontains the upper quasi-triangular matrixTfrom the Schur decomposition (the Schur form); 2-by-2 diagonal blocks (corresponding to complex conjugate pairs of eigenvalues) are returned in standard form, withH(i,i) = H(i+1,i+1)andH(i+1,i)*H(i,i+1) < 0. IfINFO = 0andWANTTis.FALSE., then the contents ofHare unspecified on exit. (The output value ofHwhenINFO > 0is given under the description ofINFObelow.) - This subroutine may explicitly set
H(i,j) = 0fori > jandj = 1, 2, ... ILO-1orj = IHI+1, IHI+2, ... N.
- On entry, the upper Hessenberg matrix
LDHβ LDH isINTEGER- The leading dimension of the array
H.LDH >= max(1,N).
- The leading dimension of the array
WRβ WR isREALarray, dimension(IHI)(again, short and mysterious π )WIβ WI isREALarray, dimension(IHI)- The real and imaginary parts, respectively, of the computed eigenvalues of
H(ILO:IHI,ILO:IHI)are stored inWR(ILO:IHI)andWI(ILO:IHI). 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., then 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). π
- The real and imaginary parts, respectively, of the computed eigenvalues of
ILOZβ ILOZ isINTEGER(mystery girl π)IHIZβ IHIZ isINTEGER- Specify the rows of
Zto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= ILO; IHI <= IHIZ <= N.
- Specify the rows of
Zβ Z isREALarray, dimension(LDZ,IHI)- If
WANTZis.FALSE., thenZis not referenced. - If
WANTZis.TRUE., thenZ(ILO:IHI,ILOZ:IHIZ)is replaced byZ(ILO:IHI,ILOZ:IHIZ)*UwhereUis the orthogonal Schur factor ofH(ILO:IHI,ILO:IHI). (The output value ofZwhenINFO > 0is given under the description ofINFObelow.)
- If
LDZβ LDZ isINTEGER- The leading dimension of the array
Z. ifWANTZis.TRUE.thenLDZ >= MAX(1,IHIZ). Otherwise,LDZ >= 1.
- The leading dimension of the array
WORKβ WORK isREALarray, dimensionLWORK- On exit, if
LWORK = -1,WORK(1)returns an estimate of the optimal value forLWORK.
- On exit, if
LWORKβ LWORK isINTEGER- The dimension of the array
WORK.LWORK >= max(1,N)is sufficient, butLWORKtypically as large as6*Nmay be required for optimal performance. A workspace query to determine the optimal workspace size is recommended. π - If
LWORK = -1, then SLAQR4 does a workspace query. In this case, SLAQR4 checks the input parameters and estimates the optimal workspace size for the given values ofN,ILOandIHI. The estimate is returned inWORK(1). No error message related toLWORKis issued byXERBLA. NeitherHnorZare accessed. (so efficient, so demure β¨)
- The dimension of the array
INFOβ INFO isINTEGER- (the source literally has
!> \verbatimsitting in here too, keeping it for the historical record, don't @ me π) - INFO is
INTEGER= 0: successful exit> 0: ifINFO = i, SLAQR4 failed to compute all of the eigenvalues. Elements1:ilo-1andi+1:nofWRandWIcontain those eigenvalues which have been successfully computed. (Failures are rare.) π
- If
INFO > 0andWANTis.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
- (the source literally has
(*) (initial value of H)*U = U*(final value of H)
- where
Uis a 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(ILO:IHI,ILOZ:IHIZ)
= (initial value of Z(ILO:IHI,ILOZ:IHIZ)*U
- where
Uis the orthogonal matrix in(*)(regardless of the value ofWANTT.) - If
INFO > 0andWANTZis.FALSE., thenZis not accessed.
π heads up bestie: notice that one of those saysWANT, notWANTT. that's exactly how the source has it. i'm not fixing it, i'm just reporting the tea. β
π¦ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π§ Contributors:
Karen Braman and Ralph Byers, Department of Mathematics, University of Kansas, USA. legends, honestly π«Ά
β References:
- K. Braman, R. Byers and R. Mathias, The Multi-Shift QR Algorithm Part I: Maintaining Well Focused Shifts, and Level 3 Performance, SIAM Journal of Matrix Analysis, volume 23, pages 929--947, 2002.
- K. Braman, R. Byers and R. Mathias, The Multi-Shift QR Algorithm Part II: Aggressive Early Deflation, SIAM Journal of Matrix Analysis, volume 23, pages 948--973, 2002.
like, they wrote papers about this. academic royalty fr fr π
π₯ Definition at line 263 of file slaqr4.f.
(and the whole page itself was generated automatically by Doxygen for LAPACK from the source code β so if the prose feels a little feral, blame the generator, not me π β¨)
and that's the page!! LAPACK, Version 3.12.0, dated /home/abui...RC/slaqr4.f(3) β mwah, go compute some eigenvalues bestie, you've got this πππ
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms