gehd2(3)

πŸ’… gehd2(3) β€” reduction to Hessenberg, level 2 (yes bestie, THAT gehd2(3), from the Library Functions Manual)

okay so picture this: you've got a big square matrix and it's giving messy. gehd2 is the glow-up routine β€” it takes your general square matrix and serves upper Hessenberg form, and it does it with the unblocked algorithm (aka the level-2 tea, no blocking, one reflector at a time, very main character energy). Four flavors live here, one for each precision/type combo. No cap. 🌸


✨ SYNOPSIS ✨

🫢 Functions

  • subroutine cgehd2 (n, ilo, ihi, a, lda, tau, work, info) β€” CGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm.
  • subroutine dgehd2 (n, ilo, ihi, a, lda, tau, work, info) β€” DGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm.
  • subroutine sgehd2 (n, ilo, ihi, a, lda, tau, work, info) β€” SGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm.
  • subroutine zgehd2 (n, ilo, ihi, a, lda, tau, work, info) β€” ZGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm.

πŸ’– literally four icons, same job, different data types. pick your fighter.

🌈 Detailed Description

deadass this page is just the Function Documentation. scroll down bestie, it's all there. πŸ‘‡

πŸ‘‘ Function Documentation

πŸ¦‹ subroutine cgehd2 (integer n, integer ilo, integer ihi, complex, dimension( lda, * ) a, integer lda, complex, dimension( * ) tau, complex, dimension( * ) work, integer info)

CGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm.

πŸ’œ Purpose:

!>
!> CGEHD2 reduces a complex general matrix A to upper Hessenberg form H
!> by a unitary similarity transformation:  Q**H * A * Q = H .
!>

the way it just vibes a whole similarity transform into existence. it's giving ✨ linear algebra ✨.

πŸŽ€ Parameters

  • N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!>
  • ILO
!>          ILO is INTEGER
!>
  • IHI
!>          IHI is INTEGER
!>
!>          It is assumed that A is already upper triangular in rows
!>          and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally
!>          set by a previous call to CGEBAL; otherwise they should be
!>          set to 1 and N respectively. See Further Details.
!>          1 <= ILO <= IHI <= max(1,N).
!>

okay so ILO and IHI are the "already done, don't touch" zone markers β€” the assumption is that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. Those two usually come from a prior call to CGEBAL; if you're not doing that, just set them to 1 and N. and the constraint is 1 <= ILO <= IHI <= max(1,N), periodt. 🫢

  • A
!>          A is COMPLEX 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 unitary matrix Q as a product of elementary
!>          reflectors. See Further Details.
!>

on entry: the n by n general matrix to be reduced. on exit: the upper triangle and first subdiagonal of A get overwritten with the upper Hessenberg matrix H, and everything below the first subdiagonal β€” together with the array TAU β€” represents the unitary matrix Q as a product of elementary reflectors. πŸ’… see Further Details, obviously.

  • LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!>
  • TAU
!>          TAU is COMPLEX array, dimension (N-1)
!>          The scalar factors of the elementary reflectors (see Further
!>          Details).
!>
  • WORK
!>          WORK is COMPLEX array, dimension (N)
!>
  • INFO
!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value.
!>

0 means slay, we're done. anything < 0 means the i-th argument was illegal and INFO told you exactly which one narc'd. πŸ™ˆ

🌟 Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

🧚 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**H
!>
!>  where tau is a complex scalar, and v is a complex 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).
!>
!>  The contents of A are illustrated by the following example, with
!>  n = 7, ilo = 2 and ihi = 6:
!>
!>  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).
!>

so Q is a product of (ihi-ilo) elementary reflectors, Q = H(ilo) H(ilo+1) . . . H(ihi-1), and each H(i) has the form H(i) = I - tau * v * v**H. tau is a complex scalar, v is a complex vector with v(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) lands on exit in A(i+2:ihi,i), and tau lands in TAU(i). the little diagram above? that's the glow-up before/after. a = element of the original matrix A, h = modified element of the upper Hessenberg matrix H, and vi = an element of the vector defining H(i). iconic honestly. πŸ“Έ

Definition at line 148 of file cgehd2.f.


πŸ“ subroutine dgehd2 (integer n, integer ilo, integer ihi, double precision, dimension( lda, * ) a, integer lda, double precision, dimension( * ) tau, double precision, dimension( * ) work, integer info)

DGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm.

πŸ’œ Purpose:

!>
!> DGEHD2 reduces a real general matrix A to upper Hessenberg form H by
!> an orthogonal similarity transformation:  Q**T * A * Q = H .
!>

same ritual, but real, and it's a transpose (Q**T) instead of a conjugate transpose. know the difference bestie, iykyk. πŸ¦‹

πŸŽ€ Parameters

  • N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!>
  • ILO
!>          ILO is INTEGER
!>
  • IHI
!>          IHI is INTEGER
!>
!>          It is assumed that A is already upper triangular in rows
!>          and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally
!>          set by a previous call to DGEBAL; otherwise they should be
!>          set to 1 and N respectively. See Further Details.
!>          1 <= ILO <= IHI <= max(1,N).
!>

