SRC/sgelsy.f(3)
π¦ SRC/sgelsy.f(3) β Library Functions Manual π¦
okay bestie, this is the whole page for sgelsy, straight from the Library Functions Manual vibe β and yes, itβs giving βLAPACK but make it group chat.β π
β¨ NAME β¨
SRC/sgelsy.f
π SYNOPSIS π
π Functions/Subroutines π
subroutine sgelsy (m, n, nrhs, a, lda, b, ldb, jpvt, rcond, rank, work, lwork, info)β SGELSY solves overdetermined or underdetermined systems for GE matrices
π§ Function/Subroutine Documentation π§
π subroutine sgelsy π
subroutine sgelsy (integer m, integer n, integer nrhs, real, dimension( lda,
* ) a, integer lda, real, dimension( ldb, * ) b, integer ldb, integer,
dimension( * ) jpvt, real rcond, integer rank, real, dimension( * )
work, integer lwork, integer info)
SGELSY solves overdetermined or underdetermined systems for GE matrices π
π₯ Purpose π₯
okay so SGELSY computes the minimum-norm solution to a real 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. No cap.
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 orthogonal 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**T [ inv(T11)*Q1**T*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 call to the subroutine
xGEQPFhas been substituted by the call to the subroutinexGEQP3. This subroutine is a Blas-3 version of the QR factorization with column pivoting. - Matrix
B(the right hand side) is updated with Blas-3. - The permutation of matrix
B(the right hand side) is faster and more simple.
π 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 REAL array, dimension (LDA,N). On entry, theM-by-NmatrixA. 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 REAL array, dimension (LDB,NRHS). On entry, theM-by-NRHSright hand side matrixB. On exit, theN-by-NRHSsolution 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, thei-th column ofAis permuted to the front ofAP, otherwise columniis a free column. On exit, ifJPVT(i) = k, then thei-th column ofAPwas thek-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 REAL 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 >= MAX( MN+3*N+1, 2*MN+NRHS ),whereMN = min( M, N ). The block algorithm requires that:LWORK >= MAX( MN+2*N+NB*(N+1), 2*MN+NB*NRHS ),whereNBis an upper bound on the blocksize returned byILAENVfor the routinesSGEQP3,STZRZF,STZRQF,SORMQR, andSORMRZ. 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.
π 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 π
Definition at line 204 of file sgelsy.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
π okay bestie, thatβs the whole page β LAPACK Version 3.12.0, source file SRC/sgelsy.f(3), and the footer is just that source/version tag, no extra date on this one. slay. π«Ά
π¦ 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