SGELSS(3)
π SGELSS(3) β Library Functions Manual edition π
okay so this is SGELSS(3), from the Library Functions Manual. Itβs a LAPACK baddie here to solve your least-squares moment. periodt β¨
π NAME π
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/sgelss.f
That path is the whole NAME vibe, bestie β yes, itβs literally the source file for SGELSS.
β¨ SYNOPSIS β¨
Functions/Subroutines
subroutine SGELSS (m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, info)βSGELSS solves overdetermined or underdetermined systems for GE matrices
π«Ά Function/Subroutine Documentation π«Ά
Hereβs the full signature, character-for-character, because we do not play about code:
subroutine SGELSS (integer m, integer n, integer nrhs, real, dimension( lda, * ) a, integer lda, real, dimension( ldb, * ) b, integer ldb, real, dimension( * ) s, real rcond, integer rank, real, dimension( * ) work, integer lwork, integer info)
SGELSS solves overdetermined or underdetermined systems for GE matrices
Purpose
okay so the mission is: SGELSS computes the minimum norm solution to a real linear least squares problem:
Minimize 2-norm(| b - A*x |).
It does that using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient. iykyk π
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. slay.
The effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value. vibe check complete.
Parameters
MβMisINTEGER. The number of rows of the matrixA.M >= 0.NβNisINTEGER. The number of columns of the matrixA.N >= 0.NRHSβNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.AβAisREAL array, dimension (LDA,N). On entry, theM-by-NmatrixA. On exit, the firstmin(m,n)rows ofAare overwritten with its right singular vectors, stored rowwise.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREAL array, dimension (LDB,NRHS). On entry, theM-by-NRHSright hand side matrixB. On exit,Bis overwritten by theN-by-NRHSsolution matrixX. Ifm >= nandRANK = n, the residual sum-of-squares for the solution in the i-th column is given by the sum of squares of elementsn+1:min that column.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,max(M,N)).SβSisREAL array, dimension (min(M,N)). The singular values ofAin decreasing order. The condition number ofAin the 2-norm =S(1)/S(min(m,n)).RCONDβRCONDisREAL.RCONDis used to determine the effective rank ofA. Singular valuesS(i) <= RCOND*S(1)are treated as zero. IfRCOND < 0, machine precision is used instead.RANKβRANKisINTEGER. The effective rank ofA, i.e., the number of singular values which are greater thanRCOND*S(1).WORKβWORKisREAL array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORKisINTEGER. The dimension of the arrayWORK.LWORK >= 1, and also:LWORK >= 3*min(M,N) + max( 2*min(M,N), max(M,N), NRHS ). For good performance,LWORKshould generally be larger.
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.
INFOβINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value.> 0: the algorithm for computing the SVD failed to converge; ifINFO = i, i off-diagonal elements of an intermediate bidiagonal form did not converge to zero.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 170 of file sgelss.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
okay thatβs the whole page, bestie! final sign-off: LAPACK Version 3.12.0, footer path /home/abui...RC/sgelss.f(3), Library Functions Manual energy β no date printed in the footer, so Iβm not inventing one. mwah ππ
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms