SRC/zlamswlq.f(3)
π SRC/zlamswlq.f β like, the whole entire page, bestie
okay so this is SRC/zlamswlq.f(3), straight out of the LAPACK Library Functions Manual, and honestly? she's a baddie. let's get into it β¨
β¨ SYNOPSIS β¨
functions & subroutines (the cast π)
subroutine zlamswlq (side, trans, m, n, k, mb, nb, a, lda, t, ldt, c, ldc, work, lwork, info)β this is the one. the main character.ZLAMSWLQ.
π¦ Function/Subroutine Documentation π¦
ok so here's the full signature, no cap, copied exactly:
subroutine zlamswlq (character side, character trans, integer m, integer n,
integer k, integer mb, integer nb, complex*16, dimension( lda, * ) a,
integer lda, complex*16, dimension( ldt, * ) t, integer ldt, complex*16,
dimension( ldc, * ) c, integer ldc, complex*16, dimension( * ) work,
integer lwork, integer info)
ZLAMSWLQ. that's her name. iconic.
πΈ Purpose πΈ
!> !> ZLAMSWLQ overwrites the general complex M-by-N matrix C with !> !> !> SIDE = 'L' SIDE = 'R' !> TRANS = 'N': Q * C C * Q !> TRANS = 'C': QH * C C * QH !> where Q is a complex unitary matrix defined as the product of blocked !> elementary reflectors computed by short wide LQ !> factorization (ZLASWLQ) !>
like, it literally just overwrites C with one of those four options depending on SIDE and TRANS. and Q? a complex unitary matrix, defined as the product of blocked elementary reflectors computed by short wide LQ factorization (ZLASWLQ). periodt. π₯
π Parameters π
SIDE
!> SIDE is CHARACTER*1 !> = 'L': apply Q or QH from the Left; !> = 'R': apply Q or QH from the Right. !>
so like, which side are we multiplying from? 'L' = left, 'R' = right. choose wisely bestie π
TRANS
!> TRANS is CHARACTER*1 !> = 'N': No transpose, apply Q; !> = 'C': Conjugate Transpose, apply Q**H. !>
do we transpose or not. 'N' = nope, just Q. 'C' = conjugate transpose, so Q**H. that's the vibe.
M
!> M is INTEGER !> The number of rows of the matrix C. M >=0. !>
rows of C. and M >=0 β zero rows is technically allowed, we don't judge. π
N
!> N is INTEGER !> The number of columns of the matrix C. N >= 0. !>
columns of C. also N >= 0. equality rights! β¨
K
!> K is INTEGER !> The number of elementary reflectors whose product defines !> the matrix Q. !> M >= K >= 0; !> !>
the number of elementary reflectors that multiply together to define Q. constraint: M >= K >= 0. math is mathing π
MB
!> MB is INTEGER !> The row block size to be used in the blocked LQ. !> M >= MB >= 1 !>
row block size for the blocked LQ. and nope, MB can't be zero β M >= MB >= 1, them's the rules.
NB
!> NB is INTEGER !> The column block size to be used in the blocked LQ. !> NB > M. !>
column block size. heads up, it's strictly bigger than M: NB > M. no sneaky equals sign. π€
A
!> A is COMPLEX*16 array, dimension !> (LDA,M) if SIDE = 'L', !> (LDA,N) if SIDE = 'R' !> The i-th row must contain the vector which defines the blocked !> elementary reflector H(i), for i = 1,2,...,k, as returned by !> ZLASWLQ in the first k rows of its array argument A. !>
dimension (LDA,M) when SIDE = 'L', (LDA,N) when SIDE = 'R'. the i-th row holds the vector defining the blocked elementary reflector H(i) for i = 1,2,...,k, exactly as ZLASWLQ returned it in the first k rows of its array argument A. slay.
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). don't forget the MAX(1, part, that's the little detail everyone misses.
T
!> T is COMPLEX*16 array, dimension !> ( M * Number of blocks(CEIL(N-K/NB-K)), !> The blocked upper triangular block reflectors stored in compact form !> as a sequence of upper triangular blocks. See below !> for further details. !>
dimension is ( M * Number of blocks(CEIL(N-K/NB-K)), β yes that's the literal text, i'm not touching it. this is where the blocked upper triangular block reflectors live, packed compactly as a sequence of upper triangular blocks. there's more further down π
LDT
!> LDT is INTEGER !> The leading dimension of the array T. LDT >= MB. !>
leading dimension of T. LDT >= MB. simple as that π«Ά
C
!> C is COMPLEX*16 array, dimension (LDC,N) !> On entry, the M-by-N matrix C. !> On exit, C is overwritten by Q*C or QH*C or C*QH or C*Q. !>
dimension (LDC,N). on entry it's the M-by-N matrix C; on exit it gets overwritten by Q*C or Q**H*C or C*Q**H or C*Q. she does not survive the function. that's just how it is π
LDC
!> LDC is INTEGER !> The leading dimension of the array C. LDC >= max(1,M). !>
leading dimension of C. LDC >= max(1,M) β lowercase max this time, keeping it exactly as written, tyvm.
WORK
!> (workspace) COMPLEX*16 array, dimension (MAX(1,LWORK)) !> On exit, if INFO = 0, WORK(1) returns the minimal LWORK. !>
the workspace, COMPLEX*16, dimension (MAX(1,LWORK)). on exit, if INFO = 0, then WORK(1) hands you back the minimal LWORK. helpful queen. β¨
LWORK
!> LWORK is INTEGER !> The dimension of the array WORK. !> If MIN(M,N,K) = 0, LWORK >= 1. !> If SIDE = 'L', LWORK >= max(1,NB*MB). !> If SIDE = 'R', LWORK >= max(1,M*MB). !> !> If LWORK = -1, then a workspace query is assumed; the routine !> only calculates the minimal 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. !>
dimension of WORK. the rules:
- if
MIN(M,N,K) = 0, thenLWORK >= 1 - if
SIDE = 'L', thenLWORK >= max(1,NB*MB) - if
SIDE = 'R', thenLWORK >= max(1,M*MB)
and here's the fun part: if LWORK = -1, it's a workspace query. the routine only calculates the minimal size of the WORK array, returns it as the first entry of WORK, and XERBLA issues no error message related to LWORK. so don't panic when you see nothing. π
INFO
!> INFO is INTEGER !> = 0: successful exit !> < 0: if INFO = -i, the i-th argument had an illegal value !>
0 = we ate, successful exit. < 0 = if INFO = -i, the i-th argument had an illegal value. rude but fair.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole squad. respect. π«Ά
π§ Further Details π§
!> Short-Wide LQ (SWLQ) performs LQ by a sequence of unitary transformations, !> representing Q as a product of other unitary matrices !> Q = Q(1) * Q(2) * . . . * Q(k) !> where each Q(i) zeros out upper diagonal entries of a block of NB rows of A: !> Q(1) zeros out the upper diagonal entries of rows 1:NB of A !> Q(2) zeros out the bottom MB-N rows of rows [1:M,NB+1:2*NB-M] of A !> Q(3) zeros out the bottom MB-N rows of rows [1:M,2*NB-M+1:3*NB-2*M] of A !> . . . !> !> Q(1) is computed by GELQT, which represents Q(1) by Householder vectors !> stored under the diagonal of rows 1:MB of A, and by upper triangular !> block reflectors, stored in array T(1:LDT,1:N). !> For more information see Further Details in GELQT. !> !> Q(i) for i>1 is computed by TPLQT, which represents Q(i) by Householder vectors !> stored in columns [(i-1)(NB-M)+M+1:i(NB-M)+M] of A, and by upper triangular !> block reflectors, stored in array T(1:LDT,(i-1)*M+1:i*M). !> The last Q(k) may use fewer rows. !> For more information see Further Details in TPLQT. !> !> For more details of the overall algorithm, see the description of !> Sequential TSQR in Section 2.2 of [1]. !> !> [1] βCommunication-Optimal Parallel and Sequential QR and LU Factorizations,β !> J. Demmel, L. Grigori, M. Hoemmen, J. Langou, !> SIAM J. Sci. Comput, vol. 34, no. 1, 2012 !>
so SWLQ does LQ via a sequence of unitary transformations, representing Q as Q = Q(1) * Q(2) * . . . * Q(k). each Q(i) zeroes out upper diagonal entries of a block of NB rows of A:
Q(1)zeros out the upper diagonal entries of rows1:NBofAQ(2)zeros out the bottomMB-Nrows of rows[1:M,NB+1:2*NB-M]ofAQ(3)zeros out the bottomMB-Nrows of rows[1:M,2*NB-M+1:3*NB-2*M]ofA. . .(you get it, it keeps going β¨)
Q(1) comes from GELQT, which represents Q(1) via Householder vectors stored under the diagonal of rows 1:MB of A, plus upper triangular block reflectors stored in array T(1:LDT,1:N). more info in Further Details in GELQT π
Q(i) for i>1 comes from TPLQT, which represents Q(i) via Householder vectors stored in columns [(i-1)*(NB-M)+M+1:i*(NB-M)+M] of A, plus upper triangular block reflectors stored in array T(1:LDT,(i-1)*M+1:i*M). the last Q(k) may use fewer rows. more info in Further Details in TPLQT.
for the full algorithm tea, see the description of Sequential TSQR in Section 2.2 of [1].
[1] βCommunication-Optimal Parallel and Sequential QR and LU Factorizations,β J. Demmel, L. Grigori, M. Hoemmen, J. Langou, SIAM J. Sci. Comput, vol. 34, no. 1, 2012. citation queen π
Definition at line 198 of file zlamswlq.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
and that's the page, bestie π β auto-generated by Doxygen for LAPACK, from the source code, LAPACK Version 3.12.0, SRC/zlamswlq.f(3). literally iconic, no notes. π
β¨
π¦ 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