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': 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 B. M >= 0.
  • N β€” N is INTEGER; the number of columns of the matrix B. N >= 0.
  • K β€” K is INTEGER; the number of elementary reflectors whose product defines the matrix Q.
  • L β€” L is INTEGER; the order of the trapezoidal part of V. K >= L >= 0. See Further Details.
  • NB β€” NB is INTEGER; the block size used for the storage of T. K >= NB >= 1. This must be the same value of NB used to generate T in CTPQRT.
  • V β€” V is COMPLEX 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 by CTPQRT in B. See Further Details.
  • LDV β€” LDV is INTEGER; the leading dimension of the array V. If SIDE = 'L', LDV >= max(1,M); if SIDE = 'R', LDV >= max(1,N).
  • T β€” T is COMPLEX array, dimension (LDT,K); the upper triangular factors of the block reflectors as returned by CTPQRT, stored as a NB-by-K matrix.
  • LDT β€” LDT is INTEGER; the leading dimension of the array T. LDT >= NB.
  • A β€” A is COMPLEX array, dimension (LDA,N) if SIDE = 'L' or (LDA,K) if SIDE = '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 β€” LDA is INTEGER; the leading dimension of the array A. If SIDE = 'L', LDC >= max(1,K); If SIDE = 'R', LDC >= max(1,M). yep, it says LDC β€” I'm just the messenger, bestie πŸ’€
  • B β€” B is COMPLEX array, dimension (LDB,N); on entry, the M-by-N matrix B. On exit, B is overwritten by the corresponding block of Q*C or Q**H*C or C*Q or C*Q**H. See Further Details.
  • LDB β€” LDB is INTEGER; the leading dimension of the array B. LDB >= max(1,M).
  • WORK β€” WORK is COMPLEX array; the dimension of WORK is N*NB if SIDE = 'L', or M*NB if SIDE = 'R'.
  • 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.

πŸ¦‹ 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': 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 B. M >= 0.
  • N β€” N is INTEGER; the number of columns of the matrix B. N >= 0.
  • K β€” K is INTEGER; the number of elementary reflectors whose product defines the matrix Q.
  • L β€” L is INTEGER; the order of the trapezoidal part of V. K >= L >= 0. See Further Details.
  • NB β€” NB is INTEGER; the block size used for the storage of T. K >= NB >= 1. This must be the same value of NB used to generate T in CTPQRT.
  • V β€” V is DOUBLE PRECISION 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 by CTPQRT in B. See Further Details.
  • LDV β€” LDV is INTEGER; the leading dimension of the array V. If SIDE = 'L', LDV >= max(1,M); if SIDE = 'R', LDV >= max(1,N).
  • T β€” T is DOUBLE PRECISION array, dimension (LDT,K); the upper triangular factors of the block reflectors as returned by CTPQRT, stored as a NB-by-K matrix.
  • LDT β€” LDT is INTEGER; the leading dimension of the array T. LDT >= NB.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,N) if SIDE = 'L' or (LDA,K) if SIDE = '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 β€” LDA is INTEGER; the leading dimension of the array A. If SIDE = 'L', LDC >= max(1,K); If SIDE = 'R', LDC >= max(1,M). again, LDC is what the page says β€” not me fixing it, bestie πŸ’€
  • B β€” B is DOUBLE PRECISION array, dimension (LDB,N); on entry, the M-by-N matrix B. On exit, B is overwritten by the corresponding block of Q*C or Q**T*C or C*Q or C*Q**T. See Further Details.
  • LDB β€” LDB is INTEGER; the leading dimension of the array B. LDB >= max(1,M).
  • WORK β€” WORK is DOUBLE PRECISION array; the dimension of WORK is N*NB if SIDE = 'L', or M*NB if SIDE = 'R'.
  • 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.