again with the 1:ILO-1 and IHI+1:N already-upper-triangular assumption, and again these come from a previous call β€” this time to DGEBAL. otherwise 1 and N. and yes, 1 <= ILO <= IHI <= max(1,N). no notes. πŸ’…

  • A
!>          A is DOUBLE PRECISION 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.
!>
  • LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!>
  • TAU
!>          TAU is DOUBLE PRECISION array, dimension (N-1)
!>          The scalar factors of the elementary reflectors (see Further
!>          Details).
!>
  • WORK
!>          WORK is DOUBLE PRECISION array, dimension (N)
!>
  • INFO
!>          INFO is INTEGER
!>          = 0:  successful exit.
!>          < 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.

🧚 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).
!>
!>  The contents of A are illustrated by the following example, with
!>  n = 7, ilo = 2 and ihi = 6:
!>
!>  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).
!>

same deal, except H(i) = I - tau * v * v**T with tau a real scalar and v a real vector. everything else β€” the (ihi-ilo) reflectors, the zeroed v(1:i), the v(i+1) = 1, the v(ihi+1:n) = 0, the storage of v(i+2:ihi) in A(i+2:ihi,i) and tau in TAU(i) β€” all identical. the before/after diagram is literally the same and honestly? still obsessed. πŸ”₯

Definition at line 148 of file dgehd2.f.


🧊 subroutine sgehd2 (integer n, integer ilo, integer ihi, real, dimension( lda, * ) a, integer lda, real, dimension( * ) tau, real, dimension( * ) work, integer info)

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 .
!>

single-precision twin of DGEHD2. same energy, smaller floats. 🌸

πŸŽ€ Parameters

  • N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!>
  • ILO
!>          ILO is INTEGER
!>
  • IHI
!>          IHI is INTEGER
!>
!>          It is assumed that A is already 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.
!>          1 <= ILO <= IHI <= max(1,N).
!>

this time the prior call is to SGEBAL β€” the rest of the vibe is unchanged: 1:ILO-1 and IHI+1:N assumed upper triangular, otherwise just 1 and N, and 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.
!>
  • 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)
!>
  • INFO
!>          INFO is INTEGER
!>          = 0:  successful exit.
!>          < 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.

🧚 Further Details:

...and that's exactly where we're pausing, bestie β€” Further Details for sgehd2 picks up in part 2. don't go anywhere. πŸŽ€

okay so the matrix Q over here is literally built as a product of (ihi-ilo) elementary reflectors, periodt:

!>     Q = H(ilo) H(ilo+1) . . . H(ihi-1).

and each H(i) is giving:

!>     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; on exit, v(i+2:ihi) is stored in A(i+2:ihi,i), and tau is stored in TAU(i). no cap πŸ’…

the contents of A are illustrated by this example, with n = 7, ilo = 2, and ihi = 6 β€” literally the source draws it like this:

!>  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).

and fr fr, this one lives at Definition at line 148 of file sgehd2.f. 🫢


🌟 subroutine zgehd2 🌟

   subroutine zgehd2 (integer n, integer ilo, integer ihi, complex*16,
       dimension( lda, * ) a, integer lda, complex*16, dimension( * ) tau,
       complex*16, dimension( * ) work, integer info)

ZGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm. iconic behavior, honestly 😌

πŸ’– Purpose πŸ’–

ZGEHD2 reduces a complex general matrix A to upper Hessenberg form H by a unitary similarity transformation:

!>  Q**H * A * Q = H .

like, that's the whole mission bestie ✨

🌸 Parameters 🌸

  • N β€” N is INTEGER. the order of the matrix A. N >= 0.
  • ILO β€” ILO is INTEGER.
  • IHI β€” IHI is INTEGER. it is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to ZGEBAL; otherwise they should be set to 1 and N respectively. see Further Details. 1 <= ILO <= IHI <= max(1,N).
  • A β€” A is COMPLEX*16 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 unitary matrix Q as a product of elementary reflectors. see Further Details.
  • LDA β€” LDA is INTEGER. the leading dimension of the array A. LDA >= max(1,N).
  • TAU β€” TAU is COMPLEX*16 array, dimension (N-1). the scalar factors of the elementary reflectors (see Further Details).
  • WORK β€” WORK is COMPLEX*16 array, dimension (N).
  • INFO β€” INFO is INTEGER. = 0: successful exit. < 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.

🧚 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**H

where tau is a complex scalar, and v is a complex vector with v(1:i) = 0, v(i+1) = 1, and v(ihi+1:n) = 0; on exit, v(i+2:ihi) is stored in A(i+2:ihi,i), and tau is stored in TAU(i). slay ✨

the contents of A are illustrated by this example, with n = 7, ilo = 2, and ihi = 6:

!>  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).

and this one is also at Definition at line 148 of file zgehd2.f. πŸ¦‹

Author (of the page itself): Generated automatically by Doxygen for LAPACK from the source code.


okay that's the whole gehd2(3) moment bestie β€” LAPACK Version 3.12.0, footer source/date tag gehd2(3), love u bye πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from