ungtsqr_row(3)
β¨ ungtsqr_row β bestie's guide to generating Q from latsqr π
okay so this is the man page for ungtsqr_row(3), and it's a package deal β there are four routines in here: cungtsqr_row, dorgtsqr_row, sorgtsqr_row and zungtsqr_row. One per datatype, all doing the same glow-up. Let's get into it π
πΈ NAME πΈ
ungtsqr_row β {un,or}gtsqr_row: generate Q from latsqr β¨
π¦ SYNOPSIS π¦
Functions
subroutine cungtsqr_row (m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
CUNGTSQR_ROW
subroutine dorgtsqr_row (m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
DORGTSQR_ROW
subroutine sorgtsqr_row (m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
SORGTSQR_ROW
subroutine zungtsqr_row (m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
ZUNGTSQR_ROW
β Detailed Description β
nope, there's literally no preamble here β the man page jumps straight into the function documentation, so that's exactly what we're doing too. no filler, only substance π
π§ Function Documentation π§
π subroutine cungtsqr_row (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)
CUNGTSQR_ROW
π Purpose:
so what does it actually do? CUNGTSQR_ROW generates an M-by-N complex matrix Q_out with orthonormal columns from the output of CLATSQR. These N orthonormal columns are the first N columns of a product of complex unitary matrices Q(k)_in of order M, which are returned by CLATSQR in a special format. iconic behaviour, honestly π₯
Q_out = first_N_columns_of( Q(1)_in * Q(2)_in * ... * Q(k)_in ).
The input matrices Q(k)_in are stored in row and column blocks in A. See the documentation of CLATSQR for more details on the format of Q(k)_in, where each Q(k)_in is represented by block Householder transformations. This routine calls an auxiliary routine CLARFB_GETT, where the computation is performed on each individual block. The algorithm first sweeps NB-sized column blocks from the right to left starting in the bottom row block and continues to the top row block (hence _ROW in the routine name). This sweep is in reverse order of the order in which CLATSQR generates the output blocks. no cap, that's the whole vibe π«
π«Ά Parameters
MβMis INTEGER. The number of rows of the matrixA.M >= 0.NβNis INTEGER. The number of columns of the matrixA.M >= N >= 0.MBβMBis INTEGER. The row block size used byCLATSQRto return arraysAandT.MB > N. (Note that ifMB > M, thenMis used instead ofMBas the row block size).NBβNBis INTEGER. The column block size used byCLATSQRto return arraysAandT.NB >= 1. (Note that ifNB > N, thenNis used instead ofNBas the column block size).AβAis COMPLEX array, dimension(LDA,N).
On entry:
The elements on and above the diagonal are not used as input. The elements below the diagonal represent the unit lower-trapezoidal blocked matrix V computed by CLATSQR that defines the input matrices Q_in(k) (ones on the diagonal are not stored). See CLATSQR for more details.
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βLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).TβTis COMPLEX 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
= 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 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. See CLATSQR for more details on the format of T. lowkey the most extra data structure ever and I love her π
LDTβLDTis INTEGER. The leading dimension of the arrayT.LDT >= max(1,min(NB,N)).WORKβ (workspace) COMPLEX array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORKis INTEGER. The dimension of the arrayWORK.
LWORK >= NBLOCAL * MAX(NBLOCAL,(N-NBLOCAL)),
where NBLOCAL=MIN(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 you can just ask her "how much room do you need bestie" and she'll tell you β¨
INFOβINFOis INTEGER.= 0: successful exit π< 0: ifINFO = -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 187 of file cungtsqr_row.f.
π¦ subroutine dorgtsqr_row (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)
DORGTSQR_ROW
π Purpose:
DORGTSQR_ROW generates an M-by-N real matrix Q_out with orthonormal columns from the output of DLATSQR. These N orthonormal columns are the first N columns of a product of complex unitary matrices Q(k)_in of order M, which are returned by DLATSQR in a special format. (yes, that's literally what the source says β I'm just the messenger, don't come for me π)
Q_out = first_N_columns_of( Q(1)_in * Q(2)_in * ... * Q(k)_in ).
The input matrices Q(k)_in are stored in row and column blocks in A. See the documentation of DLATSQR for more details on the format of Q(k)_in, where each Q(k)_in is represented by block Householder transformations. This routine calls an auxiliary routine DLARFB_GETT, where the computation is performed on each individual block. The algorithm first sweeps NB-sized column blocks from the right to left starting in the bottom row block and continues to the top row block (hence _ROW in the routine name). This sweep is in reverse order of the order in which DLATSQR generates the output blocks. same energy, double the precision ππ₯
π«Ά Parameters
MβMis INTEGER. The number of rows of the matrixA.M >= 0.NβNis INTEGER. The number of columns of the matrixA.M >= N >= 0.MBβMBis INTEGER. The row block size used byDLATSQRto return arraysAandT.MB > N. (Note that ifMB > M, thenMis used instead ofMBas the row block size).NBβNBis INTEGER. The column block size used byDLATSQRto return arraysAandT.NB >= 1. (Note that ifNB > N, thenNis used instead ofNBas the column block size).AβAis DOUBLE PRECISION array, dimension(LDA,N).
On entry:
The elements on and above the diagonal are not used as input. 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). See DLATSQR for more details.
On exit:
The array A contains an M-by-N orthonormal matrix Q_out, i.e the columns of A are orthogonal unit vectors. periodt π
LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).TβTis DOUBLE PRECISION 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
= 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 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. See DLATSQR for more details on the format of T. she's giving structure, she's giving compact form, she's giving main character energy π
LDTβLDTis INTEGER. The leading dimension of the arrayT.LDT >= max(1,min(NB,N)).WORKβ (workspace) DOUBLE PRECISION array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORKis INTEGER. The dimension of the arrayWORK.
LWORK >= NBLOCAL * MAX(NBLOCAL,(N-NBLOCAL)),
where NBLOCAL=MIN(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. workspace query = the "wyd later" text of linear algebra, fr fr π
INFOβINFOis INTEGER.= 0: successful exit π< 0: ifINFO = -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 187 of file dorgtsqr_row.f.
π Author
So like, the whole glow-up of this routine was a group project, and these institutions get the credit:
- 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 187 of file dorgtsqr_row.f.
β¨ subroutine sorgtsqr_row β¨
subroutine sorgtsqr_row (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)
SORGTSQR_ROW β bestie, this is the real-valued sibling. Same job, real numbers. π
π Purpose
!>
!> SORGTSQR_ROW generates an M-by-N real matrix Q_out with
!> orthonormal columns from the output of SLATSQR. These N orthonormal
!> columns are the first N columns of a product of complex unitary
!> matrices Q(k)_in of order M, which are returned by SLATSQR in
!> a special format.
!>
!> Q_out = first_N_columns_of( Q(1)_in * Q(2)_in * ... * Q(k)_in ).
!>
!> The input matrices Q(k)_in are stored in row and column blocks in A.
!> See the documentation of SLATSQR for more details on the format of
!> Q(k)_in, where each Q(k)_in is represented by block Householder
!> transformations. This routine calls an auxiliary routine SLARFB_GETT,
!> where the computation is performed on each individual block. The
!> algorithm first sweeps NB-sized column blocks from the right to left
!> starting in the bottom row block and continues to the top row block
!> (hence _ROW in the routine name). This sweep is in reverse order of
!> the order in which SLATSQR generates the output blocks.
!>
So the tea β: SLATSQR hands you a bunch of tiny orthogonal-ish building blocks shoved into A and T, and SORGTSQR_ROW is the one that actually assembles the finished Q_out. It calls the auxiliary SLARFB_GETT to do the work block by block, and it sweeps right to left, bottom row block to top row block β literally the reverse order of how SLATSQR made them. That's the _ROW in the name, iykyk. π
π Parameters
MβINTEGER, the number of rows of the matrixA.M >= 0.NβINTEGER, the number of columns of the matrixA.M >= N >= 0.MBβINTEGER, the row block size thatSLATSQRused to return the arraysAandT.MB > N. (Heads up: ifMB > M, thenMis used instead ofMBas the row block size β the routine just quietly reads the room, slay.)NBβINTEGER, the column block size thatSLATSQRused to return the arraysAandT.NB >= 1. (Same energy: ifNB > N, thenNis used instead ofNBas the column block size.)AβREALarray, dimension(LDA,N).
On entry: the elements on and above the diagonal are not used as input. The elements below the diagonal represent the unit lower-trapezoidal blocked matrix V computed by SLATSQR, which defines the input matrices Q_in(k) β and no cap, the ones on the diagonal are not stored. See SLATSQR for more details.
On exit: the array A contains an M-by-N orthonormal matrix Q_out β like, the columns of A are orthogonal unit vectors. Periodt. π
LDAβINTEGER, the leading dimension of the arrayA.LDA >= max(1,M).TβREALarray, 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
= CEIL(N/NB)
The upper-triangular block reflectors used to define the input matrices Q_in(k), k=(1:NIRB*NICB). These block reflectors live in compact form inside 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. See SLATSQR for more details on the format of T. π¦
LDTβINTEGER, the leading dimension of the arrayT.LDT >= max(1,min(NB,N)).WORKβ (workspace)REALarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. π«ΆLWORKβINTEGER, the dimension of the arrayWORK.
LWORK >= NBLOCAL * MAX(NBLOCAL,(N-NBLOCAL)),
where NBLOCAL=MIN(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. Very "just asking, not committing" of it. π
INFOβINTEGER:= 0: successful exit β¨< 0: ifINFO = -i, thei-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 187 of file sorgtsqr_row.f.
π₯ subroutine zungtsqr_row π₯
subroutine zungtsqr_row (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_ROW β and now for the complex*16 main character. π
β Purpose
!>
!> ZUNGTSQR_ROW generates an M-by-N complex matrix Q_out with
!> orthonormal columns from the output of ZLATSQR. These N orthonormal
!> columns are the first N columns of a product of complex unitary
!> matrices Q(k)_in of order M, which are returned by ZLATSQR in
!> a special format.
!>
!> Q_out = first_N_columns_of( Q(1)_in * Q(2)_in * ... * Q(k)_in ).
!>
!> The input matrices Q(k)_in are stored in row and column blocks in A.
!> See the documentation of ZLATSQR for more details on the format of
!> Q(k)_in, where each Q(k)_in is represented by block Householder
!> transformations. This routine calls an auxiliary routine ZLARFB_GETT,
!> where the computation is performed on each individual block. The
!> algorithm first sweeps NB-sized column blocks from the right to left
!> starting in the bottom row block and continues to the top row block
!> (hence _ROW in the routine name). This sweep is in reverse order of
!> the order in which ZLATSQR generates the output blocks.
!>
Exactly the same choreography as the S version, but the building blocks come from ZLATSQR, the helper is ZLARFB_GETT, and everything is COMPLEX*16. Still sweeps NB-sized column blocks right-to-left, bottom row block up to the top row block β reverse of the order ZLATSQR produced them. The _ROW stays _ROW. π
π« Parameters
MβINTEGER, the number of rows of the matrixA.M >= 0.NβINTEGER, the number of columns of the matrixA.M >= N >= 0.MBβINTEGER, the row block size used byZLATSQRto return arraysAandT.MB > N. (Note that ifMB > M, thenMis used instead ofMBas the row block size.)NBβINTEGER, the column block size used byZLATSQRto return arraysAandT.NB >= 1. (Note that ifNB > N, thenNis used instead ofNBas the column block size.)AβCOMPLEX*16array, dimension(LDA,N).
On entry: the elements on and above the diagonal are not used as input. 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). See ZLATSQR for more details.
On exit: the array A contains an M-by-N orthonormal matrix Q_out, i.e. the columns of A are orthogonal unit vectors. Ate and left no crumbs. π
LDAβINTEGER, the leading dimension of the arrayA.LDA >= max(1,M).TβCOMPLEX*16array, 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
= 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 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. See ZLATSQR for more details on the format of T. πΈ
LDTβINTEGER, the leading dimension of the arrayT.LDT >= max(1,min(NB,N)).WORKβ (workspace)COMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβINTEGER, the dimension of the arrayWORK.
LWORK >= NBLOCAL * MAX(NBLOCAL,(N-NBLOCAL)),
where NBLOCAL=MIN(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βINTEGER:= 0: successful exit π< 0: ifINFO = -i, thei-th argument had an illegal value π
πΌ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ Contributors:
biggest shoutout to the person who wrote this part of the code β putting their name on it like the icon they are:
!> November 2020, Igor Kozachenko,
!> Computer Science Division,
!> University of California, Berkeley
no cap, Berkeley's Computer Science Division really said "we'll handle the blocked Householder stuff, you go rest." π«Ά
oh and if you ever wanna go look at the actual source (you should, it's lowkey fascinating), here's exactly where it lives:
Definition at line 187 of file zungtsqr_row.f.
like, line 187, file zungtsqr_row.f, go read it bestie, it's giving main character energy β¨
π AUTHOR
Generated automatically by Doxygen for LAPACK from the source code.
so yeah β a robot wrote this page, not a human, which is honestly iconic of Doxygen. It scraped the source code and handed you the whole vibe. No cap. π€π
and that's the whole page, bestie! we made it to the end! π
this little masterpiece comes to you courtesy of LAPACK, Version 3.12.0 β the source is ungtsqr_row(3), and the credit date on the author block is November 2020. slay, thank you for coming to my TED talk, go factor some matrices responsibly π¦πβ¨
π¦ 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