hetrd(3)
π hetrd(3) β {he,sy}trd: reduction to tridiagonal π
okay bestie, welcome to hetrd(3) from the Library Functions Manual β this is the page, the one about squishing your matrix down to tridiagonal form. main character energy fr. there's a whole squad of subroutines here (CHETRD, DSYTRD, SSYTRD, ZHETRD) and they all do the same iconic thing in different flavours. let's get into it β¨
πΈ NAME πΈ
hetrd β {he,sy}trd: reduction to tridiagonal. that's the whole vibe. π
β¨ SYNOPSIS β¨
π¦ Functions π¦
subroutine chetrd (uplo, n, a, lda, d, e, tau, work, lwork, info)
CHETRD
subroutine dsytrd (uplo, n, a, lda, d, e, tau, work, lwork, info)
DSYTRD
subroutine ssytrd (uplo, n, a, lda, d, e, tau, work, lwork, info)
SSYTRD
subroutine zhetrd (uplo, n, a, lda, d, e, tau, work, lwork, info)
ZHETRD
π Detailed Description π
(this is the bit that says everything else lives under Function Documentation β which, yes, is literally the next section. no notes. π«Ά)
π Function Documentation π
π subroutine chetrd π
subroutine chetrd (character uplo, integer n, complex, dimension( lda, * )
a, integer lda, real, dimension( * ) d, real, dimension( * ) e, complex,
dimension( * ) tau, complex, dimension( * ) work, integer lwork, integer
info)
CHETRD β say hi to the complex Hermitian one π
π« Purpose π«
CHETRDreduces a complex Hermitian matrixAto real symmetric tridiagonal formTby a unitary similarity transformation:Q**H * A * Q = T.
π Parameters π
UPLO
UPLOisCHARACTER*1='U': Upper triangle ofAis stored; ='L': Lower triangle ofAis stored.
N
NisINTEGERThe order of the matrixA.N >= 0.
A
AisCOMPLEXarray, dimension(LDA,N)On entry, the Hermitian matrixA. IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. On exit, ifUPLO = 'U', the diagonal and first superdiagonal ofAare overwritten by the corresponding elements of the tridiagonal matrixT, and the elements above the first superdiagonal, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors; ifUPLO = 'L', the diagonal and first subdiagonal ofAare over-written by the corresponding elements of the tridiagonal matrixT, and the elements below the first subdiagonal, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors. See Further Details.
LDA
LDAisINTEGERThe leading dimension of the arrayA.LDA >= max(1,N).
D
DisREALarray, dimension(N)The diagonal elements of the tridiagonal matrixT:D(i) = A(i,i).
E
EisREALarray, dimension(N-1)The off-diagonal elements of the tridiagonal matrixT:E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.
TAU
TAUisCOMPLEXarray, dimension(N-1)The scalar factors of the elementary reflectors (see Further Details).
WORK
WORKisCOMPLEXarray, dimension(MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.
LWORK
LWORKisINTEGERThe dimension of the arrayWORK.LWORK >= 1. For optimum performanceLWORK >= N*NB, whereNBis the optimal blocksize. 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: π§
IfUPLO = 'U', the matrixQis represented as a product of elementary reflectorsQ = H(n-1) . . . H(2) H(1).EachH(i)has the formH(i) = I - tau * v * v**Hwheretauis a complex scalar, andvis a complex vector withv(i+1:n) = 0andv(i) = 1;v(1:i-1)is stored on exit inA(1:i-1,i+1), andtauinTAU(i). IfUPLO = 'L', the matrixQis represented as a product of elementary reflectorsQ = H(1) H(2) . . . H(n-1).EachH(i)has the formH(i) = I - tau * v * v**Hwheretauis a complex scalar, andvis a complex vector withv(1:i) = 0andv(i+1) = 1;v(i+2:n)is stored on exit inA(i+2:n,i), andtauinTAU(i). The contents ofAon exit are illustrated by the following examples withn = 5: ifUPLO = 'U':( d e v2 v3 v4 ) ( d e v3 v4 ) ( d e v4 ) ( d e ) ( d )ifUPLO = 'L':( d ) ( e d ) ( v1 e d ) ( v1 v2 e d ) ( v1 v2 v3 e d )wheredandedenote diagonal and off-diagonal elements ofT, andvidenotes an element of the vector definingH(i).
Definition at line 191 of file chetrd.f. π
π¦ subroutine dsytrd π¦
subroutine dsytrd (character uplo, integer n, double precision, dimension(
lda, * ) a, integer lda, double precision, dimension( * ) d, double
precision, dimension( * ) e, double precision, dimension( * ) tau,
double precision, dimension( * ) work, integer lwork, integer info)
DSYTRD β the real symmetric double-precision one, aka the classic π
π« Purpose π«
DSYTRDreduces a real symmetric matrixAto real symmetric tridiagonal formTby an orthogonal similarity transformation:Q**T * A * Q = T.
π Parameters π
UPLO
UPLOisCHARACTER*1='U': Upper triangle ofAis stored; ='L': Lower triangle ofAis stored.
N
NisINTEGERThe order of the matrixA.N >= 0.
A
AisDOUBLE PRECISIONarray, dimension(LDA,N)On entry, the symmetric matrixA. IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. On exit, ifUPLO = 'U', the diagonal and first superdiagonal ofAare overwritten by the corresponding elements of the tridiagonal matrixT, and the elements above the first superdiagonal, with the arrayTAU, represent the orthogonal matrixQas a product of elementary reflectors; ifUPLO = 'L', the diagonal and first subdiagonal ofAare over-written by the corresponding elements of the tridiagonal matrixT, and the elements below the first subdiagonal, with the arrayTAU, represent the orthogonal matrixQas a product of elementary reflectors. See Further Details.
LDA
LDAisINTEGERThe leading dimension of the arrayA.LDA >= max(1,N).
D
DisDOUBLE PRECISIONarray, dimension(N)The diagonal elements of the tridiagonal matrixT:D(i) = A(i,i).
E
EisDOUBLE PRECISIONarray, dimension(N-1)The off-diagonal elements of the tridiagonal matrixT:E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.
TAU
TAUisDOUBLE PRECISIONarray, dimension(N-1)The scalar factors of the elementary reflectors (see Further Details).
WORK
WORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.
LWORK
LWORKisINTEGERThe dimension of the arrayWORK.LWORK >= 1. For optimum performanceLWORK >= N*NB, whereNBis the optimal blocksize. 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: π§
and this is the part where the page keeps rolling, bestie β hold that thought π
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors β like a little chain of transformations doing their thing, bestie π
:
Q = H(n-1) . . . H(2) H(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(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in TAU(i). π«Ά
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors:
Q = H(1) H(2) . . . H(n-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 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i). β¨
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( d e v2 v3 v4 ) ( d )
( d e v3 v4 ) ( e d )
( d e v4 ) ( v1 e d )
( d e ) ( v1 v2 e d )
( d ) ( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i). π¦
Definition at line 191 of file dsytrd.f.
πΈ ssytrd β SSYTRD πΈ
subroutine ssytrd (character uplo, integer n, real, dimension( lda, * ) a,
integer lda, real, dimension( * ) d, real, dimension( * ) e, real,
dimension( * ) tau, real, dimension( * ) work, integer lwork, integer
info)
Purpose β¨
SSYTRD reduces a real symmetric matrix A to real symmetric tridiagonal form T by an orthogonal similarity transformation: Q**T * A * Q = T. Periodt. π
Parameters π
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGERThe order of the matrixA.N >= 0.AβAisREALarray, dimension(LDA,N)On entry, the symmetric matrixA. IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. On exit, ifUPLO = 'U', the diagonal and first superdiagonal ofAare overwritten by the corresponding elements of the tridiagonal matrixT, and the elements above the first superdiagonal, with the arrayTAU, represent the orthogonal matrixQas a product of elementary reflectors; ifUPLO = 'L', the diagonal and first subdiagonal ofAare overwritten by the corresponding elements of the tridiagonal matrixT, and the elements below the first subdiagonal, with the arrayTAU, represent the orthogonal matrixQas a product of elementary reflectors. See Further Details.LDAβLDAisINTEGERThe leading dimension of the arrayA.LDA >= max(1,N).DβDisREALarray, dimension(N)The diagonal elements of the tridiagonal matrixT:D(i) = A(i,i).EβEisREALarray, dimension(N-1)The off-diagonal elements of the tridiagonal matrixT:E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.TAUβTAUisREALarray, dimension(N-1)The scalar factors of the elementary reflectors (see Further Details).WORKβWORKisREALarray, dimension(MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORKisINTEGERThe dimension of the arrayWORK.LWORK >= 1. For optimum performanceLWORK >= N*NB, whereNBis the optimal blocksize. 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 π₯
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors:
Q = H(n-1) . . . H(2) H(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(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in TAU(i). π
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors:
Q = H(1) H(2) . . . H(n-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 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i). π
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( d e v2 v3 v4 ) ( d )
( d e v3 v4 ) ( e d )
( d e v4 ) ( v1 e d )
( d e ) ( v1 v2 e d )
( d ) ( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i). π
Definition at line 191 of file ssytrd.f.
π¦ zhetrd β ZHETRD π¦
subroutine zhetrd (character uplo, integer n, complex*16, dimension( lda, *
) a, integer lda, double precision, dimension( * ) d, double precision,
dimension( * ) e, complex*16, dimension( * ) tau, complex*16, dimension(
* ) work, integer lwork, integer info)
Purpose β¨
ZHETRD reduces a complex Hermitian matrix A to real symmetric tridiagonal form T by a unitary similarity transformation: Q**H * A * Q = T. Iconic behavior, honestly. π
Parameters π
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGERThe order of the matrixA.N >= 0.AβAisCOMPLEX*16array, dimension(LDA,N)On entry, the Hermitian matrixA. IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. On exit, ifUPLO = 'U', the diagonal and first superdiagonal ofAare overwritten by the corresponding elements of the tridiagonal matrixT, and the elements above the first superdiagonal, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors; ifUPLO = 'L', the diagonal and first subdiagonal ofAare overwritten by the corresponding elements of the tridiagonal matrixT, and the elements below the first subdiagonal, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors. See Further Details.LDAβLDAisINTEGERThe leading dimension of the arrayA.LDA >= max(1,N).DβDisDOUBLE PRECISIONarray, dimension(N)The diagonal elements of the tridiagonal matrixT:D(i) = A(i,i).EβEisDOUBLE PRECISIONarray, dimension(N-1)The off-diagonal elements of the tridiagonal matrixT:E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.TAUβTAUisCOMPLEX*16array, dimension(N-1)The scalar factors of the elementary reflectors (see Further Details).WORKβWORKisCOMPLEX*16array, dimension(MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORKisINTEGERThe dimension of the arrayWORK.LWORK >= 1. For optimum performanceLWORK >= N*NB, whereNBis the optimal blocksize. 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
The absolute legends behind this masterpiece:
Univ. of TennesseeUniv. of California BerkeleyUniv. of Colorado DenverNAG Ltd.
π Further Details:
Okay bestie, this is where it gets mathematically iconic. Strap in. π
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors:
Q = H(n-1) . . . H(2) H(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(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors:
Q = H(1) H(2) . . . H(n-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 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( d e v2 v3 v4 ) ( d )
( d e v3 v4 ) ( e d )
( d e v4 ) ( v1 e d )
( d e ) ( v1 v2 e d )
( d ) ( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i).
π Definition at line 191 of file zhetrd.f.
π§ Author
Generated automatically by Doxygen for LAPACK.
β¨ Source/version tea: this iconic page comes from LAPACK, Version 3.12.0, and it's literally the hetrd(3) page β periodt. π
π
π¦ 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