getsqrhrt(3)

πŸ’– NAME πŸ’–

getsqrhrt β€” and yes bestie, the manual page is literally called getsqrhrt(3) (Library Functions Manual), so that's the whole vibe. What it does: tall-skinny QR factor, with Householder reconstruction. That's it, that's the function 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

✨ Functions ✨

Four flavors, one for each letter of the alphabet you actually care about, all with the same argument list. Pick your data type and go πŸ‘‘

  • subroutine cgetsqrhrt (m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork, info) β€” the COMPLEX one, aka CGETSQRHRT
  • subroutine dgetsqrhrt (m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork, info) β€” the DOUBLE PRECISION one, aka DGETSQRHRT
  • subroutine sgetsqrhrt (m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork, info) β€” the REAL one, aka SGETSQRHRT
  • subroutine zgetsqrhrt (m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork, info) β€” the COMPLEX*16 one, aka ZGETSQRHRT

Written out long, the signatures are exactly:

subroutine cgetsqrhrt (m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork,
    info)
subroutine dgetsqrhrt (m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork,
    info)
subroutine sgetsqrhrt (m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork,
    info)
subroutine zgetsqrhrt (m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork,
    info)

πŸŽ€ Detailed Description πŸŽ€

Hi bestie, this section is just vibes and a promise: the actual details live down in Function Documentation πŸ‘‡


πŸ’œ Function Documentation πŸ’œ

⭐ cgetsqrhrt ⭐

subroutine cgetsqrhrt (integer m, integer n, integer mb1, integer nb1,
    integer nb2, complex, dimension( lda, * ) a, integer lda, complex,
    dimension( ldt, * ) t, integer ldt, complex, dimension( * ) work,
    integer lwork, integer info)

CGETSQRHRT β€” iconic name, iconic routine πŸ’…

🌸 Purpose 🌸

CGETSQRHRT computes a NB2-sized column blocked QR-factorization of a COMPLEX M-by-N matrix A with M >= N, so:

A = Q * R.

Internally it uses a NB1-sized column blocked and MB1-sized row blocked TSQR-factorization, and it performs the reconstruction of the Householder vectors from the TSQR output. It also converts the R_tsqr factor from the TSQR-factorization output into the R factor that corresponds to the Householder QR-factorization:

A = Q_tsqr * R_tsqr = Q * R.

The output Q and R factors are stored in the same format as in CGEQRT (Q is in blocked compact WY-representation). Go read the CGEQRT docs if you want the full lore on that format πŸ“š

πŸ¦‹ 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.
  • MB1 β€” MB1 is INTEGER. The row block size to be used in the blocked TSQR. MB1 > N.
  • NB1 β€” NB1 is INTEGER. The column block size to be used in the blocked TSQR. N >= NB1 >= 1.
  • NB2 β€” NB2 is INTEGER. The block size to be used in the blocked QR that is output. NB2 >= 1.
  • A β€” A is COMPLEX*16 array, dimension (LDA,N).
    • On entry: an M-by-N matrix A.
    • On exit:
      • a) the elements on and above the diagonal of the array contain the N-by-N upper-triangular matrix R corresponding to the Householder QR;
      • b) the elements below the diagonal represent Q by the columns of blocked V (compact WY-representation).
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • T β€” T is COMPLEX array, dimension (LDT,N)). The upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks.
  • LDT β€” LDT is INTEGER. The leading dimension of the array T. LDT >= NB2.
  • WORK β€” (workspace) COMPLEX array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK β€” LWORK is INTEGER. The dimension of the array WORK.

If MIN(M,N) = 0, LWORK >= 1, else

LWORK >= MAX( 1, LWT + LW1, MAX( LWT+N*N+LW2, LWT+N*N+N ) ),

where

NUM_ALL_ROW_BLOCKS = CEIL((M-N)/(MB1-N)),
NB1LOCAL = MIN(NB1,N).
LWT = NUM_ALL_ROW_BLOCKS * N * NB1LOCAL,
LW1 = NB1LOCAL * N,
LW2 = NB1LOCAL * MAX( NB1LOCAL, ( N - NB1LOCAL ) ).

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 2020, Igor Kozachenko, Computer Science Division, University of California, Berkeley

Definition at line 180 of file cgetsqrhrt.f.


⭐ dgetsqrhrt ⭐

subroutine dgetsqrhrt (integer m, integer n, integer mb1, integer nb1,
    integer nb2, double precision, dimension( lda, * ) a, integer lda,
    double precision, dimension( ldt, * ) t, integer ldt, double precision,
    dimension( * ) work, integer lwork, integer info)

DGETSQRHRT β€” same energy, double the precision πŸ“

🌸 Purpose 🌸

DGETSQRHRT computes a NB2-sized column blocked QR-factorization of a DOUBLE PRECISION M-by-N matrix A with M >= N, so:

A = Q * R.

Internally it uses a NB1-sized column blocked and MB1-sized row blocked TSQR-factorization, and it performs the reconstruction of the Householder vectors from the TSQR output. It also converts the R_tsqr factor from the TSQR-factorization output into the R factor that corresponds to the Householder QR-factorization:

