gehrd(3)

๐Ÿ’– gehrd(3) โ€” the "reduction to Hessenberg" glow-up, bestie โœจ

okay so this is gehrd(3), living its best life in the Library Functions Manual, and it's genuinely one of those pages that's giving "four sisters, same personality" energy. Four subroutines, same signature, different precision flavours. Let's get into it ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

gehrd โ€” reduction to Hessenberg. That's the whole name, that's the whole vibe, periodt. ๐Ÿ‘‘


โœจ SYNOPSIS โœจ

๐Ÿงš Functions ๐Ÿงš

  • subroutine cgehrd (n, ilo, ihi, a, lda, tau, work, lwork, info) โ€” the CGEHRD one ๐Ÿ’œ
  • subroutine dgehrd (n, ilo, ihi, a, lda, tau, work, lwork, info) โ€” the DGEHRD one ๐Ÿฆ‹
  • subroutine sgehrd (n, ilo, ihi, a, lda, tau, work, lwork, info) โ€” the SGEHRD one ๐ŸŽ€
  • subroutine zgehrd (n, ilo, ihi, a, lda, tau, work, lwork, info) โ€” the ZGEHRD one ๐ŸŒˆ

notice how every single one has the exact same argument list? yeah. consistency is mother. ๐Ÿซถ


๐Ÿ’ซ Detailed Description ๐Ÿ’ซ

the overview section here is lowkey doing the absolute bare minimum โ€” it's just vibes and a heading. the actual tea is all under Function Documentation below, where each subroutine gets its full main-character moment. keep scrolling, bestie. โญ


๐Ÿ‘‘ Function Documentation ๐Ÿ‘‘

๐Ÿ’… cgehrd ๐Ÿ’…

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

CGEHRD โœจ

๐ŸŒŸ Purpose ๐ŸŒŸ

so CGEHRD takes a complex general matrix A and reduces it to upper Hessenberg form H by an unitary similarity transformation. (yes, "an unitary" โ€” that's literally what it says, we don't fix it, we respect it ๐Ÿ’…) and the transformation is this exact thing right here:

Q**H * A * Q = H .

ate. ๐Ÿ”ฅ

๐ŸŽ€ Parameters ๐ŸŽ€

  • N โ€” INTEGER. The order of the matrix A. N >= 0. ๐Ÿ’–
  • ILO โ€” INTEGER. that's genuinely the entire description, no cap ๐Ÿ˜ญ the lore lives in IHI, keep reading.
  • IHI โ€” 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. And the rules are: 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. ๐Ÿฆ‹
  • A โ€” 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. ๐Ÿ‘€
  • LDA โ€” INTEGER. The leading dimension of the array A. LDA >= max(1,N). ๐ŸŽ€
  • TAU โ€” COMPLEX array, dimension (N-1). The scalar factors of the elementary reflectors (see Further Details). Elements 1:ILO-1 and IHI:N-1 of TAU are set to zero. โœจ
  • WORK โ€” COMPLEX array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. ๐Ÿ’œ
  • LWORK โ€” INTEGER. The length of the array WORK. LWORK >= max(1,N). For good performance, LWORK should generally be larger. ๐Ÿซถ If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
  • INFO โ€” 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.

(icons, all of them ๐Ÿ‘‘)

๐Ÿ”ฅ 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). ๐Ÿฆ‹

This file is a slight modification of LAPACK-3.0's CGEHRD subroutine incorporating improvements proposed by Quintana-Orti and Van de Geijn (2006). (See CLAHR2.) ๐Ÿงš

Definition at line 166 of file cgehrd.f. ๐Ÿ“


๐Ÿ’œ dgehrd ๐Ÿ’œ

subroutine dgehrd (integer n, integer ilo, integer ihi, double precision, dimension( lda, * ) a, integer lda, double precision, dimension( * ) tau, double precision, dimension( * ) work, integer lwork, integer info)

DGEHRD โœจ

๐ŸŒŸ Purpose ๐ŸŒŸ

DGEHRD reduces a real general matrix A to upper Hessenberg form H by an orthogonal similarity transformation. (orthogonal this time, not unitary โ€” glow-up, but make it real ๐Ÿ’…)

Q**T * A * Q = H .

