SRC/stpmqrt.f(3)
β¨ SRC/stpmqrt.f β¨
okay so bestie, buckle up β this is a page from the LAPACK manual (that's the Library Functions Manual, mwah), and it's all about one little subroutine that is genuinely iconic. no cap, it does a lot of math and we're gonna get through it together π«Ά
πΈ SYNOPSIS πΈ
π Functions/Subroutines
subroutine stpmqrt (side, trans, m, n, k, l, nb, v, ldv, t, ldt, a, lda,
b, ldb, work, info)
STPMQRT β that's the main character right there π
π Function/Subroutine Documentation π
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 β¨ (yes the full signature again, she's that important)
π¦ Purpose π¦
so what does she actually do? literally this:
STPMQRTapplies a real orthogonal matrixQobtained from a real block reflectorHto a general real matrixC, which consists of two blocksAandB.
it's giving "quietly carrying the whole factorization" energy, honestly π
π Parameters π
one by one, bestie, we're not skipping a single one:
SIDEβSIDEisCHARACTER*1, and it picks a whole side:= 'L': applyQorQ^Tfrom the Left;= 'R': applyQorQ^Tfrom the Right.
TRANSβTRANSisCHARACTER*1, the transpose vibe check:= 'N': No transpose, applyQ;= 'T': Transpose, applyQ^T.
MβMisINTEGER. the number of rows of the matrixB. constraint:M >= 0.NβNisINTEGER. the number of columns of the matrixB. constraint:N >= 0.KβKisINTEGER. the number of elementary reflectors whose product defines the matrixQ.LβLisINTEGER. the order of the trapezoidal part ofV. constraint:K >= L >= 0. π See Further Details.NBβNBisINTEGER. the block size used for the storage ofT. constraint:K >= NB >= 1. β οΈ this must be the same value ofNBused to generateTinCTPQRTβ like, they have to match, no improvising.VβVisREALarray, dimension(LDV,K). the i-th column must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned byCTPQRTinB. π See Further Details.LDVβLDVisINTEGER. the leading dimension of the arrayV.- If
SIDE = 'L',LDV >= max(1,M); - if
SIDE = 'R',LDV >= max(1,N).
- If
TβTisREALarray, dimension(LDT,K). the upper triangular factors of the block reflectors as returned byCTPQRT, stored as aNB-by-Kmatrix.LDTβLDTisINTEGER. the leading dimension of the arrayT. constraint:LDT >= NB.AβAisREALarray, 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.
LDAβLDAisINTEGER. the leading dimension of the arrayA.- If
SIDE = 'L',LDC >= max(1,K); - If
SIDE = 'R',LDC >= max(1,M).
- If
(yep, that's LDC sitting right there in the LDA description β copying it exactly as the page says it, don't come for me π)
BβBisREALarray, 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βLDBisINTEGER. the leading dimension of the arrayB. constraint:LDB >= max(1,M).WORKβWORKisREALarray. the dimension ofWORKisN*NBifSIDE = 'L', orM*NBifSIDE = 'R'. don't forget to size her right π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 π§
okay this is the part where it gets good, so pay attention:
The columns of the pentagonal matrixVcontain the elementary reflectorsH(1),H(2), ...,H(K);Vis composed of a rectangular blockV1and a trapezoidal blockV2:
V = [V1]
[V2].
The size of the trapezoidal blockV2is determined by the parameterL, where0 <= L <= K;V2is upper trapezoidal, consisting of the firstLrows of aK-by-Kupper triangular matrix. IfL=K,V2is upper triangular; ifL=0, there is no trapezoidal block, henceV = V1is rectangular.
then the layout, depending on which side you're on:
IfSIDE = 'L':C = [A]whereAisK-by-N,BisM-by-NandVisM-by-K.[B]IfSIDE = 'R':C = [A B]whereAisM-by-K,BisM-by-NandVisN-by-K.
and the exact block forms, mark them:
V = [V1]
[V2].
IfSIDE = 'L': C = [A] where A is K-by-N, B is M-by-N and V is M-by-K. [B] IfSIDE = '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' and SIDE='L', C is on exit replaced with Q * C. If TRANS='T' and SIDE='L', C is on exit replaced with Q^T * C. If TRANS='N' and SIDE='R', C is on exit replaced with C * Q. If TRANS='T' and SIDE='R', C is on exit replaced with C * Q^T.
so basically: match your SIDE, match your TRANS, and C comes out the other side transformed. slay π
β Definition β
Definition at line 214 of file stpmqrt.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code. (she wrote herself, honestly iconic π)
and that's the whole page, bestie β no details left behind, fr fr π this was LAPACK Version 3.12.0, page SRC/stpmqrt.f(3), and it ate. 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