ungrq(3)
β¨ ungrq(3) β¨ β Library Functions Manual π
okay bestie, buckle up, because this whole page is about four little Fortran icons whose entire job is: take the sneaky compressed output of a ?gerqf call and expand it back into a full, gorgeous, orthonormal-rows matrix Q. it's giving "glow-up: restored edition" π
the gang's all here: cungrq, dorgrq, sorgrq, zungrq. one per data type. no cap.
πΈ NAME πΈ
ungrq β {un,or}grq: generate explicit Q from gerqf π₯
like, the {un,or} is doing so much work there β un for the complex ones, or for the real ones, iykyk.
π¦ SYNOPSIS π¦
β¨ Functions β¨
here's the whole crew in their short form, exactly as written:
subroutine cungrq (m, n, k, a, lda, tau, work, lwork, info)
CUNGRQ
subroutine dorgrq (m, n, k, a, lda, tau, work, lwork, info)
DORGRQ
subroutine sorgrq (m, n, k, a, lda, tau, work, lwork, info)
SORGRQ
subroutine zungrq (m, n, k, a, lda, tau, work, lwork, info)
ZUNGRQ
and their fully-typed, all-dressed-up versions:
subroutine cungrq (integer m, integer n, integer k, complex, dimension( lda, * ) a, integer lda, complex, dimension( * ) tau, complex, dimension( * ) work, integer lwork, integer info)
subroutine dorgrq (integer m, integer n, integer k, double precision, dimension( lda, * ) a, integer lda, double precision, dimension( * ) tau, double precision, dimension( * ) work, integer lwork, integer info)
subroutine sorgrq (integer m, integer n, integer k, real, dimension( lda, * ) a, integer lda, real, dimension( * ) tau, real, dimension( * ) work, integer lwork, integer info)
subroutine zungrq (integer m, integer n, integer k, complex*16, dimension( lda, * ) a, integer lda, complex*16, dimension( * ) tau, complex*16, dimension( * ) work, integer lwork, integer info)
π Detailed Description π
okay so this section is basically just a signpost β the actual tea is all in Function Documentation below. the descriptions here are the formal one-liners for each routine: CUNGRQ, DORGRQ, SORGRQ, ZUNGRQ.
π Function Documentation π
π§ subroutine cungrq β CUNGRQ
subroutine cungrq (integer m, integer n, integer k, complex, dimension( lda, * ) a, integer lda, complex, dimension( * ) tau, complex, dimension( * ) work, integer lwork, integer info)
π Purpose π
CUNGRQ builds an M-by-N complex matrix Q with orthonormal rows, and Q is defined as the last M rows of a product of K elementary reflectors of order N:
Q = H(1)**H H(2)**H . . . H(k)**H
exactly as returned by CGERQF. note the **H everywhere β conjugate transpose is the main character here, periodt. π
π Parameters π
Mβ M isINTEGER. the number of rows of the matrix Q.M >= 0. zero rows? valid. iconic. πNβ N isINTEGER. the number of columns of the matrix Q.N >= M. so it's a wide-ish or square-ish situation, never narrower than it is tall.Kβ K isINTEGER. the number of elementary reflectors whose product defines the matrix Q.M >= K >= 0.Aβ A isCOMPLEXarray, dimension(LDA,N).- on entry: the
(m-k+i)-th row must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned byCGERQFin the lastkrows of its array argument A. - on exit: the M-by-N matrix Q. glow-up complete β¨
- on entry: the
LDAβ LDA isINTEGER. the first dimension of the array A.LDA >= max(1,M).TAUβ TAU isCOMPLEXarray, dimension(K).TAU(i)must contain the scalar factor of the elementary reflectorH(i), as returned byCGERQF.WORKβ WORK isCOMPLEXarray, dimension(MAX(1,LWORK)). on exit, ifINFO = 0,WORK(1)returns the optimalLWORK. (she's telling you her ideal size, respect it.)LWORKβ LWORK isINTEGER. the dimension of the array WORK.LWORK >= max(1,M). for optimum performanceLWORK >= M*NB, whereNBis the optimal blocksize.
ifLWORK = -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 toLWORKis issued byXERBLA. so don't come for her when she stays quiet, she's literally just answering your question.
INFOβ INFO isINTEGER.= 0: successful exit π< 0: ifINFO = -i, the i-th argument has an illegal value π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Definition π
Definition at line 127 of file cungrq.f.
π¦ subroutine dorgrq β DORGRQ
subroutine dorgrq (integer m, integer n, integer k, double precision, dimension( lda, * ) a, integer lda, double precision, dimension( * ) tau, double precision, dimension( * ) work, integer lwork, integer info)
π Purpose π
DORGRQ builds an M-by-N real matrix Q with orthonormal rows, defined as the last M rows of a product of K elementary reflectors of order N:
Q = H(1) H(2) . . . H(k)
as returned by DGERQF. and bestie β notice there's no **H up in here. real matrices, real vibes, no conjugate transpose needed. π«Ά
π Parameters π
Mβ M isINTEGER. the number of rows of the matrix Q.M >= 0.Nβ N isINTEGER. the number of columns of the matrix Q.N >= M.Kβ K isINTEGER. the number of elementary reflectors whose product defines the matrix Q.M >= K >= 0.Aβ A isDOUBLE PRECISIONarray, dimension(LDA,N).- on entry: the
(m-k+i)-th row must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned byDGERQFin the lastkrows of its array argument A. - on exit: the M-by-N matrix Q.
- on entry: the
LDAβ LDA isINTEGER. the first dimension of the array A.LDA >= max(1,M).TAUβ TAU isDOUBLE PRECISIONarray, dimension(K).TAU(i)must contain the scalar factor of the elementary reflectorH(i), as returned byDGERQF.WORKβ WORK isDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)). on exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβ LWORK isINTEGER. the dimension of the array WORK.LWORK >= max(1,M). for optimum performanceLWORK >= M*NB, whereNBis the optimal blocksize.
ifLWORK = -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 toLWORKis issued byXERBLA.
INFOβ INFO isINTEGER.= 0: successful exit π< 0: ifINFO = -i, the i-th argument has an illegal value
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Definition π
Definition at line 127 of file dorgrq.f.
π subroutine sorgrq β SORGRQ
subroutine sorgrq (integer m, integer n, integer k, real, dimension( lda, * ) a, integer lda, real, dimension( * ) tau, real, dimension( * ) work, integer lwork, integer info)
π Purpose π
SORGRQ builds an M-by-N real matrix Q with orthonormal rows, defined as the last M rows of a product of K elementary reflectors of order N:
Q = H(1) H(2) . . . H(k)
as returned by SGERQF. single precision this time, same flawless energy. β
π Parameters π
Mβ M isINTEGER. the number of rows of the matrix Q.M >= 0.Nβ N isINTEGER. the number of columns of the matrix Q.N >= M.Kβ K isINTEGER. the number of elementary reflectors whose product defines the matrix Q.M >= K >= 0.Aβ A isREALarray, dimension(LDA,N).- on entry: the
(m-k+i)-th row must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned bySGERQFin the lastkrows of its array argument A. - on exit: the M-by-N matrix Q.
- on entry: the
LDAβ LDA isINTEGER. the first dimension of the array A.LDA >= max(1,M).TAUβ TAU isREALarray, dimension(K).TAU(i)must contain the scalar factor of the elementary reflectorH(i), as returned bySGERQF.WORKβ WORK isREALarray, dimension(MAX(1,LWORK)). on exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβ LWORK isINTEGER. the dimension of the array WORK.LWORK >= max(1,M). for optimum performanceLWORK >= M*NB, whereNBis the optimal blocksize.
ifLWORK = -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 toLWORKis issued byXERBLA.
INFOβ INFO isINTEGER.= 0: successful exit π¦< 0: ifINFO = -i, the i-th argument has an illegal value
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Definition π
Definition at line 127 of file sorgrq.f.
π subroutine zungrq β ZUNGRQ
subroutine zungrq (integer m, integer n, integer k, complex*16, dimension( lda, * ) a, integer lda, complex*16, dimension( * ) tau, complex*16, dimension( * ) work, integer lwork, integer info)
π Purpose π
ZUNGRQ builds an M-by-N complex matrix Q with orthonormal rows β the last M rows of a product of K elementary reflectors of order N, bestie:
Q = H(1)**H H(2)**H . . . H(k)**H
as returned by ZGERQF. double-complex, double-iconic, conjugate transposes absolutely everywhere. π
π Parameters π
Mβ M isINTEGER. the number of rows of the matrix Q.M >= 0.Nβ N isINTEGER. the number of columns of the matrix Q.N >= M.Kβ K isINTEGER. the number of elementary reflectors whose product defines the matrix Q.M >= K >= 0.Aβ A isCOMPLEX*16array, dimension(LDA,N).- on entry: the
(m-k+i)-th row must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned byZGERQFin the lastkrows of its array argument A. - on exit: the M-by-N matrix Q.
- on entry: the
LDAβ LDA isINTEGER. the first dimension of the array A.LDA >= max(1,M).TAUβ TAU isCOMPLEX*16array, dimension(K).TAU(i)must contain the scalar factor of the elementary reflectorH(i), as returned byZGERQF.WORKβ WORK isCOMPLEX*16array, dimension(MAX(1,LWORK)). on exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβ LWORK isINTEGERβ¦ and okay this one's got a whole saga attached, hold that thought π
LWORK πΈ
so LWORK is an INTEGER bestie, and it's literally just the dimension of the array WORK. the vibe check on it is:
LWORK >= max(1,M)β that's the bare minimum, no skipping π- for optimum performance you want
LWORK >= M*NB, whereNBis the optimal blocksize (yes she has a whole optimal blocksize, main character energy fr fr)
and now the iconic part β 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 β get this β no error message related to LWORK is issued by XERBLA. so she's not gonna yell at you for it. periodt.
INFO β¨
INFO is an INTEGER and it's your little report card π
= 0: successful exit π slay< 0: ifINFO = -i, thei-th argument has an illegal value π (so like, check your args bestie)
heads up: a negativeINFOis not a crash, it's just the routine telling you which argument it's side-eyeing. theitells you the position. iykyk.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 127 of file zungrq.f.
π«Ά Author
Generated automatically by Doxygen for LAPACK from the source code.
okay that's the whole page bestie, you're free to go π this gorgeous thing is from the LAPACK source, version 3.12.0, and it's the ungrq(3) man page β go be iconic with it π¦β¨π
π¦ 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