SRC/dgelq.f(3)
π
SRC/dgelq.f(3) β the dgelq page, but make it make sense
okay bestie, buckle up, because this is SRC/dgelq.f from the LAPACK Library Functions Manual and it's genuinely iconic once you know what it's doing. it's the LQ factorization girlie. let's go π
β¨ NAME β¨
SRC/dgelq.f β that's the file, that's the vibe. she's a Fortran source file and she's the main character of this page. π¦
πΈ SYNOPSIS πΈ
π«Ά Functions/Subroutines
subroutine dgelq (m, n, a, lda, t, tsize, work, lwork, info)β DGELQ π«
π Function/Subroutine Documentation π
π§ subroutine dgelq (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)
DGELQ β¨
π Purpose:
!>
!> DGELQ computes an LQ factorization of a real M-by-N matrix A:
!>
!> A = ( L 0 ) * Q
!>
!> where:
!>
!> Q is a N-by-N orthogonal matrix;
!> L is a lower-triangular M-by-M matrix;
!> 0 is a M-by-(N-M) zero matrix, if M < N.
!>
!>
so basically A gets split into ( L 0 ) times Q, no cap. Q is that N-by-N orthogonal matrix, L is lower-triangular M-by-M, and that 0 block is the M-by-(N-M) zero matrix β but only if M < N. periodt. π
π Parameters
M
!> M is INTEGER
!> The number of rows of the matrix A. M >= 0.
!>
the row count, bestie. M >= 0, always. π
N
!> N is INTEGER
!> The number of columns of the matrix A. N >= 0.
!>
the column count. N >= 0, no exceptions. πΈ
A
!> A is DOUBLE PRECISION array, dimension (LDA,N)
!> On entry, the M-by-N matrix A.
!> On exit, the elements on and below the diagonal of the array
!> contain the M-by-min(M,N) lower trapezoidal matrix L
!> (L is lower triangular if M <= N);
!> the elements above the diagonal are used to store part of the
!> data structure to represent Q.
!>
lowkey the star of the show π. you hand her the M-by-N matrix on entry. on exit, everything on and below the diagonal holds the M-by-min(M,N) lower trapezoidal L (and L is lower triangular if M <= N). everything above the diagonal? that's storage for part of the data structure that represents Q. she's multitasking. π₯
LDA
!> LDA is INTEGER
!> The leading dimension of the array A. LDA >= max(1,M).
!>
leading dimension of A, and it's gotta be LDA >= max(1,M). π
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.
!>
dimension (MAX(5,TSIZE)). on exit, if INFO = 0, then T(1) returns optimal (or either minimal or optimal, if query is assumed) TSIZE β see TSIZE below for the deets. the remaining T holds part of the data structure used to represent Q. and listen π: if you wanna apply or construct Q, you have to keep T (in addition to A) and pass it to further subroutines. do not lose her. π
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).
!>
okay this one has lore π«Ά. if TSIZE >= 5, that's the dimension of the array T. if TSIZE = -1 or -2, a workspace query is assumed β the routine only calculates the sizes of the T and WORK arrays, returns those 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, she calculates the optimal size of T for the optimum performance and returns it in T(1). if TSIZE = -2, she calculates the minimal size of T and returns it in T(1). two moods, both valid. β¨
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, dimension (MAX(1,LWORK)). on exit, if INFO = 0, then WORK(1) contains optimal (or either minimal or optimal, if query was assumed) LWORK. see LWORK. π«
LWORK
!> LWORK is INTEGER
!> The dimension of the array WORK. LWORK >= 1.
!> 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).
!>
dimension of WORK, and LWORK >= 1. if LWORK = -1 or -2, a workspace query is assumed β she only calculates the sizes of the T and WORK arrays, returns those 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, she calculates the optimal size of WORK for optimal performance and returns it in WORK(1). if LWORK = -2, she calculates the minimal size of WORK and returns it in WORK(1). she's consistent like that. π
INFO
!> INFO is INTEGER
!> = 0: successful exit
!> < 0: if INFO = -i, the i-th argument had an illegal value
!>
the receipts π: = 0 means successful exit, and < 0 means if INFO = -i, the i-th argument had an illegal value. so check your args, bestie. π
β Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole squad came together for this one π«Άπ
π¦ Further Details
!>
!> The goal of the interface is to give maximum freedom to the developers for
!> creating any LQ factorization algorithm they wish. The triangular
!> (trapezoidal) L has to be stored in the lower 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 goal here? maximum freedom for devs to create any LQ factorization algorithm they want. iconic design choice. β¨ the triangular (trapezoidal) L has to live in the lower part of A, and the lower part of A plus the array T can store any relevant info for applying or constructing the Q factor. the WORK array can safely be discarded after exit β she's single-use, respect it. ποΈ
β οΈ Caution, for real: do not expect the sizes ofTandWORKto be the same from one LAPACK implementation to another, or even from one execution to another. a workspace query (forTandWORK) is needed at each execution. but for a given execution, the sizes ofTandWORKare fixed and won't change from one query to the next. so like, query every time, but don't spiral about it. π
π 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.
!>
!> 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
!> DLASWLQ or DGELQT
!>
!> Depending on the matrix dimensions M and N, and row and column
!> block sizes MB and NB returned by ILAENV, DGELQ will use either
!> DLASWLQ (if the matrix is short-and-wide) or DGELQT to compute
!> the LQ factorization.
!>
okay these are implementation-specific deets, so don't take them for granted π β they may change in the future and are not likely true for another LAPACK implementation. they're relevant if you wanna try to understand the code, but they are not part of the interface. important distinction, bestie. π
in this version:
T(2): row block size (MB)T(3): column block size (NB)T(6:TSIZE): data structure needed forQ, computed byDLASWLQorDGELQT
and depending on the matrix dimensions M and N, plus the row and column block sizes MB and NB returned by ILAENV, DGELQ will use either DLASWLQ (if the matrix is short-and-wide) or DGELQT to compute the LQ factorization. she picks the fit. π
β¨
π Definition at line 172 of file dgelq.f.
πΈ that's the whole page, bestie. she's documented end to end and she ate.
π«Ά cute little sign-off: this page was Generated automatically by Doxygen for LAPACK from the source code, and the footer vibes read LAPACK, Version 3.12.0, SRC/dgelq.f(3). bye diva πππ¦
π¦ 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