gelss(3)
πΈ NAME πΈ
gelss(3) β bestie, this is the Library Functions Manual page for gelss, and it's literally giving gelss: least squares using SVD, QR iteration. Lowkey iconic linear algebra behavior. π
β¨ SYNOPSIS β¨
π Functions π
cgelssβ CGELSS solves overdetermined or underdetermined systems for GE matrices
subroutine cgelss (m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work,
lwork, rwork, info)
dgelssβ DGELSS solves overdetermined or underdetermined systems for GE matrices
subroutine dgelss (m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work,
lwork, info)
sgelssβ SGELSS solves overdetermined or underdetermined systems for GE matrices
subroutine sgelss (m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work,
lwork, info)
zgelssβ ZGELSS solves overdetermined or underdetermined systems for GE matrices
subroutine zgelss (m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work,
lwork, rwork, info)
π« Detailed Description π«
Okay so this is the detailed description corner, and the function documentation below is the main character. No cap, every parameter is about to get its moment. π«Ά
π¦ Function Documentation π¦
π
subroutine cgelss β CGELSS solves overdetermined or underdetermined systems for GE matrices
subroutine cgelss (integer m, integer n, integer nrhs, complex, dimension(
lda, * ) a, integer lda, complex, dimension( ldb, * ) b, integer ldb,
real, dimension( * ) s, real rcond, integer rank, complex, dimension( *
) work, integer lwork, real, dimension( * ) rwork, integer info)
Purpose:
Bestie, CGELSS computes the minimum norm solution to a complex linear least squares problem:
Minimize 2-norm(| b - A*x |).
It does this using the singular value decomposition (SVD) 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 effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value.
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 the matricesBandX.NRHS >= 0.AβA is COMPLEX 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βLDA is INTEGER; the leading dimension of the arrayA.LDA >= max(1,M).BβB is COMPLEX 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 the modulus of elementsn+1:min that column.LDBβLDB is INTEGER; the leading dimension of the arrayB.LDB >= max(1,M,N).SβS is REAL 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βRCOND is REAL;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βRANK is INTEGER; the effective rank ofA, i.e., the number of singular values which are greater thanRCOND*S(1).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 >= 1, and also:
LWORK >= 2*min(M,N) + max(M,N,NRHS)
For good performance, LWORK should 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.
RWORKβRWORK is REAL array, dimension (5*min(M,N)).INFOβINFO is INTEGER:= 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 176 of file cgelss.f.
π
subroutine dgelss β DGELSS solves overdetermined or underdetermined systems for GE matrices
subroutine dgelss (integer m, integer n, integer nrhs, double precision,
dimension( lda, * ) a, integer lda, double precision, dimension( ldb, *
) b, integer ldb, double precision, dimension( * ) s, double precision
rcond, integer rank, double precision, dimension( * ) work, integer
lwork, integer info)
Purpose:
DGELSS computes the minimum norm solution to a real linear least squares problem:
Minimize 2-norm(| b - A*x |).
It uses the singular value decomposition (SVD) 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 effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value.
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 the matricesBandX.NRHS >= 0.AβA is DOUBLE PRECISION 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βLDA is INTEGER; the leading dimension of the arrayA.LDA >= max(1,M).BβB is DOUBLE PRECISION 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βLDB is INTEGER; the leading dimension of the arrayB.LDB >= max(1,max(M,N)).SβS is DOUBLE PRECISION 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βRCOND is DOUBLE PRECISION;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βRANK is INTEGER; the effective rank ofA, i.e., the number of singular values which are greater thanRCOND*S(1).WORKβWORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORK is INTEGER; 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, LWORK should 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βINFO is INTEGER:= 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 dgelss.f.
π
subroutine sgelss β SGELSS solves overdetermined or underdetermined systems for GE matrices
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)
Purpose:
so like⦠SGELSS is out here computing the minimum norm solution to a real linear least squares problem, and honestly? iconic. The whole goal is:
Minimize 2-norm(| b - A*x |).
and it does that using the singular value decomposition (SVD) of A. Now A is an M-by-N matrix that may be rank-deficient β yes bestie, it can be messy like that, it handles it π
Also it's a multitasker: several right hand side vectors b and solution vectors x can be handled in a single call β they're stored as the columns of the M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X. Efficiency queen π
And the effective rank of A is figured out by treating as zero those singular values that are less than RCOND times the largest singular value β that's the whole β¨vibe checkβ¨ for rank.
π Parameters (the sgelss edition, real numbers only bestie)
MβM is INTEGER. The number of rows of the matrixA.M >= 0. That's it, that's the row count π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 the matricesBandX.NRHS >= 0. Multi-RHS slay π₯AβA is REAL array, dimension (LDA,N). On entry, the M-by-N matrixA. On exit, the firstmin(m,n)rows ofAare overwritten with its right singular vectors, stored rowwise. Like, it moves out and the SVD vectors move in πLDAβLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβB is REAL array, dimension (LDB,NRHS). On entry, the M-by-NRHS right hand side matrixB. On exit,Bis overwritten by the N-by-NRHS solution matrixX. Oh and heads up: 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. Free leftovers, no cap πLDBβLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,max(M,N)).SβS is REAL array, dimension (min(M,N)). The singular values ofAin decreasing order. The condition number ofAin the 2-norm =S(1)/S(min(m,n)). Sorted, bestie, descending, the way nature intended βRCONDβRCOND is REAL.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. Negative rcond? machine precision. It said "I'll pick," and honestly same πRANKβRANK is INTEGER. The effective rank ofA, i.e., the number of singular values which are greater thanRCOND*S(1). Main character number πWORKβWORK is REAL array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. It tells you what it wanted, king behavior π«ΆLWORKβLWORK is INTEGER. 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, LWORK should generally be larger. And this part is important bestie: 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. It's just peeking, not committing π
INFOβINFO is INTEGER:= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value. Rude.> 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. Not us crying at the bidiagonal π
πΈ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 170 of file sgelss.f.
π¦ subroutine zgelss
okay bestie, now the complex one. Deep breath. Here's the whole signature verbatim, do not touch:
subroutine zgelss (integer m, integer n, integer nrhs, complex*16,
dimension( lda, * ) a, integer lda, complex*16, dimension( ldb, * ) b,
integer ldb, double precision, dimension( * ) s, double precision rcond,
integer rank, complex*16, dimension( * ) work, integer lwork, double
precision, dimension( * ) rwork, integer info)
ZGELSS solves overdetermined or underdetermined systems for GE matrices
π Purpose
ZGELSS computes the minimum norm solution to a complex linear least squares problem:
Minimize 2-norm(| b - A*x |).
using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient β same energy as the real one, just with imaginary parts living their truth π§
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 effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value. Yes, exact same rule, it's a family trait π
β¨ Parameters (zgelss, now with complex flavor)
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 the matricesBandX.NRHS >= 0.AβA is COMPLEX*16 array, dimension (LDA,N). On entry, the M-by-N matrixA. On exit, the firstmin(m,n)rows ofAare overwritten with its right singular vectors, stored rowwise.LDAβLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβB is COMPLEX*16 array, dimension (LDB,NRHS). On entry, the M-by-NRHS right hand side matrixB. On exit,Bis overwritten by the N-by-NRHS solution 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 the modulus of elementsn+1:min that column. Modulus! complex edition! πLDBβLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,M,N).SβS is DOUBLE PRECISION 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βRCOND is DOUBLE PRECISION.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βRANK is INTEGER. The effective rank ofA, i.e., the number of singular values which are greater thanRCOND*S(1).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 >= 1, and also:
LWORK >= 2*min(M,N) + max(M,N,NRHS)
For good performance, LWORK should 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. Just window shopping, no commitment π
RWORKβRWORK is DOUBLE PRECISION array, dimension (5*min(M,N)). Yeah it needs a whole real scratchpad, the complex life is expensive πINFOβINFO is INTEGER:= 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. Again with the bidiagonal. It's giving drama π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 176 of file zgelss.f.
β Author
Generated automatically by Doxygen for LAPACK from the source code.
and that's the whole page bestie π«Ά this was auto-generated by Doxygen for LAPACK straight from the source code, and the version tag on the bottom reads LAPACK Version 3.12.0 with gelss(3) hanging out on the far right β so like, cite it cute when you quote it, mwah πβ¨
π¦ 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