tpqrt(3)
π tpqrt(3) β like, the QR factor bestie, from the tpqrt family π¦
okay so this one is tpqrt(3) from the Library Functions Manual, and it is literally the QR factor situation. grab a strawberry π and let's go, because this page has four subroutines and they are all besties.
β¨ NAME β¨
tpqrt β tpqrt: QR factor. that's the whole vibe. iconic, minimal, does what it says π
πΈ SYNOPSIS πΈ
π Functions π
subroutine ctpqrt (m, n, l, nb, a, lda, b, ldb, t, ldt, work, info)β CTPQRTsubroutine dtpqrt (m, n, l, nb, a, lda, b, ldb, t, ldt, work, info)β DTPQRTsubroutine stpqrt (m, n, l, nb, a, lda, b, ldb, t, ldt, work, info)β STPQRTsubroutine ztpqrt (m, n, l, nb, a, lda, b, ldb, t, ldt, work, info)β ZTPQRT
four of them. one for each letter-flavor. that's the whole squad π«Ά
π§ Detailed Description π§
so this page is the Function Documentation home for all four (that's the section name, bestie, i'm not making it up). keep scrolling and you get the whole breakdown for each one, one at a time. and yes, the docs for each are basically twinsies β different precision, same soul β¨
π Function Documentation π
π subroutine ctpqrt (integer m, integer n, integer l, integer nb, complex, dimension( lda, * ) a, integer lda, complex, dimension( ldb, * ) b, integer ldb, complex, dimension( ldt, * ) t, integer ldt, complex, dimension( * ) work, integer info)
π CTPQRT π
Purpose:
!>
!> CTPQRT computes a blocked QR factorization of a complex
!> matrix C, which is composed of a
!> triangular block A and pentagonal block B, using the compact
!> WY representation for Q.
!>
so basically: you hand it a complex matrix C that's built out of a triangular block A plus a pentagonal block B, and it gives you a blocked QR factorization using the compact WY representation for Q. that's it. that's the whole job. no cap π
Parameters
M
!> M is INTEGER
!> The number of rows of the matrix B.
!> M >= 0.
!>
the row count of B. and look β M >= 0. no negativity allowed π
N
!> N is INTEGER
!> The number of columns of the matrix B, and the order of the
!> triangular matrix A.
!> N >= 0.
!>
column count of B and the order of the triangular matrix A β dual-purpose icon π. also N >= 0.
L
!> L is INTEGER
!> The number of rows of the upper trapezoidal part of B.
!> MIN(M,N) >= L >= 0. See Further Details.
!>
how many rows the upper trapezoidal part of B gets. constraint is MIN(M,N) >= L >= 0 β and there's a Further Details section for this one, so keep reading bestie π
NB
!> NB is INTEGER
!> The block size to be used in the blocked QR. N >= NB >= 1.
!>
the block size for the blocked QR. N >= NB >= 1. block size zero is not the move β
A
!> A is COMPLEX array, dimension (LDA,N)
!> On entry, the upper triangular N-by-N matrix A.
!> On exit, the elements on and above the diagonal of the array
!> contain the upper triangular matrix R.
!>
COMPLEX, dimension (LDA,N). goes in as the upper triangular N-by-N matrix A, comes out carrying the upper triangular matrix R on the diagonal and above. glow-up π
LDA
!> LDA is INTEGER
!> The leading dimension of the array A. LDA >= max(1,N).
!>
leading dimension of A. LDA >= max(1,N). respect the bound fr fr
B
!> B is COMPLEX array, dimension (LDB,N)
!> On entry, the pentagonal M-by-N matrix B. The first M-L rows
!> are rectangular, and the last L rows are upper trapezoidal.
!> On exit, B contains the pentagonal matrix V. See Further Details.
!>
COMPLEX, dimension (LDB,N). comes in as the pentagonal M-by-N matrix B, where the first M-L rows are rectangular and the last L rows are upper trapezoidal. leaves as the pentagonal matrix V. yes there's a Further Details section. yes you should read it π
LDB
!> LDB is INTEGER
!> The leading dimension of the array B. LDB >= max(1,M).
!>
leading dimension of B. LDB >= max(1,M). that's the rule π
T
!> T is COMPLEX array, dimension (LDT,N)
!> The upper triangular block reflectors stored in compact form
!> as a sequence of upper triangular blocks. See Further Details.
!>
COMPLEX, dimension (LDT,N). this is where the upper triangular block reflectors live, packed all compact as a sequence of upper triangular blocks. again: Further Details. go look π
LDT
!> LDT is INTEGER
!> The leading dimension of the array T. LDT >= NB.
!>
leading dimension of T. LDT >= NB. not N, bestie β NB π«Ά
WORK
!> WORK is COMPLEX array, dimension (NB*N)
!>
COMPLEX workspace, dimension (NB*N). it's giving hardworking supporting cast π
INFO
!> INFO is INTEGER
!> = 0: successful exit
!> < 0: if INFO = -i, the i-th argument had an illegal value
!>
the report card. = 0 means successful exit π. < 0 means if INFO = -i, the i-th argument had an illegal value β someone did NOT read the constraints π
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
the whole academic supergroup π«β¨
Further Details:
!>
!> The input matrix C is a (N+M)-by-N matrix
!>
!> C = [ A ]
!> [ B ]
!>
!> where A is an upper triangular N-by-N matrix, and B is M-by-N pentagonal
!> matrix consisting of a (M-L)-by-N rectangular matrix B1 on top of a L-by-N
!> upper trapezoidal matrix B2:
!>
!> B = [ B1 ] <- (M-L)-by-N rectangular
!> [ B2 ] <- L-by-N upper trapezoidal.
!>
!> The upper trapezoidal matrix B2 consists of the first L rows of a
!> N-by-N upper triangular matrix, where 0 <= L <= MIN(M,N). If L=0,
!> B is rectangular M-by-N; if M=L=N, B is upper triangular.
!>
!> The matrix W stores the elementary reflectors H(i) in the i-th column
!> below the diagonal (of A) in the (N+M)-by-N input matrix C
!>
!> C = [ A ] <- upper triangular N-by-N
!> [ B ] <- M-by-N pentagonal
!>
!> so that W can be represented as
!>
!> W = [ I ] <- identity, N-by-N
!> [ V ] <- M-by-N, same form as B.
!>
!> Thus, all of information needed for W is contained on exit in B, which
!> we call V above. Note that V has the same form as B; that is,
!>
!> V = [ V1 ] <- (M-L)-by-N rectangular
!> [ V2 ] <- L-by-N upper trapezoidal.
!>
!> The columns of V represent the vectors which define the H(i)'s.
!>
!> The number of blocks is B = ceiling(N/NB), where each
!> block is of order NB except for the last block, which is of order
!> IB = N - (B-1)*NB. For each of the B blocks, a upper triangular block
!> reflector factor is computed: T1, T2, ..., TB. The NB-by-NB (and IB-by-IB
!> for the last block) T's are stored in the NB-by-N matrix T as
!>
!> T = [T1 T2 ... TB].
!>
okay this section is a lot but it slaps, so let's walk it π
the input matrix C is a (N+M)-by-N matrix, split like:
C = [ A ]
[ B ]
where A is the upper triangular N-by-N matrix, and B is the M-by-N pentagonal matrix made of a (M-L)-by-N rectangular matrix B1 stacked on top of a L-by-N upper trapezoidal matrix B2:
B = [ B1 ] <- (M-L)-by-N rectangular
[ B2 ] <- L-by-N upper trapezoidal.
and B2? it's the first L rows of an N-by-N upper triangular matrix, with 0 <= L <= MIN(M,N). special cases bestie: if L=0, B is rectangular M-by-N; if M=L=N, B is upper triangular. slay π
the matrix W stores the elementary reflectors H(i) in the i-th column below the diagonal (of A) in the (N+M)-by-N input matrix C:
C = [ A ] <- upper triangular N-by-N
[ B ] <- M-by-N pentagonal
so W can be represented as:
W = [ I ] <- identity, N-by-N
[ V ] <- M-by-N, same form as B.
so literally all the info you need for W is sitting in B on exit β which we're calling V up there. and note that V has the exact same form as B, that is:
V = [ V1 ] <- (M-L)-by-N rectangular
[ V2 ] <- L-by-N upper trapezoidal.
the columns of V are the vectors that define the H(i)'s π¦
the number of blocks is B = ceiling(N/NB) β each block is of order NB except the last one, which is of order IB = N - (B-1)*NB. for each of the B blocks, an upper triangular block reflector factor gets computed: T1, T2, ..., TB. the NB-by-NB (and IB-by-IB for the last block) T's get stored in the NB-by-N matrix T as:
T = [T1 T2 ... TB].
packed. organized. main character energy π
Definition at line 187 of file ctpqrt.f.
π subroutine dtpqrt (integer m, integer n, integer l, integer nb, double precision, dimension( lda, * ) a, integer lda, double precision, dimension( ldb, * ) b, integer ldb, double precision, dimension( ldt, * ) t, integer ldt, double precision, dimension( * ) work, integer info)
π DTPQRT π
Purpose:
!>
!> DTPQRT computes a blocked QR factorization of a real
!> matrix C, which is composed of a
!> triangular block A and pentagonal block B, using the compact
!> WY representation for Q.
!>
same deal as CTPQRT but this one's working with a real matrix C instead of complex. triangular block A, pentagonal block B, blocked QR factorization, compact WY representation for Q. it's giving the double precision sibling and it ate π₯
Parameters
M
!> M is INTEGER
!> The number of rows of the matrix B.
!> M >= 0.
!>
rows of B. M >= 0. periodt.
N
!> N is INTEGER
!> The number of columns of the matrix B, and the order of the
!> triangular matrix A.
!> N >= 0.
!>
columns of B plus the order of A. N >= 0. multi-tasking queen π
L
!> L is INTEGER
!> The number of rows of the upper trapezoidal part of B.
!> MIN(M,N) >= L >= 0. See Further Details.
!>
rows of the upper trapezoidal part of B. MIN(M,N) >= L >= 0. Further Details is down there π
NB
!> NB is INTEGER
!> The block size to be used in the blocked QR. N >= NB >= 1.
!>
block size for the blocked QR. N >= NB >= 1. don't get cute with it π
A
!> A is DOUBLE PRECISION array, dimension (LDA,N)
!> On entry, the upper triangular N-by-N matrix A.
!> On exit, the elements on and above the diagonal of the array
!> contain the upper triangular matrix R.
!>
DOUBLE PRECISION, dimension (LDA,N). in: upper triangular N-by-N A. out: R lives on and above the diagonal. serve π
LDA
!> LDA is INTEGER
!> The leading dimension of the array A. LDA >= max(1,N).
!>
leading dimension of A. LDA >= max(1,N).
B
!> B is DOUBLE PRECISION array, dimension (LDB,N)
!> On entry, the pentagonal M-by-N matrix B. The first M-L rows
!> are rectangular, and the last L rows are upper trapezoidal.
!> On exit, B contains the pentagonal matrix V. See Further Details.
!>
DOUBLE PRECISION, dimension (LDB,N). in: pentagonal M-by-N B, first M-L rows rectangular, last L rows upper trapezoidal. out: pentagonal matrix V. and yeah β Further Details π
LDB
!> LDB is INTEGER
!> The leading dimension of the array B. LDB >= max(1,M).
!>
leading dimension of B. LDB >= 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. See Further Details.
!>
DOUBLE PRECISION, dimension (LDT,N). upper triangular block reflectors, compact form, sequence of upper triangular blocks. Further Details again, you know the drill π«Ά
LDT
!> LDT is INTEGER
!> The leading dimension of the array T. LDT >= NB.
!>
leading dimension of T. LDT >= NB.
WORK
!> WORK is DOUBLE PRECISION array, dimension (NB*N)
!>
DOUBLE PRECISION workspace, dimension (NB*N). the unpaid intern of the operation β¨
INFO
!> INFO is INTEGER
!> = 0: successful exit
!> < 0: if INFO = -i, the i-th argument had an illegal value
!>
= 0 β successful exit, we love to see it π. < 0 β INFO = -i means the i-th argument had an illegal value, so somebody fumbled a constraint π
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
same legends, same credit line π«
Further Details:
!>
!> The input matrix C is a (N+M)-by-N matrix
!>
!> C = [ A ]
!> [ B ]
!>
!> where A is an upper triangular N-by-N matrix, and B is M-by-N pentagonal
!> matrix consisting of a (M-L)-by-N rectangular matrix B1 on top of a L-by-N
!> upper trapezoidal matrix B2:
!>
!> B = [ B1 ] <- (M-L)-by-N rectangular
!> [ B2 ] <- L-by-N upper trapezoidal.
!>
!> The upper trapezoidal matrix B2 consists of the first L rows of a
!> N-by-N upper triangular matrix, where 0 <= L <= MIN(M,N). If L=0,
!> B is rectangular M-by-N; if M=L=N, B is upper triangular.
!>
!> The matrix W stores the elementary reflectors H(i) in the i-th column
!> below the diagonal (of A) in the (N+M)-by-N input matrix C
!>
!> C = [ A ] <- upper triangular N-by-N
!> [ B ] <- M-by-N pentagonal
!>
!> so that W can be represented as
!>
!> W = [ I ] <- identity, N-by-N
!> [ V ] <- M-by-N, same form as B.
!>
!> Thus, all of information needed for W is contained on exit in B, which
!> we call V above. Note that V has the same form as B; that is,
!>
!> V = [ V1 ] <- (M-L)-by-N rectangular
!> [ V2 ] <- L-by-N upper trapezoidal.
!>
!> The columns of V represent the vectors which define the H(i)'s.
!>
!> The number of blocks is B = ceiling(N/NB), where each
!> block is of order NB except for the last block, which is of order
!> IB = N - (B-1)*NB. For each of the B blocks, a upper triangular block
!> reflector factor is computed: T1, T2, ..., TB. The NB-by-NB (and IB-by-IB
!> for the last block) T's are stored in the NB-by-N matrix T as
!>
!> T = [T1 T2 ... TB].
!>
word-for-word the same story as the C version, so quick recap for the real ones π¦
C is (N+M)-by-N:
C = [ A ]
[ B ]
A is upper triangular N-by-N. B is M-by-N pentagonal, made of (M-L)-by-N rectangular B1 on top of L-by-N upper trapezoidal B2:
B = [ B1 ] <- (M-L)-by-N rectangular
[ B2 ] <- L-by-N upper trapezoidal.
B2 = first L rows of an N-by-N upper triangular matrix, 0 <= L <= MIN(M,N). if L=0, B is rectangular M-by-N; if M=L=N, B is upper triangular π
W stores the elementary reflectors H(i) in the i-th column below the diagonal (of A) in C:
C = [ A ] <- upper triangular N-by-N
[ B ] <- M-by-N pentagonal
so:
W = [ I ] <- identity, N-by-N
[ V ] <- M-by-N, same form as B.
all the info for W is in B on exit β that's our V. V matches B's form:
V = [ V1 ] <- (M-L)-by-N rectangular
[ V2 ] <- L-by-N upper trapezoidal.
columns of V = the vectors defining the H(i)'s.
blocks: B = ceiling(N/NB), each of order NB except the last, of order IB = N - (B-1)*NB. for each of the B blocks you get an upper triangular block reflector factor: T1, T2, ..., TB. and the NB-by-NB (plus IB-by-IB for the last block) T's are stored in the NB-by-N matrix T as:
T = [T1 T2 ... TB].
same icon behavior, different precision π
Definition at line 187 of file dtpqrt.f.
π subroutine stpqrt (integer m, integer n, integer l, integer nb, real, dimension( lda, * ) a, integer lda, real, dimension( ldb, * ) b, integer ldb, real, dimension( ldt, * ) t, integer ldt, real, dimension( * ) work, integer info)
π STPQRT π
Purpose:
!>
!> STPQRT computes a blocked QR factorization of a real
!> matrix C, which is composed of a
!> triangular block A and pentagonal block B, using the compact
!> WY representation for Q.
!>
and here's STPQRT β single precision real this time, but the exact same quest: blocked QR factorization of a real matrix C built from triangular block A + pentagonal block B, compact WY representation for Q. the family resemblance is strong π
(part 1 stops right here mid-STPQRT β the parameters, author, and further details for this one are coming in part 2, so don't go anywhere bestie π«Ά)
π Parameters π
Okay bestie, hereβs the parameter lineup for the real-valued stpqrt side β every constraint stays exactly where it belongs, no cap.
MβM is INTEGER. The number of rows of the matrix B. Constraint:M >= 0.NβN is INTEGER. The number of columns of the matrix B, and the order of the triangular matrix A. Constraint:N >= 0.LβL is INTEGER. The number of rows of the upper trapezoidal part of B. Constraint:MIN(M,N) >= L >= 0. See Further Details.NBβNB is INTEGER. The block size to be used in the blocked QR. Constraint:N >= NB >= 1.AβA is REAL array, dimension (LDA,N). On entry, the upper triangularN-by-Nmatrix A. On exit, the elements on and above the diagonal of the array contain the upper triangular matrix R.LDAβLDA is INTEGER. The leading dimension of the array A. Constraint:LDA >= max(1,N).BβB is REAL array, dimension (LDB,N). On entry, the pentagonalM-by-Nmatrix B. The firstM-Lrows are rectangular, and the lastLrows are upper trapezoidal. On exit, B contains the pentagonal matrix V. See Further Details.LDBβLDB is INTEGER. The leading dimension of the array B. Constraint:LDB >= max(1,M).TβT is REAL array, dimension (LDT,N). The upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks. See Further Details.LDTβLDT is INTEGER. The leading dimension of the array T. Constraint:LDT >= NB.WORKβWORK is REAL array, dimension (NB*N).INFOβINFO is 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.
π¦ Further Details π¦
The input matrix C is a (N+M)-by-N matrix:
C = [ A ]
[ B ]
where A is an upper triangular N-by-N matrix, and B is M-by-N pentagonal matrix consisting of a (M-L)-by-N rectangular matrix B1 on top of a L-by-N upper trapezoidal matrix B2:
B = [ B1 ] <- (M-L)-by-N rectangular
[ B2 ] <- L-by-N upper trapezoidal.
The upper trapezoidal matrix B2 consists of the first L rows of a N-by-N upper triangular matrix, where 0 <= L <= MIN(M,N). If L=0, B is rectangular M-by-N; if M=L=N, B is upper triangular.
The matrix W stores the elementary reflectors H(i) in the i-th column below the diagonal (of A) in the (N+M)-by-N input matrix C:
C = [ A ] <- upper triangular N-by-N
[ B ] <- M-by-N pentagonal
so that W can be represented as:
W = [ I ] <- identity, N-by-N
[ V ] <- M-by-N, same form as B.
Thus, all of information needed for W is contained on exit in B, which we call V above. Note that V has the same form as B; that is:
V = [ V1 ] <- (M-L)-by-N rectangular
[ V2 ] <- L-by-N upper trapezoidal.
The columns of V represent the vectors which define the H(i)'s.
The number of blocks is B = ceiling(N/NB), where each block is of order NB except for the last block, which is of order IB = N - (B-1)*NB. For each of the B blocks, an upper triangular block reflector factor is computed: T1, T2, ..., TB. The NB-by-NB (and IB-by-IB for the last block) T's are stored in the NB-by-N matrix T as:
T = [T1 T2 ... TB].
Definition at line 187 of file stpqrt.f.
π ztpqrt β the COMPLEX*16 glow-up π
subroutine ztpqrt (integer m, integer n, integer l, integer nb, complex*16,
dimension( lda, * ) a, integer lda, complex*16, dimension( ldb, * ) b,
integer ldb, complex*16, dimension( ldt, * ) t, integer ldt, complex*16,
dimension( * ) work, integer info)
ZTPQRT
π― Purpose π―
ZTPQRT computes a blocked QR factorization of a complex matrix C, which is composed of a triangular block A and pentagonal block B, using the compact WY representation for Q. Sheβs the complex cousin and sheβs serving the same structural fantasy.
π Parameters π
Now the COMPLEX*16 version, same stacked layout, different dtype energy.
MβM is INTEGER. The number of rows of the matrix B. Constraint:M >= 0.NβN is INTEGER. The number of columns of the matrix B, and the order of the triangular matrix A. Constraint:N >= 0.LβL is INTEGER. The number of rows of the upper trapezoidal part of B. Constraint:MIN(M,N) >= L >= 0. See Further Details.NBβNB is INTEGER. The block size to be used in the blocked QR. Constraint:N >= NB >= 1.AβA is COMPLEX*16 array, dimension (LDA,N). On entry, the upper triangularN-by-Nmatrix A. On exit, the elements on and above the diagonal of the array contain the upper triangular matrix R.LDAβLDA is INTEGER. The leading dimension of the array A. Constraint:LDA >= max(1,N).BβB is COMPLEX*16 array, dimension (LDB,N). On entry, the pentagonalM-by-Nmatrix B. The firstM-Lrows are rectangular, and the lastLrows are upper trapezoidal. On exit, B contains the pentagonal matrix V. See Further Details.LDBβLDB is INTEGER. The leading dimension of the array B. Constraint:LDB >= max(1,M).TβT is COMPLEX*16 array, dimension (LDT,N). The upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks. See Further Details.LDTβLDT is INTEGER. The leading dimension of the array T. Constraint:LDT >= NB.WORKβWORK is COMPLEX*16 array, dimension (NB*N).INFOβINFO is 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.
π¦ Further Details π¦
The input matrix C is a (N+M)-by-N matrix:
C = [ A ]
[ B ]
where A is an upper triangular N-by-N matrix, and B is M-by-N pentagonal matrix consisting of a (M-L)-by-N rectangular matrix B1 on top of a L-by-N upper trapezoidal matrix B2:
B = [ B1 ] <- (M-L)-by-N rectangular
[ B2 ] <- L-by-N upper trapezoidal.
The upper trapezoidal matrix B2 consists of the first L rows of a N-by-N upper triangular matrix, where 0 <= L <= MIN(M,N). If L=0, B is rectangular M-by-N; if M=L=N, B is upper triangular.
The matrix W stores the elementary reflectors H(i) in the i-th column below the diagonal (of A) in the (N+M)-by-N input matrix C:
C = [ A ] <- upper triangular N-by-N
[ B ] <- M-by-N pentagonal
so that W can be represented as:
W = [ I ] <- identity, N-by-N
[ V ] <- M-by-N, same form as B.
Thus, all of information needed for W is contained on exit in B, which we call V above. Note that V has the same form as B; that is:
V = [ V1 ] <- (M-L)-by-N rectangular
[ V2 ] <- L-by-N upper trapezoidal.
The columns of V represent the vectors which define the H(i)'s.
The number of blocks is B = ceiling(N/NB), where each block is of order NB except for the last block, which is of order IB = N - (B-1)*NB. For each of the B blocks, an upper triangular block reflector factor is computed: T1, T2, ..., TB. The NB-by-NB (and IB-by-IB for the last block) T's are stored in the NB-by-N matrix T as:
T = [T1 T2 ... TB].
Definition at line 187 of file ztpqrt.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
Catch you later, bestie β this page is from LAPACK Version 3.12.0, page tpqrt(3) π
β¨
π¦ 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