ungtsqr(3)

πŸ¦‹ NAME πŸ¦‹

okay so this is ungtsqr β€” that's ungtsqr(3), straight out of the Library Functions Manual, bestie πŸ’… β€” and it does one iconic job:

ungtsqr - {un,or}gtsqr: generate Q from latsqr

that's it, that's the whole vibe. it takes the stuff latsqr left behind and hands you the Q matrix. slay. ✨


✨ SYNOPSIS ✨

πŸŽ€ Functions

here's the whole squad, all four flavours, same exact signature energy:

subroutine cungtsqr (m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
    CUNGTSQR
subroutine dorgtsqr (m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
    DORGTSQR
subroutine sorgtsqr (m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
    SORGTSQR
subroutine zungtsqr (m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
    ZUNGTSQR
  • cungtsqr β€” CUNGTSQR, the COMPLEX one πŸ’œ
  • dorgtsqr β€” DORGTSQR, the DOUBLE PRECISION one πŸ’™
  • sorgtsqr β€” SORGTSQR, the REAL one πŸ’š
  • zungtsqr β€” ZUNGTSQR, the Z one, showing up last like the main character it is πŸ‘‘

πŸ”₯ Detailed Description πŸ”₯

(the original page literally has this heading with nothing under it. iconic minimalism honestly. nothing to report, moving on 🫢)


πŸ‘‘ Function Documentation πŸ‘‘

πŸ’… CUNGTSQR

subroutine cungtsqr (integer m, integer n, integer mb, integer nb, complex,
    dimension( lda, * ) a, integer lda, complex, dimension( ldt, * ) t,
    integer ldt, complex, dimension( * ) work, integer lwork, integer info)

🌸 Purpose

so what does it actually do? it generates an M-by-N complex matrix Q_out with orthonormal columns β€” and those columns are the first N columns of a product of complex unitary matrices of order M, the ones that CLATSQR handed back. the whole thing, verbatim:

!>
!> CUNGTSQR generates an M-by-N complex matrix Q_out with orthonormal
!> columns, which are the first N columns of a product of comlpex unitary
!> matrices of order M which are returned by CLATSQR
!>
!>      Q_out = first_N_columns_of( Q(1)_in * Q(2)_in * ... * Q(k)_in ).
!>
!> See the documentation for CLATSQR.
!>
(yes, "comlpex" is in the original. i'm not touching it. it's part of the lore now 😭)

πŸ’– Parameters

  • M β€” M is INTEGER. the number of rows of the matrix A. M >= 0.
  • N β€” N is INTEGER. the number of columns of the matrix A. M >= N >= 0.
  • MB β€” MB is INTEGER. the row block size that CLATSQR used to return the arrays A and T. MB > N. (heads up: if MB > M, then M is used instead of MB as the row block size.)
  • NB β€” NB is INTEGER. the column block size that CLATSQR used to return the arrays A and T. NB >= 1. (heads up again: if NB > N, then N is used instead of NB as the column block size.)
  • A β€” A is COMPLEX array, dimension (LDA,N).

On entry: the elements on and above the diagonal are simply not accessed. the elements below the diagonal represent the unit lower-trapezoidal blocked matrix V computed by CLATSQR that defines the input matrices Q_in(k) β€” and ngl, the ones on the diagonal are not stored. (same format as the output A below the diagonal in CLATSQR.)

On exit: A now contains an M-by-N orthonormal matrix Q_out, i.e. the columns of A are orthogonal unit vectors. glow up complete ✨

  • LDA β€” LDA is INTEGER. the leading dimension of the array A. LDA >= max(1,M).
  • T β€” T is COMPLEX array, dimension (LDT, N * NIRB), where:
NIRB = Number_of_input_row_blocks
     = MAX( 1, CEIL((M-N)/(MB-N)) )

and let

NICB = Number_of_input_col_blocks
     = CEIL(N/NB)

T holds the upper-triangular block reflectors used to define the input matrices Q_in(k), where k=(1:NIRB*NICB). the block reflectors are stored in compact form in NIRB block reflector sequences β€” each of those NIRB block reflector sequences lives in a larger NB-by-N column block of T, and consists of NICB smaller NB-by-NB upper-triangular column blocks. (same format as the output T in CLATSQR.)

  • LDT β€” LDT is INTEGER. the leading dimension of the array T. LDT >= max(1,min(NB1,N)).
  • WORK β€” (workspace) COMPLEX array, dimension (MAX(2,LWORK)). on exit, if INFO = 0, WORK(1) returns the optimal LWORK. 🫢
  • LWORK β€” LWORK is INTEGER. the dimension of the array WORK. LWORK >= (M+NB)*N. if LWORK = -1, then a workspace query is assumed β€” the routine only calculates the optimal size of the WORK array, returns that value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. so cute of it.
  • INFO β€” INFO is INTEGER.
    • = 0: successful exit πŸŽ‰
    • < 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.

πŸ“ Contributors

!>
!> November 2019, Igor Kozachenko,
!>                Computer Science Division,
!>                University of California, Berkeley
!>
!>

Definition at line 174 of file cungtsqr.f.


πŸ‘‘ DORGTSQR

subroutine dorgtsqr (integer m, integer n, integer mb, integer nb, double
    precision, dimension( lda, * ) a, integer lda, double precision,
    dimension( ldt, * ) t, integer ldt, double precision, dimension( * )
    work, integer lwork, integer info)

πŸ’™ Purpose

same mission, real numbers this time: it generates an M-by-N real matrix Q_out with orthonormal columns, which are the first N columns of a product of real orthogonal matrices of order M returned by DLATSQR. verbatim:

!>
!> DORGTSQR generates an M-by-N real matrix Q_out with orthonormal columns,
!> which are the first N columns of a product of real orthogonal
!> matrices of order M which are returned by DLATSQR
!>
!>      Q_out = first_N_columns_of( Q(1)_in * Q(2)_in * ... * Q(k)_in ).
!>
!> See the documentation for DLATSQR.
!>

πŸ’– Parameters

  • M β€” M is INTEGER. the number of rows of the matrix A. M >= 0.
  • N β€” N is INTEGER. the number of columns of the matrix A. M >= N >= 0.
  • MB β€” MB is INTEGER. the row block size used by DLATSQR to return arrays A and T. MB > N. (note: if MB > M, then M is used instead of MB as the row block size.)
  • NB β€” NB is INTEGER. the column block size used by DLATSQR to return arrays A and T. NB >= 1. (note: if NB > N, then N is used instead of NB as the column block size.)
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,N).

On entry: the elements on and above the diagonal are not accessed. the elements below the diagonal represent the unit lower-trapezoidal blocked matrix V computed by DLATSQR that defines the input matrices Q_in(k) (ones on the diagonal are not stored) (same format as the output A below the diagonal in DLATSQR).

On exit: the array A contains an M-by-N orthonormal matrix Q_out, i.e. the columns of A are orthogonal unit vectors.

  • LDA β€” LDA is INTEGER. the leading dimension of the array A. LDA >= max(1,M).
  • T β€” T is DOUBLE PRECISION array, dimension (LDT, N * NIRB), where:
NIRB = Number_of_input_row_blocks
     = MAX( 1, CEIL((M-N)/(MB-N)) )

and let

NICB = Number_of_input_col_blocks
     = CEIL(N/NB)

T holds the upper-triangular block reflectors used to define the input matrices Q_in(k), k=(1:NIRB*NICB). the block reflectors are stored in compact form in NIRB block reflector sequences. each of the NIRB block reflector sequences is stored in a larger NB-by-N column block of T and consists of NICB smaller NB-by-NB upper-triangular column blocks. (same format as the output T in DLATSQR.)

  • LDT β€” LDT is INTEGER. the leading dimension of the array T. LDT >= max(1,min(NB1,N)).
  • WORK β€” (workspace) DOUBLE PRECISION array, dimension (MAX(2,LWORK)). on exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK β€” LWORK is INTEGER. the dimension of the array WORK. LWORK >= (M+NB)*N. 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.
  • INFO β€” INFO is INTEGER.
    • = 0: successful exit
    • < 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.

πŸ“ Contributors

!>
!> November 2019, Igor Kozachenko,
!>                Computer Science Division,
!>                University of California, Berkeley
!>
!>

Definition at line 174 of file dorgtsqr.f.


πŸ‘‘ SORGTSQR

subroutine sorgtsqr (integer m, integer n, integer mb, integer nb, real,
    dimension( lda, * ) a, integer lda, real, dimension( ldt, * ) t, integer
    ldt, real, dimension( * ) work, integer lwork, integer info)

πŸ’š Purpose

real-numbers edition, single precision, still eating: it generates an M-by-N real matrix Q_out with orthonormal columns, which are the first N columns of a product of real orthogonal matrices of order M returned by SLATSQR. here it is verbatim:

!>
!> SORGTSQR generates an M-by-N real matrix Q_out with orthonormal columns,
!> which are the first N columns of a product of real orthogonal
!> matrices of order M which are returned by SLATSQR
!>
!>      Q_out = first_N_columns_of( Q(1)_in * Q(2)_in * ... * Q(k)_in ).
!>
!> See the documentation for SLATSQR.
!>

πŸ’– Parameters

  • M β€” M is INTEGER. the number of rows of the matrix A. M >= 0.
  • N β€” N is INTEGER. the number of columns of the matrix A. M >= N >= 0.
  • MB β€” MB is INTEGER. the row block size used by SLATSQR to return arrays A and T. MB > N. (note: if MB > M, then M is used instead of MB as the row block size).
  • NB
  • NB β€” INTEGER, the column block size that SLATSQR used to hand back arrays A and T. Bestie, listen: NB >= 1. And heads up β€” if NB > N, then N gets used instead of NB as the column block size. The routine just quietly does that. iykyk. πŸŽ€
  • A β€” REAL array, dimension (LDA,N).

On entry:

  • The elements on and above the diagonal are not accessed. Not even a little peek. πŸ™ˆ
  • The elements below the diagonal represent the unit lower-trapezoidal blocked matrix V computed by SLATSQR that defines the input matrices Q_in(k) (ones on the diagonal are not stored) (same format as the output A below the diagonal in SLATSQR).

On exit:

  • The array A contains an M-by-N orthonormal matrix Q_out, i.e the columns of A are orthogonal unit vectors. iconic behaviour, honestly ✨
  • LDA β€” INTEGER, the leading dimension of the array A. LDA >= max(1,M). No notes, just vibes and a hard lower bound πŸ’…
  • T β€” REAL array, dimension (LDT, N * NIRB) where
NIRB = Number_of_input_row_blocks
     = MAX( 1, CEIL((M-N)/(MB-N)) )

and let NICB = Number_of_input_col_blocks

NICB = CEIL(N/NB)

This is the home of the upper-triangular block reflectors used to define the input matrices Q_in(k), k=(1:NIRB*NICB). The block reflectors are stored in compact form in NIRB block reflector sequences. Each of the NIRB block reflector sequences is stored in a larger NB-by-N column block of T and consists of NICB smaller NB-by-NB upper-triangular column blocks. (same format as the output T in SLATSQR). It's giving nested boxes, it's giving matryoshka, it's giving compactly stored 🎁

  • LDT β€” INTEGER, the leading dimension of the array T. LDT >= max(1,min(NB1,N)). copy that boundary exactly, bestie, don't get creative with it 🫢
  • WORK β€” (workspace) REAL array, dimension (MAX(2,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. The workspace is snitching on itself and honestly? We love a self-aware array ⭐
  • LWORK β€” INTEGER, the dimension of the array WORK. LWORK >= (M+NB)*N. 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. So -1 is the "just tell me how much room I need" era, no scolding from XERBLA πŸ’€
  • INFO β€” INTEGER.
    • = 0: successful exit 🌸
    • < 0: if INFO = -i, the i-th argument had an illegal value. Somebody fumbled the bag at position i 😭

Author

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

Contributors:

November 2019, Igor Kozachenko, Computer Science Division, University of California, Berkeley

Definition at line 174 of file sorgtsqr.f. yes, sorgtsqr.f, line 174, we said what we said πŸ“


zungtsqr β€” the COMPLEX*16 sibling πŸ’œ

Look at her. Same routine, but make it complex.
subroutine zungtsqr (integer m, integer n, integer mb, integer nb,
    complex*16, dimension( lda, * ) a, integer lda, complex*16, dimension(
    ldt, * ) t, integer ldt, complex*16, dimension( * ) work, integer lwork,
    integer info)

ZUNGTSQR

Purpose:

ZUNGTSQR generates an M-by-N complex matrix Q_out with orthonormal columns, which are the first N columns of a product of complex unitary matrices of order M which are returned by ZLATSQR

Q_out = first_N_columns_of( Q(1)_in * Q(2)_in * ... * Q(k)_in ).

See the documentation for ZLATSQR. Go read it, bestie, it's the whole backstory 🌈

Parameters

  • M β€” INTEGER, the number of rows of the matrix A. M >= 0. Zero is allowed, she's flexible like that 😌
  • N β€” INTEGER, the number of columns of the matrix A. M >= N >= 0. Sandwich constraint, no notes ✨
  • MB β€” INTEGER, the row block size used by ZLATSQR to return arrays A and T. MB > N. (Note that if MB > M, then M is used instead of MB as the row block size). Same cute little substitution deal as always πŸŽ€
  • NB β€” INTEGER, the column block size used by ZLATSQR to return arrays A and T. NB >= 1. (Note that if NB > N, then N is used instead of NB as the column block size). She's not going to use a block size bigger than the whole matrix, be serious πŸ™ˆ
  • A β€” COMPLEX*16 array, dimension (LDA,N).

On entry:

  • The elements on and above the diagonal are not accessed. Untouched. Ignored. Not her business πŸ’…
  • The elements below the diagonal represent the unit lower-trapezoidal blocked matrix V computed by ZLATSQR that defines the input matrices Q_in(k) (ones on the diagonal are not stored) (same format as the output A below the diagonal in ZLATSQR).

On exit:

  • The array A contains an M-by-N orthonormal matrix Q_out, i.e the columns of A are orthogonal unit vectors. she ate and left no crumbs πŸ”₯
  • LDA β€” INTEGER, the leading dimension of the array A. LDA >= max(1,M). Respect the bound 🫢
  • T β€” COMPLEX*16 array, dimension (LDT, N * NIRB) where
NIRB = Number_of_input_row_blocks
     = MAX( 1, CEIL((M-N)/(MB-N)) )

Let NICB = Number_of_input_col_blocks

NICB = CEIL(N/NB)

The upper-triangular block reflectors used to define the input matrices Q_in(k), k=(1:NIRB*NICB). The block reflectors are stored in compact form in NIRB block reflector sequences. Each of NIRB block reflector sequences is stored in a larger NB-by-N column block of T and consists of NICB smaller NB-by-NB upper-triangular column blocks. (same format as the output T in ZLATSQR). Same nesting, same drama, now with complex numbers πŸ¦‹

  • LDT β€” INTEGER, the leading dimension of the array T. LDT >= max(1,min(NB1,N)). Again β€” NB1, exactly like that, do not touch 🎯
  • WORK β€” (workspace) COMPLEX*16 array, dimension (MAX(2,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. She tells you what she needs upfront, queen behaviour πŸ‘‘
  • LWORK β€” INTEGER, the dimension of the array WORK. LWORK >= (M+NB)*N. 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. Query mode = zero judgment from XERBLA, we stan 🧚
  • INFO β€” INTEGER.
    • = 0: successful exit ⭐
    • < 0: if INFO = -i, the i-th argument had an illegal value. Argument i is in trouble, not you, probably 😭

Author

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

Contributors:

November 2019, Igor Kozachenko, Computer Science Division, University of California, Berkeley

Definition at line 174 of file zungtsqr.f. line 174 again β€” poetic symmetry, lowkey obsessed πŸ“


Author

Generated automatically by Doxygen for LAPACK from the source code. Not a human, not a vibe curator, just Doxygen doing Doxygen things πŸ€–βœ¨


And that's the whole page, bestie β€” this was LAPACK, Version 3.12.0, the ungtsqr(3) manual page, dated the way the footer says it. Go forth and generate your orthonormal columns. Periodt. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from