A = Q_tsqr * R_tsqr = Q * R.

The output Q and R factors are stored in the same format as in DGEQRT (Q is in blocked compact WY-representation). See the documentation of DGEQRT for more details on the format πŸ“–

πŸ¦‹ 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.
  • MB1 β€” MB1 is INTEGER. The row block size to be used in the blocked TSQR. MB1 > N.
  • NB1 β€” NB1 is INTEGER. The column block size to be used in the blocked TSQR. N >= NB1 >= 1.
  • NB2 β€” NB2 is INTEGER. The block size to be used in the blocked QR that is output. NB2 >= 1.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,N).
    • On entry: an M-by-N matrix A.
    • On exit:
      • a) the elements on and above the diagonal of the array contain the N-by-N upper-triangular matrix R corresponding to the Householder QR;
      • b) the elements below the diagonal represent Q by the columns of blocked V (compact WY-representation).
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • T β€” T is DOUBLE PRECISION array, dimension (LDT,N)). The upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks.
  • LDT β€” LDT is INTEGER. The leading dimension of the array T. LDT >= NB2.
  • WORK β€” (workspace) DOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK β€” LWORK is INTEGER. The dimension of the array WORK.

If MIN(M,N) = 0, LWORK >= 1, else

LWORK >= MAX( 1, LWT + LW1, MAX( LWT+N*N+LW2, LWT+N*N+N ) ),

where

NUM_ALL_ROW_BLOCKS = CEIL((M-N)/(MB1-N)),
NB1LOCAL = MIN(NB1,N).
LWT = NUM_ALL_ROW_BLOCKS * N * NB1LOCAL,
LW1 = NB1LOCAL * N,
LW2 = NB1LOCAL * MAX( NB1LOCAL, ( N - NB1LOCAL ) ).

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 2020, Igor Kozachenko, Computer Science Division, University of California, Berkeley

Definition at line 180 of file dgetsqrhrt.f.


⭐ sgetsqrhrt ⭐

subroutine sgetsqrhrt (integer m, integer n, integer mb1, integer nb1,
    integer nb2, real, dimension( lda, * ) a, integer lda, real, dimension(
    ldt, * ) t, integer ldt, real, dimension( * ) work, integer lwork,
    integer info)

SGETSQRHRT β€” the single-precision bestie, same icon behavior 🌈

🌸 Purpose 🌸

SGETSQRHRT computes a NB2-sized column blocked QR-factorization of a COMPLEX M-by-N matrix A with M >= N, so:

A = Q * R.

Internally it uses a NB1-sized column blocked and MB1-sized row blocked TSQR-factorization, and it performs the reconstruction of the Householder vectors from the TSQR output. It also converts the R_tsqr factor from the TSQR-factorization output into the R factor that corresponds to the Householder QR-factorization:

A = Q_tsqr * R_tsqr = Q * R.

The output Q and R factors are stored in the same format as in SGEQRT (Q is in blocked compact WY-representation). See the documentation of SGEQRT for more details on the format 🧚

πŸ¦‹ Parameters πŸ¦‹

  • M β€” M is INTEGER. The number of rows of the matrix A. M >= 0.
  • N

N β€” INTEGER ✨ this is how many columns your matrix A has, and the vibe check is M >= N >= 0. No empty-columns erasure, no over-stuffed matrix, we stay in range bestie 🫢

MB1 β€” INTEGER 🌸 the row block size used in the blocked TSQR, and the rule is strict: MB1 > N. Bigger than N, or she's not coming to the party πŸ’…

NB1 β€” INTEGER πŸŽ€ the column block size used in the blocked TSQR, with N >= NB1 >= 1. Snug inside range, no cap.

NB2 β€” INTEGER πŸ¦‹ the block size used in the blocked QR that is output. NB2 >= 1. This is the one that actually shows up to the group chat, so she matters πŸ’–

A β€” REAL array, dimension (LDA,N) πŸ‘‘

  • On entry: an M-by-N matrix A. Fresh out the box.
  • On exit:
    • a) the elements on and above the diagonal of the array contain the N-by-N upper-triangular matrix R corresponding to the Householder QR 😌 iconic
    • b) the elements below the diagonal represent Q by the columns of blocked V (compact WY-representation) πŸ”₯

LDA β€” INTEGER 🌈 the leading dimension of the array A. Requirement: LDA >= max(1,M). That max(1,M) is lowkey doing the Lord's work, respect it πŸ™

T β€” REAL array, dimension (LDT,N)) πŸ’œ the upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks. Reflectors, but make it compact ✨

LDT β€” INTEGER ⭐ the leading dimension of the array T. LDT >= NB2. Just enough room for NB2 and not a crumb more.

WORK β€” (workspace) REAL array, dimension (MAX(1,LWORK)) 🧚 this is the behind-the-scenes bestie. On exit, if INFO = 0, WORK(1) returns the optimal LWORK. She's not just working, she's reporting πŸ’…

