tpmqrt(3)
okay bestie, you've found tpmqrt(3) from the Library Functions Manual β the apply-Q page, and it's lowkey iconic. π
β¨
π NAME π
tpmqrt β tpmqrt: applies Q. That's the whole name, no cap. π«Ά
β¨ SYNOPSIS β¨
πΈ Functions πΈ
Here are the four flavors, bestie β every signature exactly as the page gives it:
subroutine ctpmqrt (side, trans, m, n, k, l, nb, v, ldv, t, ldt, a, lda, b, ldb, work, info)
CTPMQRT
subroutine dtpmqrt (side, trans, m, n, k, l, nb, v, ldv, t, ldt, a, lda, b, ldb, work, info)
DTPMQRT
subroutine stpmqrt (side, trans, m, n, k, l, nb, v, ldv, t, ldt, a, lda, b, ldb, work, info)
STPMQRT
subroutine ztpmqrt (side, trans, m, n, k, l, nb, v, ldv, t, ldt, a, lda, b, ldb, work, info)
ZTPMQRT
π Detailed Description π
okay so this is the big-picture vibe: tpmqrt is the apply-Q function family. The full function documentation is right below, and each function has its own Purpose, Parameters, Author and Further Details sections. π¦
π Function Documentation π
scroll for the actual functions, bestie β first up is ctpmqrt. π
subroutine ctpmqrt β CTPMQRT π
subroutine ctpmqrt (character side, character trans, integer m, integer n, integer k, integer l, integer nb, complex, dimension( ldv, * ) v, integer ldv, complex, dimension( ldt, * ) t, integer ldt, complex, dimension( lda, * ) a, integer lda, complex, dimension( ldb, * ) b, integer ldb, complex, dimension( * ) work, integer info)
CTPMQRT
π Purpose π
okay so CTPMQRT takes a complex orthogonal matrix Q β built from a complex block reflector H β and applies it to a general complex matrix C, which is split into two blocks, A and B. Slay. π
π Parameters π
SIDEβSIDE is CHARACTER*1;= 'L': applyQorQ**Hfrom the Left;= 'R': applyQorQ**Hfrom the Right. π«ΆTRANSβTRANS is CHARACTER*1;= 'N': No transpose, applyQ;= 'C': Conjugate transpose, applyQ**H.MβM is INTEGER; the number of rows of the matrixB.M >= 0.NβN is INTEGER; the number of columns of the matrixB.N >= 0.KβK is INTEGER; the number of elementary reflectors whose product defines the matrixQ.LβL is INTEGER; the order of the trapezoidal part ofV.K >= L >= 0. See Further Details.NBβNB is INTEGER; the block size used for the storage ofT.K >= NB >= 1. This must be the same value ofNBused to generateTinCTPQRT.VβV is COMPLEX array, dimension (LDV,K); thei-th column must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned byCTPQRTinB. See Further Details.LDVβLDV is INTEGER; the leading dimension of the arrayV. IfSIDE = 'L',LDV >= max(1,M); ifSIDE = 'R',LDV >= max(1,N).TβT is COMPLEX array, dimension (LDT,K); the upper triangular factors of the block reflectors as returned byCTPQRT, stored as aNB-by-Kmatrix.LDTβLDT is INTEGER; the leading dimension of the arrayT.LDT >= NB.AβA is COMPLEX array, dimension (LDA,N) if SIDE = 'L' or (LDA,K) if SIDE = 'R'; on entry, theK-by-NorM-by-KmatrixA. On exit,Ais overwritten by the corresponding block ofQ*CorQ**H*CorC*QorC*Q**H. See Further Details.LDAβLDA is INTEGER; the leading dimension of the arrayA. IfSIDE = 'L',LDC >= max(1,K); IfSIDE = 'R',LDC >= max(1,M). yep, it saysLDCβ I'm just the messenger, bestie πBβB is COMPLEX array, dimension (LDB,N); on entry, theM-by-NmatrixB. On exit,Bis overwritten by the corresponding block ofQ*CorQ**H*CorC*QorC*Q**H. See Further Details.LDBβLDB is INTEGER; the leading dimension of the arrayB.LDB >= max(1,M).WORKβWORK is COMPLEX array; the dimension ofWORKisN*NBifSIDE = 'L', orM*NBifSIDE = '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.
π¦ Further Details π¦
okay so the columns of the pentagonal matrix V contain the elementary reflectors H(1), H(2), ..., H(K); V is made of a rectangular block V1 and a trapezoidal block V2:
V = [V1]
[V2].
the size of the trapezoidal block V2 is set by parameter L, where 0 <= L <= K; V2 is upper trapezoidal, made of the first L rows of a K-by-K upper triangular matrix. If L=K, V2 is upper triangular; if L=0, there is no trapezoidal block, so V = V1 is rectangular. π«Ά
If SIDE = 'L': C = [A] where A is K-by-N, B is M-by-N and V is M-by-K.
[B]
If SIDE = 'R': C = [A B] where A is M-by-K, B is M-by-N and V is N-by-K.
the complex orthogonal matrix Q is formed from V and T.
If TRANS='N' and SIDE='L', C is on exit replaced with Q * C.
If TRANS='C' and SIDE='L', C is on exit replaced with Q**H * C.
If TRANS='N' and SIDE='R', C is on exit replaced with C * Q.
If TRANS='C' and SIDE='R', C is on exit replaced with C * Q**H.
Definition at line 214 of file ctpmqrt.f.
subroutine dtpmqrt β DTPMQRT π
subroutine dtpmqrt (character side, character trans, integer m, integer n, integer k, integer l, integer nb, double precision, dimension( ldv, * ) v, integer ldv, double precision, dimension( ldt, * ) t, integer ldt, double precision, dimension( lda, * ) a, integer lda, double precision, dimension( ldb, * ) b, integer ldb, double precision, dimension( * ) work, integer info)
DTPMQRT
πΈ Purpose πΈ
okay so DTPMQRT applies a real orthogonal matrix Q β built from a real block reflector H β to a general real matrix C, which consists of two blocks, A and B. π
π§ Parameters π§
SIDEβSIDE is CHARACTER*1;= 'L': applyQorQ**Tfrom the Left;= 'R': applyQorQ**Tfrom the Right. π«ΆTRANSβTRANS is CHARACTER*1;= 'N': No transpose, applyQ;= 'T': Transpose, applyQ**T.MβM is INTEGER; the number of rows of the matrixB.M >= 0.NβN is INTEGER; the number of columns of the matrixB.N >= 0.KβK is INTEGER; the number of elementary reflectors whose product defines the matrixQ.LβL is INTEGER; the order of the trapezoidal part ofV.K >= L >= 0. See Further Details.NBβNB is INTEGER; the block size used for the storage ofT.K >= NB >= 1. This must be the same value ofNBused to generateTinCTPQRT.VβV is DOUBLE PRECISION array, dimension (LDV,K); thei-th column must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned byCTPQRTinB. See Further Details.LDVβLDV is INTEGER; the leading dimension of the arrayV. IfSIDE = 'L',LDV >= max(1,M); ifSIDE = 'R',LDV >= max(1,N).TβT is DOUBLE PRECISION array, dimension (LDT,K); the upper triangular factors of the block reflectors as returned byCTPQRT, stored as aNB-by-Kmatrix.LDTβLDT is INTEGER; the leading dimension of the arrayT.LDT >= NB.AβA is DOUBLE PRECISION array, dimension (LDA,N) if SIDE = 'L' or (LDA,K) if SIDE = 'R'; on entry, theK-by-NorM-by-KmatrixA. On exit,Ais overwritten by the corresponding block ofQ*CorQ**T*CorC*QorC*Q**T. See Further Details.LDAβLDA is INTEGER; the leading dimension of the arrayA. IfSIDE = 'L',LDC >= max(1,K); IfSIDE = 'R',LDC >= max(1,M). again,LDCis what the page says β not me fixing it, bestie πBβB is DOUBLE PRECISION array, dimension (LDB,N); on entry, theM-by-NmatrixB. On exit,Bis overwritten by the corresponding block ofQ*CorQ**T*CorC*QorC*Q**T. See Further Details.LDBβLDB is INTEGER; the leading dimension of the arrayB.LDB >= max(1,M).WORKβWORK is DOUBLE PRECISION array; the dimension ofWORKisN*NBifSIDE = 'L', orM*NBifSIDE = '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.
π Further Details π
(the full dtpmqrt further-details tea continues in part 2, bestie β stay tuned π«Ά)
The trapezoidal block V2 is sized by the parameter L, where 0 <= L <= K; V2 is upper trapezoidal, made of the first L rows of a K-by-K upper triangular matrix. If L=K, V2 is upper triangular; if L=0, there's no trapezoidal block at all, so V = V1 is just rectangular. π
If SIDE = 'L':
C = [A] where A is K-by-N, B is M-by-N and V is M-by-K.
[B]
If SIDE = 'R':
C = [A B] where A is M-by-K, B is M-by-N and V is N-by-K.
The real orthogonal matrix Q is formed from V and T. β¨
- If
TRANS='N'andSIDE='L', C is on exit replaced with Q * C. - If
TRANS='T'andSIDE='L', C is on exit replaced with Q**T * C. - If
TRANS='N'andSIDE='R', C is on exit replaced with C * Q. - If
TRANS='T'andSIDE='R', C is on exit replaced with C * Q**T.
Definition at line 214 of file dtpmqrt.f.
π¦ subroutine stpmqrt
subroutine stpmqrt (character side, character trans, integer m, integer n,
integer k, integer l, integer nb, real, dimension( ldv, * ) v, integer
ldv, real, dimension( ldt, * ) t, integer ldt, real, dimension( lda, * )
a, integer lda, real, dimension( ldb, * ) b, integer ldb, real,
dimension( * ) work, integer info)
STPMQRT π
π Purpose
Okay so STPMQRT applies a real orthogonal matrix Q β the one you got from a real block reflector H β to a general real matrix C, and C is literally two blocks glued together, A and B. Bestie, it's giving "assembly required" but make it linear algebra. π
β¨
πΈ Parameters
SIDEβSIDEisCHARACTER*1= 'L': apply Q or Q^T from the Left;= 'R': apply Q or Q^T from the Right.
TRANSβTRANSisCHARACTER*1= 'N': No transpose, apply Q;= 'T': Transpose, apply Q^T.
MβMisINTEGER. The number of rows of the matrix B.M >= 0.NβNisINTEGER. The number of columns of the matrix B.N >= 0.KβKisINTEGER. The number of elementary reflectors whose product defines the matrix Q.LβLisINTEGER. The order of the trapezoidal part of V.K >= L >= 0. See Further Details. πNBβNBisINTEGER. The block size used for the storage of T.K >= NB >= 1. This must be the same value of NB used to generate T inCTPQRT. π¨ like genuinely, same value, no cap, don't freestyle it.VβVisREAL array, dimension (LDV,K). The i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,...,k, as returned byCTPQRTin B. See Further Details.LDVβLDVisINTEGER. The leading dimension of the array V.- If
SIDE = 'L',LDV >= max(1,M); - if
SIDE = 'R',LDV >= max(1,N).
- If
TβTisREAL array, dimension (LDT,K). The upper triangular factors of the block reflectors as returned byCTPQRT, stored as a NB-by-K matrix.LDTβLDTisINTEGER. The leading dimension of the array T.LDT >= NB.AβAisREAL array, dimension(LDA,N)ifSIDE = 'L'or(LDA,K)ifSIDE = 'R'
On entry, the K-by-N or M-by-K matrix A. On exit, A is overwritten by the corresponding block of Q*C or Q^T*C or C*Q or C*Q^T. See Further Details. π«Ά (yes it gets eaten, that's the whole point)
LDAβLDAisINTEGER. The leading dimension of the array A.- If
SIDE = 'L',LDC >= max(1,K); - If
SIDE = 'R',LDC >= max(1,M).
- If
tiny heads-up bestie: the source text literally writesLDCin theLDAdescription β that's A's leading dimension, not C's. We're keeping it exactly as shipped, iykyk. π
BβBisREAL array, dimension (LDB,N). On entry, the M-by-N matrix B. On exit, B is overwritten by the corresponding block ofQ*CorQ^T*CorC*QorC*Q^T. See Further Details.LDBβLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,M).WORKβWORKisREAL array. The dimension of WORK isN*NBifSIDE = 'L', orM*NBifSIDE = 'R'. π§ scrub that workspace bestieINFOβINFOisINTEGER= 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 columns of the pentagonal matrix V contain the elementary reflectors H(1), H(2), ..., H(K); V is composed of a rectangular block V1 and a trapezoidal block V2:
V = [V1]
[V2].
The size of the trapezoidal block V2 is determined by the parameter L, where 0 <= L <= K; V2 is upper trapezoidal, consisting of the first L rows of a K-by-K upper triangular matrix. If L=K, V2 is upper triangular; if L=0, there is no trapezoidal block, hence V = V1 is rectangular. π
If SIDE = 'L':
C = [A] where A is K-by-N, B is M-by-N and V is M-by-K.
[B]
If SIDE = 'R':
C = [A B] where A is M-by-K, B is M-by-N and V is N-by-K.
The real orthogonal matrix Q is formed from V and T. β¨
- If
TRANS='N'andSIDE='L', C is on exit replaced with Q * C. - If
TRANS='T'andSIDE='L', C is on exit replaced with Q^T * C. - If
TRANS='N'andSIDE='R', C is on exit replaced with C * Q. - If
TRANS='T'andSIDE='R', C is on exit replaced with C * Q^T.
Definition at line 214 of file stpmqrt.f.
π subroutine ztpmqrt
subroutine ztpmqrt (character side, character trans, integer m, integer n,
integer k, integer l, integer nb, complex*16, dimension( ldv, * ) v,
integer ldv, complex*16, dimension( ldt, * ) t, integer ldt, complex*16,
dimension( lda, * ) a, integer lda, complex*16, dimension( ldb, * ) b,
integer ldb, complex*16, dimension( * ) work, integer info)
ZTPMQRT π the complex queen of the family, main character energy fr fr π
π Purpose
ZTPMQRT applies a complex orthogonal matrix Q β obtained from a complex block reflector H β to a general complex matrix C, which consists of two blocks A and B. Same vibe as the real one, just with more letters and more β¨imaginationβ¨.
πΈ Parameters
SIDEβSIDEisCHARACTER*1= 'L': apply Q or Q**H from the Left;= 'R': apply Q or Q**H from the Right.
TRANSβTRANSisCHARACTER*1= 'N': No transpose, apply Q;= 'C': Conjugate transpose, apply Q**H.
not me pointing out that the complex version uses'C'for conjugate transpose while the real one uses'T'β different letters, bestie, don't mix them up π
MβMisINTEGER. The number of rows of the matrix B.M >= 0.NβNisINTEGER. The number of columns of the matrix B.N >= 0.KβKisINTEGER. The number of elementary reflectors whose product defines the matrix Q.LβLisINTEGER. The order of the trapezoidal part of V.K >= L >= 0. See Further Details.NBβNBisINTEGER. The block size used for the storage of T.K >= NB >= 1. This must be the same value of NB used to generate T inCTPQRT. π¨ same NB. always. no exceptions.VβVisCOMPLEX*16 array, dimension (LDV,K). The i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,...,k, as returned byCTPQRTin B. See Further Details.LDVβLDVisINTEGER. The leading dimension of the array V.- If
SIDE = 'L',LDV >= max(1,M); - if
SIDE = 'R',LDV >= max(1,N).
- If
TβTisCOMPLEX*16 array, dimension (LDT,K). The upper triangular factors of the block reflectors as returned byCTPQRT, stored as a NB-by-K matrix.LDTβLDTisINTEGER. The leading dimension of the array T.LDT >= NB.AβAisCOMPLEX*16 array, dimension(LDA,N)ifSIDE = 'L'or(LDA,K)ifSIDE = 'R'
On entry, the K-by-N or M-by-K matrix A. On exit, A is overwritten by the corresponding block of Q*C or Q**H*C or C*Q or C*Q**H. See Further Details. π«Ά
LDAβLDAisINTEGER. The leading dimension of the array A.- If
SIDE = 'L',LDC >= max(1,K); - If
SIDE = 'R',LDC >= max(1,M).
- If
and yeah, sameLDCsituation here as in the other two β the original text saysLDCinside theLDAblock. Preserved verbatim, periodt. π
BβBisCOMPLEX*16 array, dimension (LDB,N). On entry, the M-by-N matrix B. On exit, B is overwritten by the corresponding block ofQ*CorQ**H*CorC*QorC*Q**H. See Further Details.LDBβLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,M).WORKβWORKisCOMPLEX*16 array. The dimension of WORK isN*NBifSIDE = 'L', orM*NBifSIDE = 'R'. π§INFOβINFOisINTEGER= 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 columns of the pentagonal matrix V contain the elementary reflectors H(1), H(2), ..., H(K); V is composed of a rectangular block V1 and a trapezoidal block V2:
V = [V1]
[V2].
The size of the trapezoidal block V2 is determined by the parameter L, where 0 <= L <= K; V2 is upper trapezoidal, consisting of the first L rows of a K-by-K upper triangular matrix. If L=K, V2 is upper triangular; if L=0, there is no trapezoidal block, hence V = V1 is rectangular. π
If SIDE = 'L':
C = [A] where A is K-by-N, B is M-by-N and V is M-by-K.
[B]
If SIDE = 'R':
C = [A B] where A is M-by-K, B is M-by-N and V is N-by-K.
The real orthogonal matrix Q is formed from V and T. β¨
- If
TRANS='N'andSIDE='L', C is on exit replaced with Q * C. - If
TRANS='T'andSIDE='L', C is on exit replaced with Q^T * C. - If
TRANS='N'andSIDE='R', C is on exit replaced with C * Q. - If
TRANS='T'andSIDE='R', C is on exit replaced with C * Q^T.
Definition at line 214 of file ztpmqrt.f.
...so like, the columns of the pentagonal matrix V contain the elementary reflectors H(1), H(2), ..., H(K), and V is literally composed of a rectangular block V1 and a trapezoidal block V2, okay bestie? Picture it:
V = [V1]
[V2].
The size of that trapezoidal block V2 is decided by the parameter L, where 0 <= L <= K π
. V2 is upper trapezoidal β it's the first L rows of a K-by-K upper triangular matrix, no cap. So if L=K, then V2 is upper triangular; if L=0, there's no trapezoidal block at all, which means V = V1 and it's just rectangular. That's it, that's the whole vibe check π¦.
Now here's where SIDE really matters, bestie, so pay attention fr fr:
If SIDE = 'L': C = [A] where A is K-by-N, B is M-by-N and V is M-by-K. [B]
If SIDE = 'R': C = [A B] where A is M-by-K, B is M-by-N and V is N-by-K.
The complex orthogonal matrix Q is formed from V and T β¨.
And the exits, in order, periodt:
- If
TRANS='N'andSIDE='L',Cis on exit replaced withQ * C. π - If
TRANS='C'andSIDE='L',Cis on exit replaced withQ**H * C. - If
TRANS='N'andSIDE='R',Cis on exit replaced withC * Q. - If
TRANS='C'andSIDE='R',Cis on exit replaced withC * Q**H. π₯
Lowkey important: thoseon exitreplacements are the whole point of calling this β the matrixCyou passed in does not come back the same, bestie. π
Definition at line 214 of file ztpmqrt.f.
π AUTHOR π
Generated automatically by Doxygen for LAPACK from the source code. No human authors were harmed in the making of this page π β the docs literally wrote themselves, which is iconic honestly.
And that's a wrap on part 3, bestie!! π This whole assist came to you courtesy of LAPACK, Version 3.12.0, and the tpmqrt(3) page β go forth and triangulate those blocks, iykyk ππ«Ά
π¦ 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