upmtr(3)
π upmtr(3) β {up,op}mtr: multiply by Q from hptrd π¦
okay bestie, so this is upmtr from the Library Functions Manual, and it's literally the family of routines that take the Q you got out of hptrd and smack it onto a matrix C. like, C gets overwritten. gone. replaced. slay π
it's giving "four subroutines, one job" energy: cupmtr, dopmtr, sopmtr, zupmtr β one per precision/flavor. let's get into it β¨
β¨ SYNOPSIS β¨
πΈ Functions
subroutine cupmtr (side, uplo, trans, m, n, ap, tau, c, ldc, work, info)β CUPMTRsubroutine dopmtr (side, uplo, trans, m, n, ap, tau, c, ldc, work, info)β DOPMTRsubroutine sopmtr (side, uplo, trans, m, n, ap, tau, c, ldc, work, info)β SOPMTRsubroutine zupmtr (side, uplo, trans, m, n, ap, tau, c, ldc, work, info)β ZUPMTR
like clockwork, the same eleven args every single time π«Ά
π Detailed Description π
ok so this is the Function Documentation section, and honestly it's just the four routines below going "hi bestie, here's my whole personality." main character energy, each of them π
π subroutine cupmtr (character side, character uplo, character trans, integer m, integer n, complex, dimension( * ) ap, complex, dimension( * ) tau, complex, dimension( ldc, * ) c, integer ldc, complex, dimension( * ) work, integer info)
CUPMTR β¨
π Purpose:
!>
!> CUPMTR overwrites the general complex M-by-N matrix C with
!>
!> SIDE = 'L' SIDE = 'R'
!> TRANS = 'N': Q * C C * Q
!> TRANS = 'C': Q**H * C C * Q**H
!>
!> where Q is a complex unitary matrix of order nq, with nq = m if
!> SIDE = 'L' and nq = n if SIDE = 'R'. Q is defined as the product of
!> nq-1 elementary reflectors, as returned by CHPTRD using packed
!> storage:
!>
!> if UPLO = 'U', Q = H(nq-1) . . . H(2) H(1);
!>
!> if UPLO = 'L', Q = H(1) H(2) . . . H(nq-1).
!>
so real talk: Q is this complex unitary matrix of order nq, where nq = m if SIDE = 'L' and nq = n if SIDE = 'R'. and Q is built from nq-1 elementary reflectors that CHPTRD handed you, in packed storage. π the ordering flips depending on UPLO, so watch out:
UPLO = 'U'βQ = H(nq-1) . . . H(2) H(1)UPLO = 'L'βQ = H(1) H(2) . . . H(nq-1)
π§ Parameters
SIDEβSIDE is CHARACTER*1= 'L': applyQorQ**Hfrom the Left;= 'R': applyQorQ**Hfrom the Right.
UPLOβUPLO is CHARACTER*1= 'U': Upper triangular packed storage used in previous call toCHPTRD;= 'L': Lower triangular packed storage used in previous call toCHPTRD.
TRANSβTRANS is CHARACTER*1= 'N': No transpose, applyQ;= 'C': Conjugate transpose, applyQ**H.
MβM is INTEGER. The number of rows of the matrixC.M >= 0.NβN is INTEGER. The number of columns of the matrixC.N >= 0.APβAP is COMPLEX array, dimension
(M*(M+1)/2) if SIDE = 'L'
(N*(N+1)/2) if SIDE = 'R'
The vectors which define the elementary reflectors, as returned by CHPTRD. β οΈ AP is modified by the routine but restored on exit β so it takes a little field trip and comes right back, no cap.
TAUβTAU is COMPLEX array, dimension(M-1) if SIDE = 'L'or(N-1) if SIDE = 'R'.TAU(i)must contain the scalar factor of the elementary reflectorH(i), as returned byCHPTRD.CβC is COMPLEX array, dimension (LDC,N). On entry, theM-by-NmatrixC. On exit,C is overwritten by Q*C or Q**H*C or C*Q**H or C*Qπ (yes, it's gone, that's the whole point).LDCβLDC is INTEGER. The leading dimension of the arrayC.LDC >= max(1,M).WORKβWORK is COMPLEX array, dimension
(N) if SIDE = 'L'
(M) if SIDE = 'R'
INFOβINFO is 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.
Definition at line 148 of file cupmtr.f.
πΈ subroutine dopmtr (character side, character uplo, character trans, integer m, integer n, double precision, dimension( * ) ap, double precision, dimension( * ) tau, double precision, dimension( ldc, * ) c, integer ldc, double precision, dimension( * ) work, integer info)
DOPMTR β¨
π Purpose:
!>
!> DOPMTR overwrites the general real M-by-N matrix C with
!>
!> SIDE = 'L' SIDE = 'R'
!> TRANS = 'N': Q * C C * Q
!> TRANS = 'T': Q**T * C C * Q**T
!>
!> where Q is a real orthogonal matrix of order nq, with nq = m if
!> SIDE = 'L' and nq = n if SIDE = 'R'. Q is defined as the product of
!> nq-1 elementary reflectors, as returned by DSPTRD using packed
!> storage:
!>
!> if UPLO = 'U', Q = H(nq-1) . . . H(2) H(1);
!>
!> if UPLO = 'L', Q = H(1) H(2) . . . H(nq-1).
!>
same vibe, but real this time β Q is a real orthogonal matrix of order nq, nq = m when SIDE = 'L' and nq = n when SIDE = 'R'. it's the product of nq-1 elementary reflectors from DSPTRD, packed storage, and the order flips like:
UPLO = 'U'βQ = H(nq-1) . . . H(2) H(1)UPLO = 'L'βQ = H(1) H(2) . . . H(nq-1)
π§ Parameters
SIDEβSIDE is CHARACTER*1= 'L': applyQorQ**Tfrom the Left;= 'R': applyQorQ**Tfrom the Right.
UPLOβUPLO is CHARACTER*1= 'U': Upper triangular packed storage used in previous call toDSPTRD;= 'L': Lower triangular packed storage used in previous call toDSPTRD.
TRANSβTRANS is CHARACTER*1= 'N': No transpose, applyQ;= 'T': Transpose, applyQ**T.
MβM is INTEGER. The number of rows of the matrixC.M >= 0.NβN is INTEGER. The number of columns of the matrixC.N >= 0.APβAP is DOUBLE PRECISION array, dimension
(M*(M+1)/2) if SIDE = 'L'
(N*(N+1)/2) if SIDE = 'R'
The vectors which define the elementary reflectors, as returned by DSPTRD. β οΈ AP is modified by the routine but restored on exit.
TAUβTAU is DOUBLE PRECISION array, dimension(M-1) if SIDE = 'L'or(N-1) if SIDE = 'R'.TAU(i)must contain the scalar factor of the elementary reflectorH(i), as returned byDSPTRD.CβC is DOUBLE PRECISION array, dimension (LDC,N). On entry, theM-by-NmatrixC. On exit,C is overwritten by Q*C or Q**T*C or C*Q**T or C*QπLDCβLDC is INTEGER. The leading dimension of the arrayC.LDC >= max(1,M).WORKβWORK is DOUBLE PRECISION array, dimension
(N) if SIDE = 'L'
(M) if SIDE = 'R'
INFOβINFO is 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.
Definition at line 148 of file dopmtr.f.
π subroutine sopmtr (character side, character uplo, character trans, integer m, integer n, real, dimension( * ) ap, real, dimension( * ) tau, real, dimension( ldc, * ) c, integer ldc, real, dimension( * ) work, integer info)
SOPMTR β¨
π Purpose:
!>
!> SOPMTR overwrites the general real M-by-N matrix C with
!>
!> SIDE = 'L' SIDE = 'R'
!> TRANS = 'N': Q * C C * Q
!> TRANS = 'T': Q**T * C C * Q**T
!>
!> where Q is a real orthogonal matrix of order nq, with nq = m if
!> SIDE = 'L' and nq = n if SIDE = 'R'. Q is defined as the product of
!> nq-1 elementary reflectors, as returned by SSPTRD using packed
!> storage:
!>
!> if UPLO = 'U', Q = H(nq-1) . . . H(2) H(1);
!>
!> if UPLO = 'L', Q = H(1) H(2) . . . H(nq-1).
!>
the single-precision real sibling, and it's literally the same storyline: real orthogonal Q, order nq = m for SIDE = 'L' / nq = n for SIDE = 'R', product of nq-1 elementary reflectors from SSPTRD, packed storage:
UPLO = 'U'βQ = H(nq-1) . . . H(2) H(1)UPLO = 'L'βQ = H(1) H(2) . . . H(nq-1)
π§ Parameters
SIDEβSIDE is CHARACTER*1= 'L': applyQorQ**Tfrom the Left;= 'R': applyQorQ**Tfrom the Right.
UPLOβUPLO is CHARACTER*1= 'U': Upper triangular packed storage used in previous call toSSPTRD;= 'L': Lower triangular packed storage used in previous call toSSPTRD.
TRANSβTRANS is CHARACTER*1= 'N': No transpose, applyQ;= 'T': Transpose, applyQ**T.
MβM is INTEGER. The number of rows of the matrixC.M >= 0.NβN is INTEGER. The number of columns of the matrixC.N >= 0.APβAP is REAL array, dimension
(M*(M+1)/2) if SIDE = 'L'
(N*(N+1)/2) if SIDE = 'R'
The vectors which define the elementary reflectors, as returned by SSPTRD. β οΈ AP is modified by the routine but restored on exit.
TAUβTAU is REAL array, dimension(M-1) if SIDE = 'L'or(N-1) if SIDE = 'R'.TAU(i)must contain the scalar factor of the elementary reflectorH(i), as returned bySSPTRD.CβC is REAL array, dimension (LDC,N). On entry, theM-by-NmatrixC. On exit,C is overwritten by Q*C or Q**T*C or C*Q**T or C*QπLDCβLDC is INTEGER. The leading dimension of the arrayC.LDC >= max(1,M).WORKβWORK is REAL array, dimension
(N) if SIDE = 'L'
(M) if SIDE = 'R'
INFOβINFO is 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.
Definition at line 148 of file sopmtr.f.
ok bestie that's where part 1 wraps the routine docs β but hold up, we are not done π«Ά there's more coming, so don't go anywhere π
subroutine zupmtr (character side, character uplo, character trans, integer
m, integer n, complex*16, dimension( * ) ap, complex*16, dimension( * )
tau, complex*16, dimension( ldc, * ) c, integer ldc, complex*16,
dimension( * ) work, integer info)
ZUPMTR
β¨ Purpose β¨
Bestie. Okay so here's the whole vibe of ZUPMTR: it overwrites the general complex M-by-N matrix C with one of these four looks π
SIDE = 'L' SIDE = 'R'
TRANS = 'N': Q * C C * Q
TRANS = 'C': Q**H * C C * Q**H
where Q is a complex unitary matrix of order nq, with nq = m if SIDE = 'L' and nq = n if SIDE = 'R'. And Q is defined as the product of nq-1 elementary reflectors, exactly as returned by ZHPTRD using packed storage:
if UPLO = 'U', Q = H(nq-1) . . . H(2) H(1);
if UPLO = 'L', Q = H(1) H(2) . . . H(nq-1).
It's giving "I'm just the reflector messenger" π
β you bring the reflectors, ZUPMTR does the multiplying. Slay.
π Parameters π
Get comfy, we're going through every single one, no skips, no cap π«Ά
SIDE
SIDE is CHARACTER*1 and it's literally just telling us which side to hit from:
= 'L'β applyQorQ**Hfrom the Left;= 'R'β applyQorQ**Hfrom the Right.
Pick a side, bestie. Left or right. Main character decision π₯
UPLO
UPLO is CHARACTER*1 and it's here to remind us how the packed storage was laid out in the previous call to ZHPTRD:
= 'U'β Upper triangular packed storage used in previous call toZHPTRD;= 'L'β Lower triangular packed storage used in previous call toZHPTRD.
It has to match what you did before, iykyk β this is a callback, not a reboot π
TRANS
TRANS is CHARACTER*1, the transpose vibe check:
= 'N'β No transpose, applyQ;= 'C'β Conjugate transpose, applyQ**H.
Two options, both iconic, choose wisely β¨
M
M is INTEGER β the number of rows of the matrix C, and M >= 0. Not optional, the math said so π§
N
N is INTEGER β the number of columns of the matrix C, and N >= 0. Same energy, same rules πΈ
AP
AP is COMPLEX*16 array, with dimension:
(M*(M+1)/2) if SIDE = 'L'
(N*(N+1)/2) if SIDE = 'R'
These are the vectors which define the elementary reflectors, as returned by ZHPTRD. And important little detail: AP is modified by the routine but restored on exit β so she borrows your data, plays with it, puts it back exactly how she found it. Respectful queen behavior ππ
TAU
TAU is COMPLEX*16 array, dimension (M-1) if SIDE = 'L' or (N-1) if SIDE = 'R'.
TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by ZHPTRD. So like, every reflector has its little scalar bestie and they have to match up π
C
C is COMPLEX*16 array, dimension (LDC,N):
- On entry, the M-by-N matrix
C. - On exit,
Cis overwritten byQ*CorQ**H*CorC*Q**HorC*Q.
Whichever of the four it is depends on SIDE and TRANS, obvi. Your original C? Gone. Transformed. Glow-up complete π¦
LDC
LDC is INTEGER β the leading dimension of the array C, and it must satisfy LDC >= max(1,M). Rules are rules, bestie π
WORK
WORK is COMPLEX*16 array, dimension:
(N) if SIDE = 'L'
(M) if SIDE = 'R'
Scratch space. Give her room to work π«Ά
INFO
INFO is INTEGER, the final report card:
= 0β successful exit, we love a clean run β¨< 0β ifINFO = -i, thei-th argument had an illegal value. So like, ifINFO = -3, go look at the third argument and apologize to it π
π Author π
The absolute legends who brought you this:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 148 of file zupmtr.f. π―
β Author β
Generated automatically by Doxygen for LAPACK from the source code. Not me, not you, the robot did it π€π
Okay that's the whole page, bestie!! Go forth and multiply your matrices π
π₯ This was LAPACK Version 3.12.0, upmtr(3), and the whole thing is stamped with the source/version and date vibes from the footer β consider it your cute little sign-off: version three-point-twelve-point-oh, 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