SRC/zgglse.f(3)
π SRC/zgglse.f(3) π
Okay bestie, welcome to the Library Functions Manual β today's main character is SRC/zgglse.f, and the vibe is "complex linear algebra but make it cute." π«Άβ¨
π NAME π
SRC/zgglse.f β that's the file, that's the legend, no cap. π
β¨ SYNOPSIS β¨
π Functions/Subroutines π
subroutine zgglse (m, n, p, a, lda, b, ldb, c, d, x, work, lwork, info)
ZGGLSE solves overdetermined or underdetermined systems for OTHER matrices β yes, OTHER is literally in all caps, bestie. π
π¦ Function/Subroutine Documentation π¦
subroutine zgglse (integer m, integer n, integer p, complex*16, dimension(
lda, * ) a, integer lda, complex*16, dimension( ldb, * ) b, integer ldb,
complex*16, dimension( * ) c, complex*16, dimension( * ) d, complex*16,
dimension( * ) x, complex*16, dimension( * ) work, integer lwork,
integer info)
ZGGLSE solves overdetermined or underdetermined systems for OTHER matrices β she's back, still iconic, still solving. π
π Purpose π
Okay so ZGGLSE solves the linear equality-constrained least squares (LSE) problem:
minimize || c - A*x ||_2 subject to B*x = d
where A is an M-by-N matrix, B is a P-by-N matrix, c is a given M-vector, and d is a given P-vector. It is assumed that
P <= N <= M+P
and
rank(B) = P and rank( (A) ) = N.
( (B) )
These conditions ensure that the LSE problem has a unique solution, which is obtained using a generalized RQ factorization of the matrices (B, A) given by
B = (0 R)*Q, A = Z*T*Q.
π¨ Caveat time, bestie: callers of this subroutine should note that the singularity/rank-deficiency checks implemented in this subroutine are rudimentary. The ZTRTRS subroutine called by this subroutine only signals a failure due to singularity if the problem is exactly singular.
It is conceivable for one (or more) of the factors involved in the generalized RQ factorization of the pair (B, A) to be subnormally close to singularity without this subroutine signalling an error. The solutions computed for such almost-rank-deficient problems may be less accurate due to a loss of numerical precision. So like... proceed with the vibe check, okay? π
πΈ Parameters πΈ
MβM is INTEGER; it's the number of rows of the matrixA.M >= 0. πNβN is INTEGER; it's the number of columns of the matricesAandB.N >= 0. β¨PβP is INTEGER; it's the number of rows of the matrixB.0 <= P <= N <= M+P. πAβA is COMPLEX*16 array, dimension (LDA,N). On entry, theM-by-NmatrixA. On exit, the elements on and above the diagonal of the array contain themin(M,N)-by-Nupper trapezoidal matrixT. π¦LDAβLDA is INTEGER; the leading dimension of the arrayA.LDA >= max(1,M). πBβB is COMPLEX*16 array, dimension (LDB,N). On entry, theP-by-NmatrixB. On exit, the upper triangle of the subarrayB(1:P,N-P+1:N)contains theP-by-Pupper triangular matrixR. π₯LDBβLDB is INTEGER; the leading dimension of the arrayB.LDB >= max(1,P). πCβC is COMPLEX*16 array, dimension (M). On entry,Ccontains the right hand side vector for the least squares part of the LSE problem. On exit, the residual sum of squares for the solution is given by the sum of squares of elementsN-P+1toMof vectorC. πDβD is COMPLEX*16 array, dimension (P). On entry,Dcontains the right hand side vector for the constrained equation. On exit,Dis destroyed. π (RIP, but make it linear algebra.)XβX is COMPLEX*16 array, dimension (N). On exit,Xis the solution of the LSE problem. πWORKβWORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. πLWORKβLWORK is INTEGER; the dimension of the arrayWORK.LWORK >= max(1,M+N+P). For optimum performanceLWORK >= P+min(M,N)+max(M,N)*NB, whereNBis an upper bound for the optimal blocksizes forZGEQRF,CGERQF,ZUNMQRandCUNMRQ. IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. βINFOβINFO is INTEGER.= 0: successful exit. π< 0: ifINFO = -i, thei-th argument had an illegal value. π= 1: the upper triangular factorRassociated withBin the generalized RQ factorization of the pair(B, A)is exactly singular, so thatrank(B) < P; the least squares solution could not be computed. π= 2: the(N-P)by(N-P)part of the upper trapezoidal factorTassociated withAin the generalized RQ factorization of the pair(B, A)is exactly singular, so that the original's stacked notation saysrank( (A) ) < Nwith( (B) )underneath; the least squares solution could not be computed. π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 188 of file zgglse.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code. β Doxygen did its little auto-gen thing, and honestly? Slay. β¨
Signed, sealed, delivered with LAPACK Version 3.12.0 energy β footer source SRC/zgglse.f(3), footer date not printed in the source text (so no invented dates, bestie), periodt. πππ«Ά
π¦ 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