/home/abui...RC/sgelq.f(3)

πŸ“¦ version 3.12.0, in opensuse-leap 16.0

πŸ¦‹ SGELQ β€” sgelq.f(3) πŸ¦‹

okay bestie so this is a page out of the LAPACK Library Functions Manual ✨ β€” the file itself lives at /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/sgelq.f, and ngl the whole thing is literally about one iconic lil subroutine. let's get into it πŸ’…


🌸 NAME 🌸

/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/sgelq.f

like, that's the whole name. that's the file. it's giving "full government name" energy, no cap πŸŽ€


✨ SYNOPSIS ✨

Functions/Subroutines

subroutine SGELQ (m, n, a, lda, t, tsize, work, lwork, info)

SGELQ β€” that's her. that's the girl πŸ’–


πŸ‘‘ Function/Subroutine Documentation πŸ‘‘

subroutine SGELQ (integer m, integer n, real, dimension( lda, * ) a, integer
    lda, real, dimension( * ) t, integer tsize, real, dimension( * ) work,
    integer lwork, integer info)

SGELQ 🫢

⭐ Purpose ⭐

okay so real talk β€” SGELQ computes an LQ factorization of a real M-by-N matrix A, and here's the whole glow-up:

A = ( L 0 ) * Q

where, and I need you to hear me on this:

  • 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.

that's it. that's the factorization. she ate πŸ”₯


πŸŽ€ Parameters πŸŽ€

  • M β€” M is INTEGER. the number of rows of the matrix A. M >= 0. zero rows? allowed. iconic of her.
  • N β€” N is INTEGER. the number of columns of the matrix A. N >= 0. same deal, zero is a valid vibe.
  • A β€” A is REAL 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. so like, A is doing double duty, main character energy fr πŸ’…
  • LDA β€” LDA is INTEGER. the leading dimension of the array A. LDA >= max(1,M). respect the leading dimension bestie, it's not optional 🫢
  • T β€” T is REAL 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. so don't throw T away, she's part of the friend group 😭
  • TSIZE β€” TSIZE is INTEGER. here's the tea:
    • 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).
  • WORK β€” (workspace) REAL 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.
  • 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).
  • INFO β€” INFO is INTEGER
    • = 0: successful exit ✨ slay
    • < 0: if INFO = -i, the i-th argument had an illegal value πŸ’€

🧚 Author 🧚

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

the whole squad collaborated on this one, we love a group project that actually worked 🫢


🌈 Further Details 🌈

okay so the vision here:

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. so like... query every time. no shortcuts. i don't make the rules 😭

πŸ’œ 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
                 SLASWLQ or SGELQT

depending on the matrix dimensions M and N, and row and column block sizes MB and NB returned by ILAENV, SGELQ will use either SLASWLQ (if the matrix is short-and-wide) or SGELQT to compute the LQ factorization.

short-and-wide? SLASWLQ. otherwise? SGELQT. she picks her outfit based on the occasion πŸ’…βœ¨


πŸ“– Definition at line 172 of file sgelq.f. πŸ“–

like, line 172. right there. go look πŸ‘€


πŸ“ Author πŸ“

Generated automatically by Doxygen for LAPACK from the source code. (yes she was auto-generated, but the personality is all hers πŸŽ€)


LAPACK β€” Version 3.12.0

and that's the page bestie!! go forth and factorize your LQ, keep your T, query your workspace every single time, and remember: you're doing amazing sweetie πŸ’–πŸ¦‹βœ¨πŸŽ€πŸŒΈπŸ’…

πŸ“¦ where this page comes from