CGERQF(3)
π CGERQF(3) β bestie, let's factor this β¨
okay so this page is literally from LAPACK Version 3.12.0, and the file it lives in is cgerqf.f (that's .../SRC/cgerqf.f in the source tree, iykyk). It's a library functions manual entry, and honestly? It ate. Let's get into it π«Ά
πΈ NAME πΈ
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/cgerqf.f
that's the whole name, bestie. it's giving "my full government name is a file path" π iconic though.
π¦ SYNOPSIS π¦
Functions/Subroutines
subroutine CGERQF (m, n, a, lda, tau, work, lwork, info)
CGERQF
yes that's a subroutine named CGERQF calling itself in the listing. no notes. main character energy π
β Function/Subroutine Documentation β
subroutine CGERQF (integer m, integer n, complex, dimension( lda, * ) a,
integer lda, complex, dimension( * ) tau, complex, dimension( * ) work,
integer lwork, integer info)
CGERQF
π Purpose π
okay so here's the whole vibe, straight from the source comment block:
!>
!> CGERQF computes an RQ factorization of a complex M-by-N matrix A:
!> A = R * Q.
!>
that's it. that's the whole job. A = R * Q. slay π₯
π Parameters π
M
!> M is INTEGER
!> The number of rows of the matrix A. M >= 0.
!>
your row count. M has to be >= 0, no negative row nonsense allowed π
N
!> N is INTEGER
!> The number of columns of the matrix A. N >= 0.
!>
your column count. N >= 0 too. everybody be non-negative π
A
!> A is COMPLEX array, dimension (LDA,N)
!> On entry, the M-by-N matrix A.
!> On exit,
!> if m <= n, the upper triangle of the subarray
!> A(1:m,n-m+1:n) contains the M-by-M upper triangular matrix R;
!> if m >= n, the elements on and above the (m-n)-th subdiagonal
!> contain the M-by-N upper trapezoidal matrix R;
!> the remaining elements, with the array TAU, represent the
!> unitary matrix Q as a product of min(m,n) elementary
!> reflectors (see Further Details).
!>
this one's the icon, the main character, the whole plot π It's a COMPLEX array, dimension (LDA,N).
- On entry? it's just the
M-by-NmatrixA. cute, simple. - On exit it's a whole glow-up:
- if
m <= n, the upper triangle of the subarrayA(1:m,n-m+1:n)holds theM-by-Mupper triangular matrixR; - if
m >= n, the elements on and above the(m-n)-th subdiagonal hold theM-by-Nupper trapezoidal matrixR; - and the remaining elements, together with the array
TAU, represent the unitary matrixQas a product ofmin(m,n)elementary reflectors (see Further Details, bestie, it's right down there β¬οΈ).
- if
LDA
!> LDA is INTEGER
!> The leading dimension of the array A. LDA >= max(1,M).
!>
the leading dimension of A. rule is LDA >= max(1,M). no cap, respect the leading dimension π«Ά
TAU
!> TAU is COMPLEX array, dimension (min(M,N))
!> The scalar factors of the elementary reflectors (see Further
!> Details).
!>
COMPLEX array, dimension (min(M,N)). it's holding the scalar factors of the elementary reflectors. the details? Further. π
WORK
!> WORK is COMPLEX array, dimension (MAX(1,LWORK))
!> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
!>
COMPLEX array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, then WORK(1) returns the optimal LWORK. it's giving "i brought receipts" β¨
LWORK
!> LWORK is INTEGER
!> The dimension of the array WORK.
!> LWORK >= 1, if MIN(M,N) = 0, and LWORK >= M, otherwise.
!> For optimum performance LWORK >= M*NB, where NB is
!> the optimal blocksize.
!>
!> 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.
!>
INTEGER, dimension of the WORK array. the rules, bestie:
LWORK >= 1, ifMIN(M,N) = 0, andLWORK >= M, otherwise.- For optimum performance
LWORK >= M*NB, whereNBis the optimal blocksize. - and here's the fun one π if
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued by XERBLA. so like,-1is the "just tell me the size, don't yell at me" mode π
INFO
!> INFO is INTEGER
!> = 0: successful exit
!> < 0: if INFO = -i, the i-th argument had an illegal value
!>
INTEGER, the vibe check at the end π
= 0: successful exit. we love a clean finish π< 0: ifINFO = -i, the i-th argument had an illegal value. somebody did NOT read the constraints π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
four institutions, one subroutine. the collab we didn't know we needed π«Ά
π§ Further Details π§
okay now the good part, the lore drop:
!>
!> The matrix Q is represented as a product of elementary reflectors
!>
!> Q = H(1)**H H(2)**H . . . H(k)**H, where k = min(m,n).
!>
!> Each H(i) has the form
!>
!> H(i) = I - tau * v * v**H
!>
!> where tau is a complex scalar, and v is a complex vector with
!> v(n-k+i+1:n) = 0 and v(n-k+i) = 1; conjg(v(1:n-k+i-1)) is stored on
!> exit in A(m-k+i,1:n-k+i-1), and tau in TAU(i).
!>
so Q is a product of elementary reflectors: Q = H(1)**H H(2)**H . . . H(k)**H, where k = min(m,n).
Each H(i) has the form H(i) = I - tau * v * v**H, where tau is a complex scalar, and v is a complex vector with v(n-k+i+1:n) = 0 and v(n-k+i) = 1.
and then β this is the part you screenshot πΈ β conjg(v(1:n-k+i-1)) is stored on exit in A(m-k+i,1:n-k+i-1), and tau in TAU(i). that's the storage tea. iykyk π
β Definition at line 138 of file cgerqf.f. β
like, line one-three-eight. precise. located. found her. π
πΈ Author πΈ
Generated automatically by Doxygen for LAPACK from the source code.
(yes, a robot wrote the docs. she still ate π)
β οΈ friendly little heads-up bestie: everything above about dimensions andLWORKis straight from the page β especially thatLWORK = -1query mode, where XERBLA stays quiet aboutLWORK. don't get caught out there π
and that's the page, bestie! π¦ sign-off time: this was LAPACK, Version 3.12.0, living at /home/abui...RC/cgerqf.f(3) β go factor something and slay, periodt πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms