/home/abui...RC/dgeqr.f(3)
π dgeqr.f β DGEQR, aka the QR factorization glow-up
okay bestie, so this page is from the LAPACK Library Functions Manual, and it's the doc for /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/dgeqr.f. Yes the path is a whole novel, we don't talk about it π. It's a Fortran source file, it lives in SRC/, and this page is literally just the Doxygen-generated docs for one subroutine. One. Subroutine. And she ate.
πΈ NAME πΈ
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/dgeqr.f
that's it. that's the name. it's giving "my parents named me after the street they lived on" π
β¨ SYNOPSIS β¨
Functions/Subroutines
subroutine DGEQR (m, n, a, lda, t, tsize, work, lwork, info)β DGEQR
okay so there's exactly one (1) subroutine here and her name is DGEQR, and the synopsis is just... her name again. iconic behaviour honestly.
π¦ Function/Subroutine Documentation π¦
subroutine DGEQR (integer m, integer n, double precision, dimension( lda, * ) a, integer lda, double precision, dimension( * ) t, integer tsize, double precision, dimension( * ) work, integer lwork, integer info)
DGEQR β¨ (yes she's named twice, she's confident like that)
π Purpose π
!> !> DGEQR 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; !> 0 is a (M-N)-by-N zero matrix, if M > N. !> !>
so basically: you hand her a real M-by-N matrix A, and she breaks it down into Q (an M-by-M orthogonal matrix, main character energy) times the stacked thing of R (upper-triangular, N-by-N, a classic) on top of 0 (a (M-N)-by-N zero matrix, only shows up if M > N, no cap). slay π
π Parameters π
M
!> M is INTEGER !> The number of rows of the matrix A. M >= 0. !>
the row count bestie. it's an INTEGER. and M >= 0 β zero rows is allowed, we don't discriminate π«Ά
N
!> N is INTEGER !> The number of columns of the matrix A. N >= 0. !>
the column count. also INTEGER. also N >= 0. equality.
A
!> A is DOUBLE PRECISION 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 elements below the diagonal are used to store part of the !> data structure to represent Q. !>
okay this one's a double agent and I respect it. A is a DOUBLE PRECISION array, dimension (LDA,N).
- on entry: she's just the M-by-N matrix
A, innocent, minding her business. - on exit: transformation arc π« the elements on and above the diagonal now hold the
min(M,N)-by-N upper trapezoidal matrixR(andRis upper triangular ifM >= Nβ cute). - the elements below the diagonal? they get repurposed to store part of the data structure that represents
Q. she's multitasking, she contains multitudes.
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). respect the leading dimension or suffer π€
T
!> T is DOUBLE PRECISION array, dimension (MAX(5,TSIZE)) !> On exit, if INFO = 0, T(1) returns optimal (or either minimal !> or optimal, if query is assumed) TSIZE. See TSIZE for details. !> Remaining T contains part of the data structure used to represent Q. !> If one wants to apply or construct Q, then one needs to keep T !> (in addition to A) and pass it to further subroutines. !>
T is a DOUBLE PRECISION array, dimension (MAX(5,TSIZE)). on exit, if INFO = 0, then T(1) hands you back the optimal TSIZE (or either minimal or optimal, if a query is assumed β go read the TSIZE section bestie, I linked it in spirit). the rest of T contains part of the data structure used to represent Q. and like β if you wanna apply or construct Q, you gotta keep T (alongside A) and pass it along to further subroutines. she's not a one-night-stand subroutine, she needs commitment π«Ά
TSIZE
!> TSIZE is INTEGER !> If TSIZE >= 5, the dimension of the array T. !> If TSIZE = -1 or -2, then a workspace query is assumed. The routine !> only calculates the sizes of the T and WORK arrays, returns these !> values as the first entries of the T and WORK arrays, and no error !> message related to T or WORK is issued by XERBLA. !> If TSIZE = -1, the routine calculates optimal size of T for the !> optimum performance and returns this value in T(1). !> If TSIZE = -2, the routine calculates minimal size of T and !> returns this value in T(1). !>
TSIZE is INTEGER, and she has β¨modesβ¨:
- if
TSIZE >= 5: that's the dimension of the arrayT. simple. we love a straightforward queen. - if
TSIZE = -1orTSIZE = -2: workspace query time babes π the routine only calculates the sizes of theTandWORKarrays, returns those values as the first entries of theTandWORKarrays, and β key detail β no error message related toTorWORKis issued by XERBLA. she's being polite, don't make it weird. - if
TSIZE = -1: she calculates the optimal size ofTfor optimum performance and returns that value inT(1). treat yourself π - if
TSIZE = -2: she calculates the minimal size ofTand returns it inT(1). budget era πΈ
WORK
!> (workspace) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) !> On exit, if INFO = 0, WORK(1) contains optimal (or either minimal !> or optimal, if query was assumed) LWORK. !> See LWORK for details. !>
the (workspace) DOUBLE PRECISION array, dimension (MAX(1,LWORK)). on exit, if INFO = 0, WORK(1) contains the optimal LWORK (or either minimal or optimal, if a query was assumed). she's the scratch pad, and per the further details below, she can safely be discarded after exit β no strings attached π¦
LWORK
!> LWORK is INTEGER !> The dimension of the array WORK. !> If LWORK = -1 or -2, then a workspace query is assumed. The routine !> only calculates the sizes of the T and WORK arrays, returns these !> values as the first entries of the T and WORK arrays, and no error !> message related to T or WORK is issued by XERBLA. !> If LWORK = -1, the routine calculates optimal size of WORK for the !> optimal performance and returns this value in WORK(1). !> If LWORK = -2, the routine calculates minimal size of WORK and !> returns this value in WORK(1). !>
LWORK is INTEGER, dimension of the array WORK, and she mirrors TSIZE's whole vibe:
- if
LWORK = -1orLWORK = -2: workspace query assumed. she only calculates the sizes of theTandWORKarrays, returns them as the first entries of theTandWORKarrays, and again, no error message related toTorWORKis issued by XERBLA. consistency, we stan. - if
LWORK = -1: optimal size ofWORKfor optimal performance, returned inWORK(1). the deluxe package β¨ - if
LWORK = -2: minimal size ofWORK, returned inWORK(1). the starter pack π
INFO
!> INFO is INTEGER !> = 0: successful exit !> < 0: if INFO = -i, the i-th argument had an illegal value !>
INFO is INTEGER, the vibe check at the end:
= 0: successful exit π she did it, no notes.< 0: ifINFO = -i, then the i-th argument had an illegal value. somebody passed her something cursed and she's pointing at the culprit, respectfully π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole squad. four institutions, one subroutine. group project that actually worked, imagine π
π Further Details π
!> !> The goal of the interface is to give maximum freedom to the developers for !> creating any QR factorization algorithm they wish. The triangular !> (trapezoidal) R has to be stored in the upper part of A. The lower part of A !> and the array T can be used to store any relevant information for applying or !> constructing the Q factor. The WORK array can safely be discarded after exit. !> !> Caution: One should not expect the sizes of T and WORK to be the same from one !> LAPACK implementation to the other, or even from one execution to the other. !> A workspace query (for T and WORK) is needed at each execution. However, !> for a given execution, the size of T and WORK are fixed and will not change !> from one query to the next. !> !>
the whole point of this interface is maximum freedom for the developers to create literally any QR factorization algorithm they want. no rules, just vibes (and a spec). the triangular (trapezoidal) R has to live in the upper part of A β that's non-negotiable. the lower part of A and the array T are fair game for storing whatever relevant info you need for applying or constructing the Q factor. and the WORK array can safely be discarded after exit β she's fine, she's thriving, let her go π¦
β οΈ Caution bestie, this one matters: one should not expect the sizes ofTandWORKto be the same from one LAPACK implementation to the other, or even from one execution to the other. a workspace query (forTandWORK) is needed at each execution. however, for a given execution, the sizes ofTandWORKare fixed and will not change from one query to the next. so like, query every time, but also don't panic, it's stable within one run. iykyk π«Ά
π§ Further Details particular to this LAPACK implementation π§
!> !> These details are particular for this LAPACK implementation. Users should not !> take them for granted. These details may change in the future, and are not likely !> true for another LAPACK implementation. These details are relevant if one wants !> to try to understand the code. They are not part of the interface. !>
okay so this next section is implementation tea, not interface tea. read the disclaimer bestie: these details are particular to this LAPACK implementation, users should not take them for granted, they may change in the future, and they're not likely true for another LAPACK implementation. they're relevant only if you wanna actually understand the code. they are not part of the interface. periodt.
!> In this version, !> !> T(2): row block size (MB) !> T(3): column block size (NB) !> T(6:TSIZE): data structure needed for Q, computed by !> DLATSQR or DGEQRT !>
in this version:
T(2): row block size (MB)T(3): column block size (NB)T(6:TSIZE): the data structure needed forQ, computed byDLATSQRorDGEQRT
!> Depending on the matrix dimensions M and N, and row and column !> block sizes MB and NB returned by ILAENV, DGEQR will use either !> DLATSQR (if the matrix is tall-and-skinny) or DGEQRT to compute !> the QR factorization. !> !>
and depending on the matrix dimensions M and N, plus the row and column block sizes MB and NB returned by ILAENV, DGEQR will pick either DLATSQR (when the matrix is tall-and-skinny, we love a slim legend) or DGEQRT to compute the QR factorization. she chooses her fighter based on the shape of the matrix. adaptability π
β Definition β
Definition at line 174 of file dgeqr.f.
line one-seven-four. mark it. underline it. get it tattooed honestly.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
yes bestie, a robot wrote this page, not a human, and she still served more personality than half the docs out there. Doxygen said "here's your documentation" and LAPACK said "periodt".
okay that's the whole page!! to summarise the vibe: DGEQR takes your A, gives you back R up top and Q-data down below, wants you to keep T around forever, lets WORK go free, and will absolutely yell at you via INFO if you pass her a bad argument. also query your workspace sizes every single execution, no cap. ily, go factor some matrices πβ¨π
LAPACK β Version 3.12.0 β /home/abui...RC/dgeqr.f(3) β mwah, that's the sign-off, drink some water and cite your sources π«Άπ
π¦ 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