SGEHD2(3)

πŸ“¦ version 3.12.0, in opensuse-leap 16.0

🌸 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 matrix A, and N >= 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: A is assumed to already be upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to SGEBAL; otherwise they should be set to 1 and N respectively. See Further Details. constraint check: 1 <= ILO <= IHI <= max(1,N). 🧚
  • A β€” A is REAL 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 elements below the first subdiagonal, with the array TAU, represent the orthogonal matrix Q as 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 array A. 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: if INFO = -i, the i-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