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 β€” SIDE is CHARACTER*1, and it picks a whole side, iconic:
    • = 'L': apply Q or Q**H from the Left;
    • = 'R': apply Q or Q**H from the Right.
  • TRANS β€” TRANS is CHARACTER*1:
    • = 'N': No transpose, apply Q;
    • = 'C': Conjugate transpose, apply Q**H.
  • M β€” M is INTEGER, the number of rows of the matrix C. and it must satisfy M >= 0 ✨
  • N β€” N is INTEGER, the number of columns of the matrix C. also N >= 0 πŸ’…
  • K β€” K is INTEGER, the number of elementary reflectors whose product defines the matrix Q. the rules, no cap:
    • If SIDE = 'L', M >= K >= 0;
    • if SIDE = 'R', N >= K >= 0.
  • A β€” A is COMPLEX array, dimension (LDA,K). the i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,...,k, as returned by CGEQRF in the first k columns of its array argument A 🫢
  • LDA β€” LDA is INTEGER, the leading dimension of the array A:
    • If SIDE = 'L', LDA >= max(1,M);
    • if SIDE = 'R', LDA >= max(1,N).
  • TAU β€” TAU is COMPLEX array, dimension (K). TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by CGEQRF 🌸
  • C β€” C is COMPLEX array, dimension (LDC,N). On entry, the M-by-N matrix C. On exit, C is overwritten by Q*C or Q**H*C or C*Q**H or C*Q. she gets a whole new personality, we love a transformation arc πŸ’€
  • LDC β€” LDC is INTEGER, the leading dimension of the array C. LDC >= max(1,M).
  • WORK β€” WORK is COMPLEX array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK 🧚
  • LWORK β€” LWORK is INTEGER, the dimension of the array WORK:
    • If SIDE = 'L', LWORK >= max(1,N);
    • if SIDE = 'R', LWORK >= max(1,M).
    • For good performance, LWORK should generally be larger. (fr fr, don't be stingy, she performs better with room to breathe ✨)

and the special case, super important πŸ‘‘:

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
  • INFO β€” INFO is INTEGER:
    • = 0: successful exit πŸŽ‰
    • < 0: if INFO = -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 β€” SIDE is CHARACTER*1:
    • = 'L': apply Q or Q**T from the Left;
    • = 'R': apply Q or Q**T from the Right.
  • TRANS β€” TRANS is CHARACTER*1:
    • = 'N': No transpose, apply Q;
    • = 'T': Transpose, apply Q**T.
  • M β€” M is INTEGER, the number of rows of the matrix C. M >= 0 πŸ’…
  • N β€” N is INTEGER, the number of columns of the matrix C. N >= 0 ✨
  • K β€” K is INTEGER, the number of elementary reflectors whose product defines the matrix Q:
    • If SIDE = 'L', M >= K >= 0;
    • if SIDE = 'R', N >= K >= 0.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,K). the i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,...,k, as returned by DGEQRF in the first k columns of its array argument A 🫢
  • LDA β€” LDA is INTEGER, the leading dimension of the array A:
    • If SIDE = 'L', LDA >= max(1,M);
    • if SIDE = 'R', LDA >= max(1,N).
  • TAU β€” TAU is DOUBLE PRECISION array, dimension (K). TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by DGEQRF πŸŽ€
  • C β€” C is DOUBLE PRECISION array, dimension (LDC,N). On entry, the M-by-N matrix C. On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q. main character gets rewritten, iconic πŸ’€
  • LDC β€” LDC is INTEGER, the leading dimension of the array C. LDC >= max(1,M).
  • WORK β€” WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK 🧚
  • LWORK β€” LWORK is INTEGER, the dimension of the array WORK:
    • If SIDE = 'L', LWORK >= max(1,N);
    • if SIDE = 'R', LWORK >= max(1,M).
    • For good performance, LWORK should generally be larger.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. (so like, she's just doing recon, no drama, no XERBLA yelling πŸ‘‘)
  • INFO β€” INFO is INTEGER:
    • = 0: successful exit πŸŽ‰
    • < 0: if INFO = -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 β€” SIDE is CHARACTER*1:
    • = 'L': apply Q or Q**T from the Left;
    • = 'R': apply Q or Q**T from the Right.
  • TRANS β€” TRANS is CHARACTER*1:
    • = 'N': No transpose, apply Q;
    • = 'T': Transpose, apply Q**T.
  • M β€” M is INTEGER, the number of rows of the matrix C. M >= 0 πŸ’…
  • N β€” N is INTEGER, the number of columns of the matrix C. N >= 0 🌸
  • K β€” K is INTEGER, the number of elementary reflectors whose product defines the matrix Q:
    • If SIDE = 'L', M >= K >= 0;
    • if SIDE = 'R', N >= K >= 0.
  • A β€” A is REAL array, dimension (LDA,K). the i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,...,k, as returned by SGEQRF in the first k columns of its array argument A 🫢
  • LDA β€” LDA is INTEGER, the leading dimension of the array A:
    • If SIDE = 'L', LDA >= max(1,M);
    • if SIDE = 'R', LDA >= max(1,N).
  • TAU β€” TAU is REAL array, dimension (K). TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by SGEQRF 🧚
  • C
  • C β€” this one's a REAL array, dimension (LDC,N). On entry it's your M-by-N matrix C, and on exit it gets absolutely bodied β€” overwritten by Q*C or Q**T*C or C*Q**T or C*Q depending on your SIDE/TRANS combo. she does not survive the function bestie 😭
  • LDC β€” INTEGER, the leading dimension of the array C. Requirement: LDC >= max(1,M). no skipping this one, it's giving non-negotiable βœ‹
  • WORK β€” REAL array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, then WORK(1) hands you back the optimal LWORK. it's literally telling you how much room she wanted πŸŽ€
  • LWORK β€” INTEGER, the dimension of the array WORK.
    • If SIDE = 'L', then LWORK >= max(1,N);
    • if SIDE = 'R', then LWORK >= max(1,M).
    • For good performance, LWORK should generally be larger. (bigger workspace = happier routine, lowkey obsessed with that for her πŸ’…)
also!! If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. so -1 is not a bug, it's a vibe check 🧚
  • INFO β€” INTEGER, the receipts:
    • = 0: successful exit πŸŽ‰
    • < 0: if INFO = -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': apply Q or Q**H from the Left;
    • = 'R': apply Q or Q**H from the Right.
  • TRANS β€” CHARACTER*1, another single char:
    • = 'N': No transpose, apply Q;
    • = 'C': Conjugate transpose, apply Q**H.
  • M β€” INTEGER, the number of rows of the matrix C. M >= 0. (zero is legal, she can be tiny)
  • N β€” INTEGER, the number of columns of the matrix C. N >= 0.
  • K β€” INTEGER, the number of elementary reflectors whose product defines the matrix Q.
    • If SIDE = 'L', M >= K >= 0;
    • if SIDE = 'R', N >= K >= 0.
  • A β€” COMPLEX*16 array, dimension (LDA,K). The i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,...,k, as returned by ZGEQRF in the first k columns of its array argument A. so you cannot just make this up, it's got receipts from ZGEQRF πŸ”₯
  • LDA β€” INTEGER, the leading dimension of the array A.
    • If SIDE = 'L', LDA >= max(1,M);
    • if SIDE = 'R', LDA >= max(1,N).
  • TAU β€” COMPLEX*16 array, dimension (K). TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by ZGEQRF. every reflector needs her little scalar accessory πŸ’…
  • C β€” COMPLEX*16 array, dimension (LDC,N). On entry, the M-by-N matrix C. On exit, C is overwritten by Q*C or Q**H*C or C*Q**H or C*Q. (note it's **H here, not **T β€” complex edition, we conjugate before we flip πŸ¦‹)
  • LDC β€” INTEGER, the leading dimension of the array C. LDC >= max(1,M). same deal as always, no shortcuts βœ‹
  • WORK β€” COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. bestie is reporting back πŸŽ€
  • LWORK β€” INTEGER, the dimension of the array WORK.
    • If SIDE = 'L', LWORK >= max(1,N);
    • if SIDE = 'R', LWORK >= max(1,M).
    • For good performance, LWORK should generally be larger. treat her right and give her room ✨
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. yes this is the same -1 trick, it's a whole thing, it's her signature move 😎
  • INFO β€” INTEGER, the final verdict:
    • = 0: successful exit πŸŽ‰
    • < 0: if INFO = -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