LWORK β€” INTEGER 😭 the dimension of the array WORK. The sizing is a whole thing, so buckle up:

LWORK >= MAX( 1, LWT + LW1, MAX( LWT+N*N+LW2, LWT+N*N+N ) ),
where
   NUM_ALL_ROW_BLOCKS = CEIL((M-N)/(MB1-N)),
   NB1LOCAL = MIN(NB1,N).
   LWT = NUM_ALL_ROW_BLOCKS * N * NB1LOCAL,
   LW1 = NB1LOCAL * N,
   LW2 = NB1LOCAL * MAX( NB1LOCAL, ( N - NB1LOCAL ) ).

And if MIN(M,N) = 0, then it's just LWORK >= 1 and we move on, no drama 🌸

Workspace query era: if LWORK = -1, 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. It's giving "I'll tell you how much room I need, but I won't yell at you for asking" 🫢

INFO β€” INTEGER πŸ’€ the status report:

  • = 0: successful exit πŸŽ‰ slay
  • < 0: if INFO = -i, the i-th argument had an illegal value 🚨 (this is your villain origin story, go fix argument i)

πŸ‘‘ Author

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

πŸ’ Contributors:

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

Definition at line 180 of file sgetsqrhrt.f.

πŸ’œ subroutine zgetsqrhrt β€” the COMPLEX*16 remix

Okay so you thought the real version was the whole story? Enter the complex girlies ✨ Same routine, same energy, but everything is COMPLEX*16 now.

subroutine zgetsqrhrt (integer m, integer n, integer mb1, integer nb1,
    integer nb2, complex*16, dimension( lda, * ) a, integer lda, complex*16,
    dimension( ldt, * ) t, integer ldt, complex*16, dimension( * ) work,
    integer lwork, integer info)

ZGETSQRHRT πŸ’…

🌈 Purpose:

ZGETSQRHRT computes a NB2-sized column blocked QR-factorization of a complex M-by-N matrix A with M >= N,

A = Q * R.

The routine uses internally a NB1-sized column blocked and MB1-sized row blocked TSQR-factorization and performs the reconstruction of the Householder vectors from the TSQR output πŸ”₯ The routine also converts the R_tsqr factor from the TSQR-factorization output into the R factor that corresponds to the Householder QR-factorization,

A = Q_tsqr * R_tsqr = Q * R.

The output Q and R factors are stored in the same format as in ZGEQRT (Q is in blocked compact WY-representation) πŸŽ€ See the documentation of ZGEQRT for more details on the format. iykyk πŸ’–

✨ Parameters

M β€” INTEGER 🌸 the number of rows of the matrix A. M >= 0.

N β€” INTEGER πŸ¦‹ the number of columns of the matrix A. M >= N >= 0.

MB1 β€” INTEGER πŸ’œ the row block size to be used in the blocked TSQR. MB1 > N.

NB1 β€” INTEGER ⭐ the column block size to be used in the blocked TSQR. N >= NB1 >= 1.

NB2 β€” INTEGER πŸŽ€ the block size to be used in the blocked QR that is output. NB2 >= 1.

A β€” COMPLEX*16 array, dimension (LDA,N) πŸ‘‘

  • On entry: an M-by-N matrix A.
  • On exit:
    • a) the elements on and above the diagonal of the array contain the N-by-N upper-triangular matrix R corresponding to the Householder QR
    • b) the elements below the diagonal represent Q by the columns of blocked V (compact WY-representation)

LDA β€” INTEGER 🌈 the leading dimension of the array A. LDA >= max(1,M).

T β€” COMPLEX*16 array, dimension (LDT,N)) πŸ’œ the upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks.

LDT β€” INTEGER ⭐ the leading dimension of the array T. LDT >= NB2.

WORK β€” (workspace) COMPLEX*16 array, dimension (MAX(1,LWORK)) 🧚 on exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK β€” INTEGER 😭 the dimension of the array WORK. If MIN(M,N) = 0, LWORK >= 1, else:

LWORK >= MAX( 1, LWT + LW1, MAX( LWT+N*N+LW2, LWT+N*N+N ) ),
where
   NUM_ALL_ROW_BLOCKS = CEIL((M-N)/(MB1-N)),
   NB1LOCAL = MIN(NB1,N).
   LWT = NUM_ALL_ROW_BLOCKS * N * NB1LOCAL,
   LW1 = NB1LOCAL * N,
   LW2 = NB1LOCAL * MAX( NB1LOCAL, ( N - NB1LOCAL ) ).
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 β€” 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 2020, Igor Kozachenko, Computer Science Division, University of California, Berkeley

Definition at line 180 of file zgetsqrhrt.f.

πŸ“š Author

Generated automatically by Doxygen for LAPACK from the source code πŸ’– (yes, the docs were auto-generated, and honestly? She ate.)


That's the whole page bestie 🫢 LAPACK, Version 3.12.0, getsqrhrt(3) β€” go forth and block your QR factorizations responsibly, mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from