๐ŸŽ€ Parameters ๐ŸŽ€

  • N โ€” INTEGER. The order of the matrix A. N >= 0. ๐Ÿ’–
  • ILO โ€” INTEGER. again, that's the whole description. we move. ๐Ÿ˜ญ
  • IHI โ€” 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. Also: 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. ๐Ÿฆ‹
  • A โ€” 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 โ€” INTEGER. The leading dimension of the array A. LDA >= max(1,N). ๐ŸŽ€
  • TAU โ€” DOUBLE PRECISION array, dimension (N-1). The scalar factors of the elementary reflectors (see Further Details). Elements 1:ILO-1 and IHI:N-1 of TAU are set to zero. โœจ
  • WORK โ€” DOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. ๐Ÿ’œ
  • LWORK โ€” INTEGER. The length of the array WORK. LWORK >= max(1,N). For good performance, LWORK should generally be larger. ๐Ÿซถ If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
  • INFO โ€” 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). ๐Ÿฆ‹

This file is a slight modification of LAPACK-3.0's DGEHRD subroutine incorporating improvements proposed by Quintana-Orti and Van de Geijn (2006). (See DLAHR2.) ๐Ÿงš

Definition at line 166 of file dgehrd.f. ๐Ÿ“


๐ŸŽ€ sgehrd ๐ŸŽ€

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

SGEHRD โœจ

๐ŸŒŸ Purpose ๐ŸŒŸ

SGEHRD reduces a real general matrix A to upper Hessenberg form H by an orthogonal similarity transformation. same energy as DGEHRD, different precision paperwork ๐Ÿ’…

Q**T * A * Q = H .

๐ŸŽ€ Parameters ๐ŸŽ€

  • N โ€” INTEGER. The order of the matrix A. N >= 0. ๐Ÿ’–
  • ILO โ€” INTEGER. (yes, the description really is just that. iconic minimalism.) ๐Ÿ™ˆ
  • IHI โ€” 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. And: 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. ๐Ÿฆ‹
  • A โ€” A is REAL array, dimension (LDA,N). On entry, it's 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). Elements 1:ILO-1 and IHI:N-1 of TAU are set to zero. โœจ
  • WORK โ€” WORK is REAL array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. ๐ŸŽ€
  • LWORK โ€” LWORK is INTEGER. The length of the array WORK. LWORK >= max(1,N). For good performance, LWORK should generally be larger.
๐Ÿšจ If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. ๐Ÿ’€
  • INFO โ€” INFO is INTEGER. = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value. ๐Ÿ˜ญ

Author ๐ŸŽ€

These legends wrote it:

  • 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). ๐Ÿ’œ

This file is a slight modification of LAPACK-3.0's SGEHRD subroutine incorporating improvements proposed by Quintana-Orti and Van de Geijn (2006). (See SLAHR2.)

๐Ÿ“Œ Definition at line 166 of file sgehrd.f.

๐Ÿ’œ subroutine zgehrd โ€” the COMPLEX*16 sibling

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

ZGEHRD ๐Ÿ’…

Purpose ๐ŸŽฏ

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

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 <= N, if N > 0; ILO=1 and IHI=0, if N=0. ๐ŸŒธ
  • 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). Elements 1:ILO-1 and IHI:N-1 of TAU are set to zero. โœจ
  • WORK โ€” WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. ๐ŸŽ€
  • LWORK โ€” LWORK is INTEGER. The length of the array WORK. LWORK >= max(1,N). For good performance, LWORK should generally be larger.
๐Ÿšจ If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. ๐Ÿ’€
  • 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; 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). ๐Ÿ’œ

This file is a slight modification of LAPACK-3.0's ZGEHRD subroutine incorporating improvements proposed by Quintana-Orti and Van de Geijn (2006). (See ZLAHR2.)

๐Ÿ“Œ Definition at line 166 of file zgehrd.f.

Author ๐Ÿค–

Generated automatically by Doxygen for LAPACK from the source code.


๐ŸŽ€ That's the whole gehrd(3) glow-up, bestie โ€” source/version footer stamp: LAPACK, Version 3.12.0, tag gehrd(3). Go reduce something and slay your Hessenberg. ๐Ÿ’…โœจ
๐Ÿ“ฆ where this page comes from