πŸ’œ 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' 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.

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 β€” 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 B. M >= 0.
  • N β€” N is INTEGER. The number of columns of the matrix B. N >= 0.
  • K β€” K is INTEGER. The number of elementary reflectors whose product defines the matrix Q.
  • L β€” L is INTEGER. The order of the trapezoidal part of V. K >= L >= 0. See Further Details. πŸ‘€
  • NB β€” NB is INTEGER. The block size used for the storage of T. K >= NB >= 1. This must be the same value of NB used to generate T in CTPQRT. 🚨 like genuinely, same value, no cap, don't freestyle it.
  • V β€” V is REAL 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 by CTPQRT in B. See Further Details.
  • LDV β€” LDV is INTEGER. The leading dimension of the array V.
    • If SIDE = 'L', LDV >= max(1,M);
    • if SIDE = 'R', LDV >= max(1,N).
  • T β€” T is REAL array, dimension (LDT,K). The upper triangular factors of the block reflectors as returned by CTPQRT, stored as a NB-by-K matrix.
  • LDT β€” LDT is INTEGER. The leading dimension of the array T. LDT >= NB.
  • A β€” A is REAL array, dimension
    • (LDA,N) if SIDE = 'L' or
    • (LDA,K) if SIDE = '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 β€” LDA is INTEGER. The leading dimension of the array A.
    • If SIDE = 'L', LDC >= max(1,K);
    • If SIDE = 'R', LDC >= max(1,M).
tiny heads-up bestie: the source text literally writes LDC in the LDA description β€” that's A's leading dimension, not C's. We're keeping it exactly as shipped, iykyk. πŸ™ˆ
  • B β€” B is REAL array, dimension (LDB,N). On entry, the M-by-N matrix B. On exit, B is overwritten by the corresponding block of Q*C or Q^T*C or C*Q or C*Q^T. See Further Details.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • WORK β€” WORK is REAL array. The dimension of WORK is N*NB if SIDE = 'L', or M*NB if SIDE = 'R'. 🧚 scrub that workspace bestie
  • 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.

⭐ 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' 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.

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 β€” SIDE is CHARACTER*1
    • = '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.
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 β€” M is INTEGER. The number of rows of the matrix B. M >= 0.
  • N β€” N is INTEGER. The number of columns of the matrix B. N >= 0.
  • K β€” K is INTEGER. The number of elementary reflectors whose product defines the matrix Q.
  • L β€” L is INTEGER. The order of the trapezoidal part of V. K >= L >= 0. See Further Details.
  • NB β€” NB is INTEGER. The block size used for the storage of T. K >= NB >= 1. This must be the same value of NB used to generate T in CTPQRT. 🚨 same NB. always. no exceptions.
  • V β€” V is COMPLEX*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 by CTPQRT in B. See Further Details.
  • LDV β€” LDV is INTEGER. The leading dimension of the array V.
    • If SIDE = 'L', LDV >= max(1,M);
    • if SIDE = 'R', LDV >= max(1,N).
  • T β€” T is COMPLEX*16 array, dimension (LDT,K). The upper triangular factors of the block reflectors as returned by CTPQRT, stored as a NB-by-K matrix.
  • LDT β€” LDT is INTEGER. The leading dimension of the array T. LDT >= NB.
  • A β€” A is COMPLEX*16 array, dimension
    • (LDA,N) if SIDE = 'L' or
    • (LDA,K) if SIDE = '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 β€” LDA is INTEGER. The leading dimension of the array A.
    • If SIDE = 'L', LDC >= max(1,K);
    • If SIDE = 'R', LDC >= max(1,M).
and yeah, same LDC situation here as in the other two β€” the original text says LDC inside the LDA block. Preserved verbatim, periodt. πŸ’…
  • B β€” B is COMPLEX*16 array, dimension (LDB,N). On entry, the M-by-N matrix B. On exit, B is overwritten by the corresponding block of Q*C or Q**H*C or C*Q or C*Q**H. See Further Details.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • WORK β€” WORK is COMPLEX*16 array. The dimension of WORK is N*NB if SIDE = 'L', or M*NB if SIDE = 'R'. 🧚
  • 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.

⭐ 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' 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.

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' 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. πŸ”₯
Lowkey important: those on exit replacements are the whole point of calling this β€” the matrix C you 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