SRC/cggglm.f(3)
okay bestie, welcome to SRC/cggglm.f(3) from the Library Functions Manual β itβs giving βcomplex math, but make it a group project,β and Iβm obsessed. π
πΈ NAME πΈ
SRC/cggglm.f
β¨ SYNOPSIS β¨
π§ Functions/Subroutines π§
subroutine cggglm (n, m, p, a, lda, b, ldb, d, x, y, work, lwork, info)
CGGGLM
π¦ Function/Subroutine Documentation π¦
π subroutine cggglm π
subroutine cggglm (integer n, integer m, integer p, complex, dimension( lda,
* ) a, integer lda, complex, dimension( ldb, * ) b, integer ldb,
complex, dimension( * ) d, complex, dimension( * ) x, complex,
dimension( * ) y, complex, dimension( * ) work, integer lwork, integer
info)
CGGGLM
π Purpose π
okay so CGGGLM solves a general Gauss-Markov linear model (GLM) problem:
minimize || y ||_2 subject to d = A*x + B*y
x
where A is an N-by-M matrix, B is an N-by-P matrix, and d is a given N-vector. It is assumed that M <= N <= M+P, and
rank(A) = M and rank( A B ) = N.
Under these assumptions, the constrained equation is always consistent, and there is a unique solution x and a minimal 2-norm solution y, which is obtained using a generalized QR factorization of the matrices (A, B) given by
A = Q*(R), B = Q*T*Z.
(0)
In particular, if matrix B is square nonsingular, then the problem GLM is equivalent to the following weighted linear least squares problem
minimize || inv(B)*(d-A*x) ||_2
x
where inv(B) denotes the inverse of B.
β οΈ Callers of this subroutine should note that the singularity/rank-deficiency checks implemented in this subroutine are rudimentary. The CTRTRS 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 QR factorization of the pair (A, B) 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.
π Parameters π
NβN is INTEGER; the number of rows of the matricesAandB.N >= 0.MβM is INTEGER; the number of columns of the matrixA.0 <= M <= N.PβP is INTEGER; the number of columns of the matrixB.P >= N-M.AβA is COMPLEX array, dimension (LDA,M); on entry, theN-by-MmatrixA; on exit, the upper triangular part of the arrayAcontains theM-by-Mupper triangular matrixR.LDAβLDA is INTEGER; the leading dimension of the arrayA.LDA >= max(1,N).BβB is COMPLEX array, dimension (LDB,P); on entry, theN-by-PmatrixB; on exit, ifN <= P, the upper triangle of the subarrayB(1:N,P-N+1:P)contains theN-by-Nupper triangular matrixT; ifN > P, the elements on and above the(N-P)th subdiagonal contain theN-by-Pupper trapezoidal matrixT.LDBβLDB is INTEGER; the leading dimension of the arrayB.LDB >= max(1,N).DβD is COMPLEX array, dimension (N); on entry,Dis the left hand side of the GLM equation; on exit,Dis destroyed.XβX is COMPLEX array, dimension (M).YβY is COMPLEX array, dimension (P); on exit,XandYare the solutions of the GLM problem.WORKβWORK is COMPLEX 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,N+M+P). For optimum performance,LWORK >= M+min(N,P)+max(N,P)*NB, whereNBis an upper bound for the optimal blocksizes forCGEQRF,CGERQF,CUNMQRandCUNMRQ. 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 withAin the generalized QR factorization of the pair(A, B)is exactly singular, so thatrank(A) < M; the least squares solution could not be computed.= 2: the bottom(N-M)by(N-M)part of the upper trapezoidal factorTassociated withBin the generalized QR factorization of the pair(A, B)is exactly singular, so thatrank( A B ) < N; 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 193 of file cggglm.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
xoxo, bestie β this footer is serving LAPACK, Version 3.12.0, SRC/cggglm.f(3), and thatβs the whole page. π
π«Ά
π¦ 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