SRC/sgeqr2p.f(3)
π SRC/sgeqr2p.f π
okay bestie, so this page is from the LAPACK manual (that's the library name, bestie, it's giving "library functions manual" energy) and it's literally all about one little subroutine. let's get into it π
β¨ SYNOPSIS β¨
π¦ Functions/Subroutines
subroutine sgeqr2p (m, n, a, lda, tau, work, info)β SGEQR2P computes the QR factorization of a general rectangular matrix with non-negative diagonal elements using an unblocked algorithm.
π«Ά Function/Subroutine Documentation π«Ά
subroutine sgeqr2p (integer m, integer n, real, dimension( lda, * ) a,
integer lda, real, dimension( * ) tau, real, dimension( * ) work,
integer info)
SGEQR2P computes the QR factorization of a general rectangular matrix with non-negative diagonal elements using an unblocked algorithm. that's the whole vibe, fr fr β¨
πΈ Purpose:
!>
!> SGEQR2P computes a QR factorization of a real m-by-n matrix A:
!>
!> A = Q * ( R ),
!> ( 0 )
!>
!> where:
!>
!> Q is a m-by-m orthogonal matrix;
!> R is an upper-triangular n-by-n matrix with nonnegative diagonal
!> entries;
!> 0 is a (m-n)-by-n zero matrix, if m > n.
!>
!>
so like. it takes your matrix and splits it into Q times R, where Q is m-by-m and orthogonal, R is upper-triangular n-by-n with nonnegative diagonal entries, and that 0 block is the (m-n)-by-n zero matrix when m > n. iconic decomposition behavior, no cap π
π Parameters
M
!> M is INTEGER
!> The number of rows of the matrix A. M >= 0.
!>
the row count, king. it's an INTEGER and it better be M >= 0 or we're gonna have a problem π«
N
!> N is INTEGER
!> The number of columns of the matrix A. N >= 0.
!>
the column count, queen. INTEGER, N >= 0, same rules, same energy π
A
!> A is REAL array, dimension (LDA,N)
!> On entry, the m by n matrix A.
!> On exit, the elements on and above the diagonal of the array
!> contain the min(m,n) by n upper trapezoidal matrix R (R is
!> upper triangular if m >= n). The diagonal entries of R
!> are nonnegative; the elements below the diagonal,
!> with the array TAU, represent the orthogonal matrix Q as a
!> product of elementary reflectors (see Further Details).
!>
a REAL array with dimension (LDA,N). on entry? it's just your m-by-n matrix A, no biggie. on exit? it's a whole glow-up: everything on and above the diagonal now holds the min(m,n)-by-n upper trapezoidal matrix R (and R is straight-up upper triangular if m >= n). the diagonal entries of R are nonnegative β¨. and everything below the diagonal, together with the array TAU, secretly encodes the orthogonal matrix Q as a product of elementary reflectors (see Further Details, we get there bestie, don't worry).
LDA
!> LDA is INTEGER
!> The leading dimension of the array A. LDA >= max(1,M).
!>
the leading dimension of A. INTEGER. must satisfy LDA >= max(1,M). that's it. that's the rule. respect it π
TAU
!> TAU is REAL array, dimension (min(M,N))
!> The scalar factors of the elementary reflectors (see Further
!> Details).
!>
REAL array, dimension (min(M,N)). these are the scalar factors of the elementary reflectors. the little squeaky gears inside Q's whole machine π§
WORK
!> WORK is REAL array, dimension (N)
!>
REAL array, dimension (N). it's literally just the workspace, let it do its job π
INFO
!> INFO is INTEGER
!> = 0: successful exit
!> < 0: if INFO = -i, the i-th argument had an illegal value
!>
the vibe check at the end. = 0 means successful exit, we ate. < 0 means if INFO = -i, the i-th argument had an illegal value β so like, somebody passed you something cursed, go look at argument number i. π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
look at this collaborative main-character lineup, we love a group project that actually worked π
β Further Details:
!>
!> The matrix Q is represented as a product of elementary reflectors
!>
!> Q = H(1) H(2) . . . H(k), where k = min(m,n).
!>
!> Each H(i) has the form
!>
!> H(i) = I - tau * v * v**T
!>
!> where tau is a real scalar, and v is a real vector with
!> v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
!> and tau in TAU(i).
!>
!> See Lapack Working Note 203 for details
!>
okay so here's the β¨loreβ¨: the matrix Q is a product of elementary reflectors β Q = H(1) H(2) . . . H(k), where k = min(m,n). each H(i) has the form H(i) = I - tau * v * v**T, where tau is a real scalar and v is a real vector with v(1:i-1) = 0 and v(i) = 1; on exit, v(i+1:m) lives in A(i+1:m,i), and tau lives in TAU(i). and if you want the full deep dive, See Lapack Working Note 203 for details π
no cap, that's the entire algorithm β those reflectors stacked up, each one doing its little orthogonal dance π¦
Definition at line 133 of file sgeqr2p.f. yep, that's the receipt, that's where it lives π₯
π« Author (of this page, not the subroutine) π«
Generated automatically by Doxygen for LAPACK from the source code. so like, a robot wrote this page and i just gave it a makeover π
and that's the whole page bestie!! π this was LAPACK, Version 3.12.0, from SRC/sgeqr2p.f(3) β mwah, go factor some matrices, you're gonna slay β¨π«Άπ
π¦ 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