SRC/cunmr2.f(3)

🌸 SRC/cunmr2.f(3) 🌸

okay bestie, welcome to the glow-up of SRC/cunmr2.f(3) β€” section 3 of the Library Functions Manual, and honestly? it's giving math girlie with a plan. this is the man page for a little Fortran subroutine that does one very specific iconic thing, and we're gonna walk through it together, no gatekeeping πŸ’…


✨ NAME ✨

SRC/cunmr2.f

yeah. that's it. that's the name. she's lowkey mysterious like that πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

Functions/Subroutines

  • subroutine cunmr2 (side, trans, m, n, k, a, lda, tau, c, ldc, work, info) β€” CUNMR2 multiplies a general matrix by the unitary matrix from a RQ factorization determined by cgerqf (unblocked algorithm).

πŸ‘‘ Function/Subroutine Documentation πŸ‘‘

subroutine cunmr2 (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 info)

so this is the full signature, and yes it's long, and yes you're gonna read it, because that's the whole assignment 🫢

CUNMR2 multiplies a general matrix by the unitary matrix from a RQ factorization determined by cgerqf (unblocked algorithm).

🧚 Purpose:

!>
!> CUNMR2 overwrites the general complex m-by-n matrix C with
!>
!>       Q * C  if SIDE = 'L' and TRANS = 'N', or
!>
!>       Q**H* C  if SIDE = 'L' and TRANS = 'C', or
!>
!>       C * Q  if SIDE = 'R' and TRANS = 'N', or
!>
!>       C * Q**H if SIDE = 'R' and TRANS = 'C',
!>
!> where Q is a complex unitary matrix defined as the product of k
!> elementary reflectors
!>
!>       Q = H(1)**H H(2)**H . . . H(k)**H
!>
!> as returned by CGERQF. Q is of order m if SIDE = 'L' and of order n
!> if SIDE = 'R'.
!>

like, she literally just multiplies stuff by Q (or Q**H, depending on your vibe) β€” left or right, transpose or no transpose. main character energy, but make it linear algebra ✨


πŸ’– Parameters πŸ’–

SIDE

!>          SIDE is CHARACTER*1
!>          = 'L': apply Q or Q**H from the Left
!>          = 'R': apply Q or Q**H from the Right
!>

are we going left or right? pick a lane, bestie. 'L' = left, 'R' = right.

TRANS

!>          TRANS is CHARACTER*1
!>          = 'N': apply Q  (No transpose)
!>          = 'C': apply Q**H (Conjugate transpose)
!>

'N' means no transpose (plain Q), 'C' means conjugate transpose (Q**H). choose your fighter πŸ’€

M

!>          M is INTEGER
!>          The number of rows of the matrix C. M >= 0.
!>

the number of rows of C. and M >= 0, like respect the boundary fr fr.

N

!>          N is INTEGER
!>          The number of columns of the matrix C. N >= 0.
!>

the number of columns of C. also N >= 0. equality icon behavior 🌈

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.
!>

how many elementary reflectors are we multiplying together to build Q. and the bounds are strict, okay β€” if SIDE = 'L' then M >= K >= 0; if SIDE = 'R' then N >= K >= 0. no cap πŸ”₯

A

!>          A is COMPLEX array, dimension
!>                               (LDA,M) if SIDE = 'L',
!>                               (LDA,N) if SIDE = 'R'
!>          The i-th row must contain the vector which defines the
!>          elementary reflector H(i), for i = 1,2,...,k, as returned by
!>          CGERQF in the last k rows of its array argument A.
!>          A is modified by the routine but restored on exit.
!>

the i-th row carries the vector defining elementary reflector H(i), for i = 1,2,...,k, exactly as returned by CGERQF in the last k rows of its array argument A. and listen β€” A gets modified by the routine but it's restored on exit, so she leaves no trace, we love a considerate queen πŸ™ˆ

LDA

!>          LDA is INTEGER
!>          The leading dimension of the array A. LDA >= max(1,K).
!>

leading dimension of A, and it's gotta be LDA >= max(1,K). the max(1, ...) is there so we don't embarrass ourselves when K is zero πŸ’…

TAU

!>          TAU is COMPLEX array, dimension (K)
!>          TAU(i) must contain the scalar factor of the elementary
!>          reflector H(i), as returned by CGERQF.
!>

TAU(i) holds the scalar factor of H(i), as returned by CGERQF. dimension is (K), so she's exactly as long as she needs to be. periodt.

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.
!>

on entry, it's your m-by-n matrix C; on exit, she's been overwritten by Q*C or Q**H*C or C*Q**H or C*Q. so like... say goodbye to the original, she's been transformed 🌸

LDC

!>          LDC is INTEGER
!>          The leading dimension of the array C. LDC >= max(1,M).
!>

leading dimension of C, and it needs LDC >= max(1,M). again with the max(1, ...) β€” safety first, always πŸŽ€

WORK

!>          WORK is COMPLEX array, dimension
!>                                   (N) if SIDE = 'L',
!>                                   (M) if SIDE = 'R'
!>

scratch space! dimension (N) if SIDE = 'L', (M) if SIDE = 'R'. she's just here to help, don't @ her.

INFO

!>          INFO is INTEGER
!>          = 0: successful exit
!>          < 0: if INFO = -i, the i-th argument had an illegal value
!>

INFO = 0 means successful exit, we're slaying. INFO < 0 means if INFO = -i, the i-th argument had an illegal value β€” so if you see a negative number, that's the universe telling you which argument you fumbled 😭


🌟 Author 🌟

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

cute little academic friend group, honestly obsessed 🫢

Definition at line 157 of file cunmr2.f.


πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for LAPACK from the source code. (yes, a robot wrote this section, and honestly she ate πŸ€–βœ¨)


okay that's the whole page bestie, every flag, every parameter, every bound β€” nothing skipped, nothing invented. go forth and multiply your matrices πŸ’–

signing off with love: LAPACK, Version 3.12.0, dated right there next to SRC/cunmr2.f(3) β€” mwah πŸ’‹

πŸ“¦ where this page comes from