SRC/cgelsy.f(3)
π NAME π
SRC/cgelsy.f β hey bestie, welcome to the SRC/cgelsy.f(3) page from the Library Functions Manual β¨ This is the LAPACK subroutine page for cgelsy, and itβs giving main-character linear algebra energy π
π SYNOPSIS π
π₯ Functions/Subroutines π₯
subroutine cgelsy (m, n, nrhs, a, lda, b, ldb, jpvt, rcond, rank, work,
lwork, rwork, info)
CGELSY solves overdetermined or underdetermined systems for GE
matrices
Like, CGELSY solves overdetermined or underdetermined systems for GE matrices β periodt π
π¦ Function/Subroutine Documentation π¦
subroutine cgelsy (integer m, integer n, integer nrhs, complex, dimension(
lda, * ) a, integer lda, complex, dimension( ldb, * ) b, integer ldb,
integer, dimension( * ) jpvt, real rcond, integer rank, complex,
dimension( * ) work, integer lwork, real, dimension( * ) rwork, integer
info)
Same vibe, full glow-up: CGELSY solves overdetermined or underdetermined systems for GE matrices π¦
π― Purpose π―
Okay so CGELSY computes the minimum-norm solution to a complex linear least squares problem:
minimize || A * X - B ||
using a complete orthogonal factorization of A. A is an M-by-N matrix which may be rank-deficient.
Several right hand side vectors b and solution vectors x can be handled in a single call; they are stored as the columns of the M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.
The routine first computes a QR factorization with column pivoting:
A * P = Q * [ R11 R12 ]
[ 0 R22 ]
with R11 defined as the largest leading submatrix whose estimated condition number is less than 1/RCOND. The order of R11, RANK, is the effective rank of A.
Then, R22 is considered to be negligible, and R12 is annihilated by unitary transformations from the right, arriving at the complete orthogonal factorization:
A * P = Q * [ T11 0 ] * Z
[ 0 0 ]
The minimum-norm solution is then
X = P * Z**H [ inv(T11)*Q1**H*B ]
[ 0 ]
where Q1 consists of the first RANK columns of Q.
This routine is basically identical to the original xGELSX except three differences:
- The permutation of matrix
B(the right hand side) is faster and more simple. - The call to the subroutine
xGEQPFhas been substituted by the the call to the subroutinexGEQP3. This subroutine is aBlas-3version of the QR factorization with column pivoting. - Matrix
B(the right hand side) is updated withBlas-3.
πΈ Parameters πΈ
MβM is INTEGER; the number of rows of the matrixA.M >= 0.NβN is INTEGER; the number of columns of the matrixA.N >= 0.NRHSβNRHS is INTEGER; the number of right hand sides, i.e., the number of columns of matricesBandX.NRHS >= 0.AβA is COMPLEX array, dimension (LDA,N). On entry, the M-by-N matrixA. On exit,Ahas been overwritten by details of its complete orthogonal factorization.LDAβLDA is INTEGER; the leading dimension of the arrayA.LDA >= max(1,M).BβB is COMPLEX array, dimension (LDB,NRHS). On entry, the M-by-NRHS right hand side matrixB. On exit, the N-by-NRHS solution matrixX. IfM = 0orN = 0,Bis not referenced.LDBβLDB is INTEGER; the leading dimension of the arrayB.LDB >= max(1,M,N).JPVTβJPVT is INTEGER array, dimension (N). On entry, ifJPVT(i) .ne. 0, the i-th column ofAis permuted to the front ofAP, otherwise columniis a free column. On exit, ifJPVT(i) = k, then the i-th column ofA*Pwas the k-th column ofA.RCONDβRCOND is REAL.RCONDis used to determine the effective rank ofA, which is defined as the order of the largest leading triangular submatrixR11in the QR factorization with pivoting ofA, whose estimated condition number <1/RCOND.RANKβRANK is INTEGER; the effective rank ofA, i.e., the order of the submatrixR11. This is the same as the order of the submatrixT11in the complete orthogonal factorization ofA. IfNRHS = 0,RANK = 0on output.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.
The unblocked strategy requires that:
LWORK >= MN + MAX( 2*MN, N+1, MN+NRHS )
where MN = min(M,N).
The block algorithm requires that:
LWORK >= MN + MAX( 2*MN, NB*(N+1), MN+MN*NB, MN+NB*NRHS )
where NB is an upper bound on the blocksize returned by ILAENV for the routines CGEQP3, CTZRZF, CTZRQF, CUNMQR, and CUNMRZ.
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.
RWORKβRWORK is REAL array, dimension (2*N).INFOβINFO is 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 π«Ά
- A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
- E. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain
- G. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain
Definition at line 210 of file cgelsy.f.
π§ Author π§
Generated automatically by Doxygen for LAPACK from the source code.
Okay thatβs the whole vibe π This iconic little page is from LAPACK Version 3.12.0, page SRC/cgelsy.f(3) β bye bestie, go be the main character of your own linear algebra era π
β¨
π¦ 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