SGEHD2(3)
πΈ SGEHD2(3) β Library Functions Manual πΈ
ok so bestie. this page lives in the <cyan>Library Functions Manual</cyan> and the file it's documenting is literally this whole path:
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/sgehd2.f
like, that's the β¨source of truthβ¨ and we are not editing it, we're just gonna vibe with it π
β¨ SYNOPSIS β¨
Functions/Subroutines
subroutine SGEHD2 (n, ilo, ihi, a, lda, tau, work, info)
SGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm. β that's the whole elevator pitch, no cap π«Ά
π Function/Subroutine Documentation π
subroutine SGEHD2 (integer n, integer ilo, integer ihi, real, dimension(
lda, * ) a, integer lda, real, dimension( * ) tau, real, dimension( * )
work, integer info)
ok so the signature in one breath: SGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm. π¦
π Purpose
!> !> SGEHD2 reduces a real general matrix A to upper Hessenberg form H by !> an orthogonal similarity transformation: Q**T * A * Q = H . !>
so likeβ¦ it takes your general messy real matrix and makes it Hessenberg (which is basically "almost upper triangular, one lil subdiagonal of chaos left") via an orthogonal similarity transform. the whole glow-up is Q**T * A * Q = H π
π Parameters
NβN is INTEGER. this is the order of the matrixA, andN >= 0. (can't have negative order babe, that's not a vibe)ILOβILO is INTEGER. that's literally all it says here lmao, keep scrolling for the details πIHIβIHI is INTEGER. the tea:Ais assumed to already be upper triangular in rows and columns1:ILO-1andIHI+1:N.ILOandIHIare normally set by a previous call toSGEBAL; otherwise they should be set to1andNrespectively. See Further Details. constraint check:1 <= ILO <= IHI <= max(1,N). π§AβA is REAL array, dimension (LDA,N). on entry: thenbyngeneral matrix to be reduced. on exit: the upper triangle and the first subdiagonal ofAare overwritten with the upper Hessenberg matrixH, and the elements below the first subdiagonal, with the arrayTAU, represent the orthogonal matrixQas a product of elementary reflectors. See Further Details. π (she's efficient, she reuses memory, she's iconic)LDAβLDA is INTEGER. the leading dimension of the arrayA.LDA >= max(1,N). πTAUβTAU is REAL array, dimension (N-1). the scalar factors of the elementary reflectors (see Further Details). βWORKβWORK is REAL array, dimension (N). that's it, that's the whole description, she's a workspace, she works π«ΆINFOβINFO is INTEGER:= 0: successful exit. slay π< 0: ifINFO = -i, thei-th argument had an illegal value. π¨
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole group project ate, fr fr πΈ
π₯ Further Details:
!> !> The matrix Q is represented as a product of (ihi-ilo) elementary !> reflectors !> !> Q = H(ilo) H(ilo+1) . . . H(ihi-1). !> !> Each H(i) has the form !> !> H(i) = I - tau * v * v**T !> !> where tau is a real scalar, and v is a real vector with !> v(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on !> exit in A(i+2:ihi,i), and tau in TAU(i). !>
so tau is a real scalar and v is a real vector, and the zeros/ones pattern is exactly as stated β memorize it, it's giving "exam question" energy ngl π
here's the visual, with n = 7, ilo = 2 and ihi = 6 β on entry vs. on exit:
on entry, on exit,
( a a a a a a a ) ( a a h h h h a )
( a a a a a a ) ( a h h h h a )
( a a a a a a ) ( h h h h h h )
( a a a a a a ) ( v2 h h h h h )
( a a a a a a ) ( v2 v3 h h h h )
( a a a a a a ) ( v2 v3 v4 h h h )
( a ) ( a )
where a denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i). π¦ look at the lil staircase, it's literally ascending, main character energy β¨
Definition at line 148 of file sgehd2.f. π
π Author
Generated automatically by Doxygen for LAPACK from the source code. β so nobody hand-wrote this, the robot did it, and honestly? she understood the assignment π€π
and that's the page bestie! πβ¨ππ¦πΈπ π«Ά
ok final sign-off: this is LAPACK, Version 3.12.0, and the file is /home/abui...RC/sgehd2.f(3) β mwah, go reduce some matrices, ily ππ
π¦ 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