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)โ theCGEHRDone ๐subroutine dgehrd (n, ilo, ihi, a, lda, tau, work, lwork, info)โ theDGEHRDone ๐ฆsubroutine sgehrd (n, ilo, ihi, a, lda, tau, work, lwork, info)โ theSGEHRDone ๐subroutine zgehrd (n, ilo, ihi, a, lda, tau, work, lwork, info)โ theZGEHRDone ๐
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 matrixA.N >= 0. ๐ILOโINTEGER. that's genuinely the entire description, no cap ๐ญ the lore lives inIHI, keep reading.IHIโINTEGER. It is assumed thatAis already upper triangular in rows and columns1:ILO-1andIHI+1:N.ILOandIHIare normally set by a previous call toCGEBAL; otherwise they should be set to1andNrespectively. See Further Details. And the rules are:1 <= ILO <= IHI <= N, ifN > 0;ILO=1andIHI=0, ifN=0. ๐ฆAโCOMPLEXarray, dimension(LDA,N). On entry, the N-by-N general 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 unitary matrixQas a product of elementary reflectors. See Further Details. ๐LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). ๐TAUโCOMPLEXarray, dimension(N-1). The scalar factors of the elementary reflectors (see Further Details). Elements1:ILO-1andIHI:N-1ofTAUare set to zero. โจWORKโCOMPLEXarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. ๐LWORKโINTEGER. The length of the arrayWORK.LWORK >= max(1,N). For good performance,LWORKshould generally be larger. ๐ซถ IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.INFOโINTEGER.= 0: successful exit.< 0: ifINFO = -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 matrixA.N >= 0. ๐ILOโINTEGER. again, that's the whole description. we move. ๐ญIHIโINTEGER. It is assumed thatAis already upper triangular in rows and columns1:ILO-1andIHI+1:N.ILOandIHIare normally set by a previous call toDGEBAL; otherwise they should be set to1andNrespectively. See Further Details. Also:1 <= ILO <= IHI <= N, ifN > 0;ILO=1andIHI=0, ifN=0. ๐ฆAโDOUBLE PRECISIONarray, dimension(LDA,N). On entry, the N-by-N general 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. ๐LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). ๐TAUโDOUBLE PRECISIONarray, dimension(N-1). The scalar factors of the elementary reflectors (see Further Details). Elements1:ILO-1andIHI:N-1ofTAUare set to zero. โจWORKโDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. ๐LWORKโINTEGER. The length of the arrayWORK.LWORK >= max(1,N). For good performance,LWORKshould generally be larger. ๐ซถ IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.INFOโINTEGER.= 0: successful exit.< 0: ifINFO = -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 matrixA.N >= 0. ๐ILOโINTEGER. (yes, the description really is just that. iconic minimalism.) ๐IHIโINTEGER. It is assumed thatAis already 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. And:1 <= ILO <= IHI <= N, ifN > 0;ILO=1andIHI=0, ifN=0. ๐ฆAโAisREALarray, dimension(LDA,N). On entry, it's theN-by-Ngeneral 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. ๐ซถLDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). ๐TAUโTAUisREALarray, dimension(N-1). The scalar factors of the elementary reflectors (see Further Details). Elements1:ILO-1andIHI:N-1ofTAUare set to zero. โจWORKโWORKisREALarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. ๐LWORKโLWORKisINTEGER. The length of the arrayWORK.LWORK >= max(1,N). For good performance,LWORKshould generally be larger.
๐จ IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. ๐
INFOโINFOisINTEGER.= 0: successful exit.< 0: ifINFO = -i, thei-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โNisINTEGER. The order of the matrixA.N >= 0. โจILOโILOisINTEGER. ๐ซถIHIโIHIisINTEGER. It is assumed thatAis already upper triangular in rows and columns1:ILO-1andIHI+1:N.ILOandIHIare normally set by a previous call toZGEBAL; otherwise they should be set to1andNrespectively. See Further Details.1 <= ILO <= IHI <= N, ifN > 0;ILO=1andIHI=0, ifN=0. ๐ธAโAisCOMPLEX*16array, dimension(LDA,N). On entry, theN-by-Ngeneral 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 unitary matrixQas a product of elementary reflectors. See Further Details. ๐LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). ๐TAUโTAUisCOMPLEX*16array, dimension(N-1). The scalar factors of the elementary reflectors (see Further Details). Elements1:ILO-1andIHI:N-1ofTAUare set to zero. โจWORKโWORKisCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. ๐LWORKโLWORKisINTEGER. The length of the arrayWORK.LWORK >= max(1,N). For good performance,LWORKshould generally be larger.
๐จ IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. ๐
INFOโINFOisINTEGER.= 0: successful exit.< 0: ifINFO = -i, thei-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 wholegehrd(3)glow-up, bestie โ source/version footer stamp: LAPACK, Version 3.12.0, taggehrd(3). Go reduce something and slay your Hessenberg. ๐ โจ
๐ฆ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 ยท custom
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms