hbtrd(3)
πΈ NAME πΈ
hbtrd(3) β straight out of the Library Functions Manual, babes π β and the actual name line is:
hbtrd β {hb,sb}trd: reduction to tridiagonal β¨
okay so real talk: this is the family page for the four routines that take your band matrix and reduce it to tridiagonal form. It's giving "glow-up arc". Let's go π
β¨ SYNOPSIS β¨
π Functions
chbtrdβ theCHBTRDgirlie πdsbtrdβ theDSBTRDgirlie πssbtrdβ theSSBTRDgirlie πzhbtrdβ theZHBTRDgirlie π
and their signatures, exactly, no cap:
subroutine chbtrd (vect, uplo, n, kd, ab, ldab, d, e, q, ldq, work,
info)
subroutine dsbtrd (vect, uplo, n, kd, ab, ldab, d, e, q, ldq, work,
info)
subroutine ssbtrd (vect, uplo, n, kd, ab, ldab, d, e, q, ldq, work,
info)
subroutine zhbtrd (vect, uplo, n, kd, ab, ldab, d, e, q, ldq, work,
info)
π¦ Detailed Description π¦
bestie the source literally has nothing under this heading. Empty. Void. Main-character silence π so I'm not gonna invent lore, we're just heading straight into the function docs. iykyk.
π Function Documentation π
π subroutine chbtrd (character vect, character uplo, integer n, integer kd, complex, dimension( ldab, * ) ab, integer ldab, real, dimension( * ) d, real, dimension( * ) e, complex, dimension( ldq, * ) q, integer ldq, complex, dimension( * ) work, integer info)
CHBTRD
β Purpose:
so what does she do? here's the word-for-word vibe:
!>
!> CHBTRD reduces a complex Hermitian band matrix A to real symmetric
!> tridiagonal form T by a unitary similarity transformation:
!> Q**H * A * Q = T.
!>
complex Hermitian band in, real symmetric tridiagonal out. iconic transformation honestly π₯
π Parameters
VECTβ it's aCHARACTER*1and it controls whether we even bother buildingQ:= 'N': do not formQ;= 'V': formQ;= 'U': update a matrixX, by formingX*Q.
UPLOβ alsoCHARACTER*1, picks which triangle you're feeding her:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβINTEGER. The order of the matrixA.N >= 0. no negatives, bestie, that's literally not allowed π«ΆKDβINTEGER. The number of superdiagonals of the matrixAifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KD >= 0. your band width, basically β¨ABβCOMPLEXarray, dimension(LDAB,N).
On entry, the upper or lower triangle of the Hermitian band matrix A, stored in the first KD+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:
if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
On exit, the diagonal elements of AB are overwritten by the diagonal elements of the tridiagonal matrix T; if KD > 0, the elements on the first superdiagonal (if UPLO = 'U') or the first subdiagonal (if UPLO = 'L') are overwritten by the off-diagonal elements of T; the rest of AB is overwritten by values generated during the reduction.
β οΈ so like β she overwrites AB. your original data is gone-gone. not me warning you twice π
LDABβINTEGER. The leading dimension of the arrayAB.LDAB >= KD+1. respect the boundary, queen πDβREALarray, dimension(N). The diagonal elements of the tridiagonal matrixT. the actual stars of the show πEβREALarray, dimension(N-1). The off-diagonal elements of the tridiagonal matrixT:E(i) = T(i,i+1)ifUPLO = 'U';E(i) = T(i+1,i)ifUPLO = 'L'. she's short by one and that's correct πQβCOMPLEXarray, dimension(LDQ,N).
On entry, if VECT = 'U', then Q must contain an N-by-N matrix X; if VECT = 'N' or 'V', then Q need not be set.
On exit:
- if
VECT = 'V',Qcontains theN-by-Nunitary matrixQ; - if
VECT = 'U',Qcontains the productX*Q; - if
VECT = 'N', the arrayQis not referenced.
(yes she said "the unitary matrix Q" and also "Q" β same name, different energy, iykyk π)
LDQβINTEGER. The leading dimension of the arrayQ.LDQ >= 1, andLDQ >= NifVECT = 'V'or'U'. read it twice, that second clause is the one people miss πWORKβCOMPLEXarray, dimension(N). scratch space, no notes β¨INFOβINTEGER:= 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:
!>
!> Modified by Linda Kaufman, Bell Labs.
!>
π Definition at line 161 of file chbtrd.f.
π subroutine dsbtrd (character vect, character uplo, integer n, integer kd, double precision, dimension( ldab, * ) ab, integer ldab, double precision, dimension( * ) d, double precision, dimension( * ) e, double precision, dimension( ldq, * ) q, integer ldq, double precision, dimension( * ) work, integer info)
DSBTRD
β Purpose:
!>
!> DSBTRD reduces a real symmetric band matrix A to symmetric
!> tridiagonal form T by an orthogonal similarity transformation:
!> Q**T * A * Q = T.
!>
double precision edition, and note she says Q**T β the transpose, not the conjugate transpose. details matter bestie π
π Parameters
VECTβCHARACTER*1:= 'N': do not formQ;= 'V': formQ;= 'U': update a matrixX, by formingX*Q.
UPLOβCHARACTER*1:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβINTEGER. The order of the matrixA.N >= 0.KDβINTEGER. The number of superdiagonals of the matrixAifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KD >= 0.ABβDOUBLE PRECISIONarray, dimension(LDAB,N).
On entry, the upper or lower triangle of the symmetric band matrix A, stored in the first KD+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:
if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
On exit, the diagonal elements of AB are overwritten by the diagonal elements of the tridiagonal matrix T; if KD > 0, the elements on the first superdiagonal (if UPLO = 'U') or the first subdiagonal (if UPLO = 'L') are overwritten by the off-diagonal elements of T; the rest of AB is overwritten by values generated during the reduction.
β οΈ again: AB gets overwritten. you've been warned, gorgeous π«Ά
LDABβINTEGER. The leading dimension of the arrayAB.LDAB >= KD+1.DβDOUBLE PRECISIONarray, dimension(N). The diagonal elements of the tridiagonal matrixT.EβDOUBLE PRECISIONarray, dimension(N-1). The off-diagonal elements of the tridiagonal matrixT:E(i) = T(i,i+1)ifUPLO = 'U';E(i) = T(i+1,i)ifUPLO = 'L'.QβDOUBLE PRECISIONarray, dimension(LDQ,N).
On entry, if VECT = 'U', then Q must contain an N-by-N matrix X; if VECT = 'N' or 'V', then Q need not be set.
On exit:
- if
VECT = 'V',Qcontains theN-by-Northogonal matrixQ; - if
VECT = 'U',Qcontains the productX*Q; - if
VECT = 'N', the arrayQis not referenced.
LDQβINTEGER. The leading dimension of the arrayQ.LDQ >= 1, andLDQ >= NifVECT = 'V'or'U'.WORKβDOUBLE PRECISIONarray, dimension(N).INFOβINTEGER:= 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:
!>
!> Modified by Linda Kaufman, Bell Labs.
!>
π Definition at line 161 of file dsbtrd.f.
π subroutine ssbtrd (character vect, character uplo, integer n, integer kd, real, dimension( ldab, * ) ab, integer ldab, real, dimension( * ) d, real, dimension( * ) e, real, dimension( ldq, * ) q, integer ldq, real, dimension( * ) work, integer info)
SSBTRD
β Purpose:
!>
!> SSBTRD reduces a real symmetric band matrix A to symmetric
!> tridiagonal form T by an orthogonal similarity transformation:
!> Q**T * A * Q = T.
!>
same routine as DSBTRD but single precision β she's the REAL one and yes she's still that girl π₯
π Parameters
VECTβCHARACTER*1:= 'N': do not formQ;= 'V': formQ;= 'U': update a matrixX, by formingX*Q.
UPLOβCHARACTER*1:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβINTEGER. The order of the matrixA.N >= 0.KDβINTEGER. The number of superdiagonals of the matrixAifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KD >= 0.ABβREALarray, dimension(LDAB,N).
On entry, the upper or lower triangle of the symmetric band matrix A, stored in the first KD+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:
if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
On exit, the diagonal elements of AB are overwritten by the diagonal elements of the tridiagonal matrix T; if KD > 0, the elements on the first superdiagonal (if UPLO = 'U') or the first subdiagonal (if UPLO = 'L') are overwritten by the off-diagonal elements of T; the rest of AB is overwritten by values generated during the reduction.
β οΈ yes, AB is still getting overwritten. it's a whole thing. protect your data, bestie π
LDABβINTEGER. The leading dimension of the arrayAB.LDAB >= KD+1.DβREALarray, dimension(N). The diagonal elements of the tridiagonal matrixT.Eβ π¦ (okayE's full glow-up, plusQ,LDQ,WORK,INFO, the author credits and the file line β all of that is literally continuing in part 2, we're stopping mid-parameter π hold that thought, babe π«Ά)E(REAL array, dimension(N-1)) β the off-diagonal besties of the tridiagonal matrixT, aka the β¨side charactersβ¨. Specifically:E(i) = T(i,i+1)ifUPLO = 'U';E(i) = T(i+1,i)ifUPLO = 'L'. iykyk πQ(REAL array, dimension(LDQ,N)) β okay so on entry, ifVECT = 'U', thenQmust contain an N-by-N matrixX; ifVECT = 'N'or'V', thenQneed not be set (she's off duty, leave her alone π).
On exit though? Different story:
- if
VECT = 'V',Qcontains the N-by-N orthogonal matrixQβ main character energy π - if
VECT = 'U',Qcontains the productX*Q - if
VECT = 'N', the arrayQis not referenced. not even looked at. ghosted π
LDQ(INTEGER) β the leading dimension of the arrayQ. Rules areLDQ >= 1, andLDQ >= NifVECT = 'V'or'U'. respect the constraints bestie π«ΆWORK(REAL array, dimension(N)) β her little scratchpad, she works hard so you don't have to πΈINFO(INTEGER) β the vibe check at the end β¨= 0: successful exit, we ate π< 0: ifINFO = -i, the i-th argument had an illegal value. not me getting caught lacking π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Further Details
Modified by Linda Kaufman, Bell Labs.
Definition at line 161 of file ssbtrd.f.
π subroutine zhbtrd
The complex Hermitian sibling!! same gig, different dtype, she's literally iconic π
subroutine zhbtrd (character vect, character uplo, integer n, integer kd,
complex*16, dimension( ldab, * ) ab, integer ldab, double precision,
dimension( * ) d, double precision, dimension( * ) e, complex*16,
dimension( ldq, * ) q, integer ldq, complex*16, dimension( * ) work,
integer info)
ZHBTRD β yes that's her name, no we're not shortening it π
β Purpose
ZHBTRDreduces a complex Hermitian band matrixAto real symmetric tridiagonal formTby a unitary similarity transformation:Q**H * A * Q = T.
so like. she takes your big messy Hermitian band matrix and turns it into a cute tidy tridiagonal one. a glow-up, honestly π¦β¨
π Parameters
VECT(CHARACTER*1) β what do you want her to do withQ, bestie? decide now π«Ά= 'N': do not formQ;= 'V': formQ;= 'U': update a matrixX, by formingX*Q.
UPLO(CHARACTER*1) β which triangle ofAare we even storing?= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
N(INTEGER) β the order of the matrixA. and she's serious aboutN >= 0πKD(INTEGER) β the number of superdiagonals of the matrixAifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'. and again:KD >= 0. no cap βAB(COMPLEX*16 array, dimension(LDAB,N)) β this is the big one, pay attention π
On entry, the upper or lower triangle of the Hermitian band matrix A, stored in the first KD+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:
- if
UPLO = 'U',AB(kd+1+i-j,j) = A(i,j)formax(1,j-kd)<=i<=j; - if
UPLO = 'L',AB(1+i-j,j) = A(i,j)forj<=i<=min(n,j+kd).
On exit? Oh she replaces things, be warned π the diagonal elements of AB are overwritten by the diagonal elements of the tridiagonal matrix T; if KD > 0, the elements on the first superdiagonal (if UPLO = 'U') or the first subdiagonal (if UPLO = 'L') are overwritten by the off-diagonal elements of T; and the rest of AB is overwritten by values generated during the reduction. so like. your input is gone, she's moved on, that's the deal π
LDAB(INTEGER) β the leading dimension of the arrayAB. constraint check:LDAB >= KD+1. don't test her πΈD(DOUBLE PRECISION array, dimension(N)) β the diagonal elements of the tridiagonal matrixT. the main characters, fr fr πE(DOUBLE PRECISION array, dimension(N-1)) β the off-diagonal elements of the tridiagonal matrixT:E(i) = T(i,i+1)ifUPLO = 'U';E(i) = T(i+1,i)ifUPLO = 'L'. she's the supporting cast but she carries the plot πQ(COMPLEX*16 array, dimension(LDQ,N)) β okay so on entry, ifVECT = 'U', thenQmust contain an N-by-N matrixX; ifVECT = 'N'or'V', thenQneed not be set (she's resting, do not disturb π΄).
On exit:
- if
VECT = 'V',Qcontains the N-by-N unitary matrixQβ note: unitary, not orthogonal, we're in complex land now bestie π - if
VECT = 'U',Qcontains the productX*Q; - if
VECT = 'N', the arrayQis not referenced. not a single glance. π
LDQ(INTEGER) β the leading dimension of the arrayQ. the rules:LDQ >= 1, andLDQ >= NifVECT = 'V'or'U'. respect it or she throwsINFOat you πWORK(COMPLEX*16 array, dimension(N)) β her little workspace. complex this time. she's doing complex math, give her the space π§INFO(INTEGER) β the final verdict β¨= 0: successful exit, slay, periodt π< 0: ifINFO = -i, the i-th argument had an illegal value. you got called out, respectfully π₯
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Further Details
Modified by Linda Kaufman, Bell Labs.
Definition at line 161 of file zhbtrd.f.
π Author (the meta one)
Generated automatically by Doxygen for LAPACK from the source code.
okay bestie that's the whole page π
both ssbtrd and zhbtrd, fully documented, no details left behind, we love a complete reference π«Ά this absolute icon of a page is from LAPACK, Version 3.12.0 (page hbtrd(3)), and it was lovingly auto-generated by Doxygen from the source code β so if you ever need to cite your source, that's the one. go forth and reduce your band matrices, you've got this πππ¦
π¦ 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