unmqr(3)
πΈ NAME πΈ
okay so this is unmqr(3) from the Library Functions Manual, and the whole entire point of it is: {un,or}mqr: multiply by Q from geqrf π
that's the name, that's the vibe, we love a function family that does exactly what it says on the tin.
β¨ SYNOPSIS β¨
π«Ά Functions
here are the four glow-up variants, ngl they're literally the same girl in different outfits (complex vs real, single vs double):
subroutine cunmqr (side, trans, m, n, k, a, lda, tau, c, ldc, work,
lwork, info)
CUNMQR
subroutine dormqr (side, trans, m, n, k, a, lda, tau, c, ldc, work,
lwork, info)
DORMQR
subroutine sormqr (side, trans, m, n, k, a, lda, tau, c, ldc, work,
lwork, info)
SORMQR
subroutine zunmqr (side, trans, m, n, k, a, lda, tau, c, ldc, work,
lwork, info)
ZUNMQR
π Detailed Description π
bestie there is genuinely no extra prose here in the original, it just rolls straight into the function docs. so likeβ¦ same. we go straight to the good stuff π₯
π Function Documentation π
π subroutine cunmqr π
subroutine cunmqr (character side, character trans, integer m, integer n,
integer k, complex, dimension( lda, * ) a, integer lda, complex,
dimension( * ) tau, complex, dimension( ldc, * ) c, integer ldc,
complex, dimension( * ) work, integer lwork, integer info)
CUNMQR
π Purpose π
okay so CUNMQR 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 defined as the product of k elementary reflectors:
Q = H(1) H(2) . . . H(k)
as returned by CGEQRF. and here's the little detail everyone forgets: Q is of order M if SIDE = 'L' and of order N if SIDE = 'R' π¦ periodt.
π Parameters π
SIDEβSIDEisCHARACTER*1, and it picks a whole side, iconic:= 'L':applyQorQ**Hfrom the Left;= 'R':applyQorQ**Hfrom the Right.
TRANSβTRANSisCHARACTER*1:= 'N':No transpose, applyQ;= 'C':Conjugate transpose, applyQ**H.
MβMisINTEGER, the number of rows of the matrixC. and it must satisfyM >= 0β¨NβNisINTEGER, the number of columns of the matrixC. alsoN >= 0πKβKisINTEGER, the number of elementary reflectors whose product defines the matrixQ. the rules, no cap:- If
SIDE = 'L',M >= K >= 0; - if
SIDE = 'R',N >= K >= 0.
- If
AβAisCOMPLEX array, dimension (LDA,K). the i-th column must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned byCGEQRFin the firstkcolumns of its array argumentAπ«ΆLDAβLDAisINTEGER, the leading dimension of the arrayA:- If
SIDE = 'L',LDA >= max(1,M); - if
SIDE = 'R',LDA >= max(1,N).
- If
TAUβTAUisCOMPLEX array, dimension (K).TAU(i)must contain the scalar factor of the elementary reflectorH(i), as returned byCGEQRFπΈCβCisCOMPLEX array, dimension (LDC,N). On entry, the M-by-N matrixC. On exit,Cis overwritten byQ*CorQ**H*CorC*Q**HorC*Q. she gets a whole new personality, we love a transformation arc πLDCβLDCisINTEGER, the leading dimension of the arrayC.LDC >= max(1,M).WORKβWORKisCOMPLEX array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORKπ§LWORKβLWORKisINTEGER, the dimension of the arrayWORK:- If
SIDE = 'L',LWORK >= max(1,N); - if
SIDE = 'R',LWORK >= max(1,M). - For good performance,
LWORKshould generally be larger. (fr fr, don't be stingy, she performs better with room to breathe β¨)
- If
and the special case, super important π:
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, the i-th argument had an illegal value π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 166 of file cunmqr.f.
π₯ subroutine dormqr π₯
subroutine dormqr (character side, character trans, integer m, integer n,
integer k, double precision, dimension( lda, * ) a, integer lda, double
precision, dimension( * ) tau, double precision, dimension( ldc, * ) c,
integer ldc, double precision, dimension( * ) work, integer lwork,
integer info)
DORMQR
β Purpose β
okay so DORMQR 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 defined as the product of k elementary reflectors:
Q = H(1) H(2) . . . H(k)
as returned by DGEQRF. Q is of order M if SIDE = 'L' and of order N if SIDE = 'R' π¦ and yes she's the double precision sister, same energy, bigger floats.
πΈ Parameters πΈ
SIDEβSIDEisCHARACTER*1:= 'L':applyQorQ**Tfrom the Left;= 'R':applyQorQ**Tfrom the Right.
TRANSβTRANSisCHARACTER*1:= 'N':No transpose, applyQ;= 'T':Transpose, applyQ**T.
MβMisINTEGER, the number of rows of the matrixC.M >= 0πNβNisINTEGER, the number of columns of the matrixC.N >= 0β¨KβKisINTEGER, the number of elementary reflectors whose product defines the matrixQ:- If
SIDE = 'L',M >= K >= 0; - if
SIDE = 'R',N >= K >= 0.
- If
AβAisDOUBLE PRECISION array, dimension (LDA,K). the i-th column must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned byDGEQRFin the firstkcolumns of its array argumentAπ«ΆLDAβLDAisINTEGER, the leading dimension of the arrayA:- If
SIDE = 'L',LDA >= max(1,M); - if
SIDE = 'R',LDA >= max(1,N).
- If
TAUβTAUisDOUBLE PRECISION array, dimension (K).TAU(i)must contain the scalar factor of the elementary reflectorH(i), as returned byDGEQRFπCβCisDOUBLE PRECISION array, dimension (LDC,N). On entry, the M-by-N matrixC. On exit,Cis overwritten byQ*CorQ**T*CorC*Q**TorC*Q. main character gets rewritten, iconic πLDCβLDCisINTEGER, the leading dimension of the arrayC.LDC >= max(1,M).WORKβWORKisDOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORKπ§LWORKβLWORKisINTEGER, the dimension of the arrayWORK:- If
SIDE = 'L',LWORK >= max(1,N); - if
SIDE = 'R',LWORK >= max(1,M). - For good performance,
LWORKshould generally be larger.
- If
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. (so like, she's just doing recon, no drama, noXERBLAyelling π)
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.
Definition at line 165 of file dormqr.f.
π¦ subroutine sormqr π¦
subroutine sormqr (character side, character trans, integer m, integer n,
integer k, real, dimension( lda, * ) a, integer lda, real, dimension( *
) tau, real, dimension( ldc, * ) c, integer ldc, real, dimension( * )
work, integer lwork, integer info)
SORMQR
π Purpose π
okay so SORMQR 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 defined as the product of k elementary reflectors:
Q = H(1) H(2) . . . H(k)
as returned by SGEQRF. Q is of order M if SIDE = 'L' and of order N if SIDE = 'R' β¨ yep, single precision edition, same choreography, lighter luggage.
π Parameters π
SIDEβSIDEisCHARACTER*1:= 'L':applyQorQ**Tfrom the Left;= 'R':applyQorQ**Tfrom the Right.
TRANSβTRANSisCHARACTER*1:= 'N':No transpose, applyQ;= 'T':Transpose, applyQ**T.
MβMisINTEGER, the number of rows of the matrixC.M >= 0πNβNisINTEGER, the number of columns of the matrixC.N >= 0πΈKβKisINTEGER, the number of elementary reflectors whose product defines the matrixQ:- If
SIDE = 'L',M >= K >= 0; - if
SIDE = 'R',N >= K >= 0.
- If
AβAisREAL array, dimension (LDA,K). the i-th column must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned bySGEQRFin the firstkcolumns of its array argumentAπ«ΆLDAβLDAisINTEGER, the leading dimension of the arrayA:- If
SIDE = 'L',LDA >= max(1,M); - if
SIDE = 'R',LDA >= max(1,N).
- If
TAUβTAUisREAL array, dimension (K).TAU(i)must contain the scalar factor of the elementary reflectorH(i), as returned bySGEQRFπ§CCβ this one's aREALarray, dimension(LDC,N). On entry it's your M-by-N matrixC, and on exit it gets absolutely bodied β overwritten byQ*CorQ**T*CorC*Q**TorC*Qdepending on yourSIDE/TRANScombo. she does not survive the function bestie πLDCβINTEGER, the leading dimension of the arrayC. Requirement:LDC >= max(1,M). no skipping this one, it's giving non-negotiable βWORKβREALarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0, thenWORK(1)hands you back the optimalLWORK. it's literally telling you how much room she wanted πLWORKβINTEGER, the dimension of the arrayWORK.- If
SIDE = 'L', thenLWORK >= max(1,N); - if
SIDE = 'R', thenLWORK >= max(1,M). - For good performance,
LWORKshould generally be larger. (bigger workspace = happier routine, lowkey obsessed with that for her π )
- If
also!! 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. so-1is not a bug, it's a vibe check π§
INFOβINTEGER, the receipts:= 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.
Definition at line 166 of file sormqr.f.
π¦ subroutine zunmqr
okay so now the complex one, say hi to her π
subroutine zunmqr (character side, character trans, integer m, integer n,
integer k, complex*16, dimension( lda, * ) a, integer lda, complex*16,
dimension( * ) tau, complex*16, dimension( ldc, * ) c, integer ldc,
complex*16, dimension( * ) work, integer lwork, integer info)
π ZUNMQR
Purpose π
ZUNMQR 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 defined as the product of k elementary reflectors
Q = H(1) H(2) . . . H(k)
as returned by ZGEQRF. Q is of order M if SIDE = 'L' and of order N if SIDE = 'R'. she's iconic, she's unitary, she's built entirely out of her little reflector children π
Parameters β¨
SIDEβCHARACTER*1, so it's literally one single character, choose wisely:= 'L': applyQorQ**Hfrom the Left;= 'R': applyQorQ**Hfrom the Right.
TRANSβCHARACTER*1, another single char:= 'N': No transpose, applyQ;= 'C': Conjugate transpose, applyQ**H.
MβINTEGER, the number of rows of the matrixC.M >= 0. (zero is legal, she can be tiny)NβINTEGER, the number of columns of the matrixC.N >= 0.KβINTEGER, the number of elementary reflectors whose product defines the matrixQ.- If
SIDE = 'L',M >= K >= 0; - if
SIDE = 'R',N >= K >= 0.
- If
AβCOMPLEX*16array, dimension(LDA,K). The i-th column must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned byZGEQRFin the firstkcolumns of its array argumentA. so you cannot just make this up, it's got receipts fromZGEQRFπ₯LDAβINTEGER, the leading dimension of the arrayA.- If
SIDE = 'L',LDA >= max(1,M); - if
SIDE = 'R',LDA >= max(1,N).
- If
TAUβCOMPLEX*16array, dimension(K).TAU(i)must contain the scalar factor of the elementary reflectorH(i), as returned byZGEQRF. every reflector needs her little scalar accessory πCβCOMPLEX*16array, dimension(LDC,N). On entry, the M-by-N matrixC. On exit,Cis overwritten byQ*CorQ**H*CorC*Q**HorC*Q. (note it's**Hhere, not**Tβ complex edition, we conjugate before we flip π¦)LDCβINTEGER, the leading dimension of the arrayC.LDC >= max(1,M). same deal as always, no shortcuts βWORKβCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. bestie is reporting back πLWORKβINTEGER, the dimension of the arrayWORK.- If
SIDE = 'L',LWORK >= max(1,N); - if
SIDE = 'R',LWORK >= max(1,M). - For good performance,
LWORKshould generally be larger. treat her right and give her room β¨
- If
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. yes this is the same-1trick, it's a whole thing, it's her signature move π
INFOβINTEGER, the final verdict:= 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.
Definition at line 165 of file zunmqr.f.
Author π
Generated automatically by Doxygen for LAPACK from the source code.
aaaand that's the whole page bestie, you made it to the end π this gorgeous thing is from LAPACK Version 3.12.0, the page is unmqr(3), and it was auto-generated by Doxygen straight from the source code β no cap, the robots wrote the original, I just gave it the group-chat glow-up πβ¨ go forth and apply your reflectors responsibly π«Άπ
π¦ 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