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:

STPMQRT applies a real orthogonal matrix Q obtained from a real block reflector H to a general real matrix C, which consists of two blocks A and B.

it's giving "quietly carrying the whole factorization" energy, honestly πŸ’œ


🌈 Parameters 🌈

one by one, bestie, we're not skipping a single one:

  • SIDE β€” SIDE is CHARACTER*1, and it picks a whole side:
    • = 'L': apply Q or Q^T from the Left;
    • = 'R': apply Q or Q^T from the Right.
  • TRANS β€” TRANS is CHARACTER*1, the transpose vibe check:
    • = 'N': No transpose, apply Q;
    • = 'T': Transpose, apply Q^T.
  • M β€” M is INTEGER. the number of rows of the matrix B. constraint: M >= 0.
  • N β€” N is INTEGER. the number of columns of the matrix B. constraint: 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. constraint: K >= L >= 0. πŸ‘€ See Further Details.
  • NB β€” NB is INTEGER. the block size used for the storage of T. constraint: K >= NB >= 1. ⚠️ this must be the same value of NB used to generate T in CTPQRT β€” like, they have to match, no improvising.
  • 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. constraint: 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.

  • 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, that's LDC sitting right there in the LDA description β€” copying it exactly as the page says it, don't come for me πŸ’€)

  • 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. constraint: 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'. don't forget to size her right πŸŽ€
  • 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 this is the part where it gets good, so pay attention:

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.

then the layout, depending on which side you're on:

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.

and the exact block forms, mark them:

      V = [V1]
          [V2].
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.

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