gelst(3)
๐ NAME ๐
okay bestie, welcome to gelst(3) from the Library Functions Manual ๐
gelst โ gelst: least squares using QR/LQ with T matrix โจ
โจ SYNOPSIS โจ
subroutine cgelst (trans, m, n, nrhs, a, lda, b, ldb, work, lwork, info)โ CGELST solves overdetermined or underdetermined systems for GE matrices using QR or LQ factorization with compact WY representation ofQ.subroutine dgelst (trans, m, n, nrhs, a, lda, b, ldb, work, lwork, info)โ DGELST solves overdetermined or underdetermined systems for GE matrices using QR or LQ factorization with compact WY representation ofQ.subroutine sgelst (trans, m, n, nrhs, a, lda, b, ldb, work, lwork, info)โ SGELST solves overdetermined or underdetermined systems for GE matrices using QR or LQ factorization with compact WY representation ofQ.subroutine zgelst (trans, m, n, nrhs, a, lda, b, ldb, work, lwork, info)โ ZGELST solves overdetermined or underdetermined systems for GE matrices using QR or LQ factorization with compact WY representation ofQ.
๐ Detailed Description ๐
The gelst family is literally four subroutines, same least-squares energy, different types. The function-by-function tea is right below, bestie ๐.
๐ Function Documentation ๐
๐
cgelst ๐
subroutine cgelst (character trans, integer m, integer n, integer nrhs, complex, dimension( lda, * ) a, integer lda, complex, dimension( ldb, * ) b, integer ldb, complex, dimension( * ) work, integer lwork, integer info)
CGELST solves overdetermined or underdetermined systems for GE matrices using QR or LQ factorization with compact WY representation of Q.
โจ Purpose โจ
CGELST solves overdetermined or underdetermined real linear systems involving an M-by-N matrix A, or its conjugate-transpose, using a QR or LQ factorization of A with compact WY representation of Q.
The vibe check: A is assumed to have full rank, and only a rudimentary protection against rank-deficient matrices is provided. This subroutine only detects exact rank-deficiency โ where a diagonal element of the triangular factor of A is exactly zero.
It is conceivable for one (or more) of the diagonal elements of the triangular factor of A to be subnormally tiny numbers without this subroutine signalling an error ๐ญ. The solutions computed for such almost-rank-deficient matrices may be less accurate due to a loss of numerical precision.
The following options are provided:
- If
TRANS = 'N'andm >= n: find the least squares solution of an overdetermined system, i.e., solve the least squares problem
minimize || B - A*X ||.
- If
TRANS = 'N'andm < n: find the minimum norm solution of an underdetermined systemA * X = B. - If
TRANS = 'C'andm >= n: find the minimum norm solution of an underdetermined systemA**T * X = B. - If
TRANS = 'C'andm < n: find the least squares solution of an overdetermined system, i.e., solve the least squares problem
minimize || B - A**T * X ||.
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.
๐ Parameters ๐
TRANSโTRANS is CHARACTER*1= 'N': the linear system involvesA;= 'C': the linear system involvesA**H.
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:- if
M >= N,Ais overwritten by details of its QR factorization as returned byCGEQRT; - if
M < N,Ais overwritten by details of its LQ factorization as returned byCGELQT.
- if
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 matrixBof right hand side vectors, stored columnwise;BisM-by-NRHSifTRANS = 'N', orN-by-NRHSifTRANS = 'C'. On exit, ifINFO = 0,Bis overwritten by the solution vectors, stored columnwise:- if
TRANS = 'N'andm >= n, rows1tonofBcontain the least squares solution vectors; the residual sum of squares for the solution in each column is given by the sum of squares of modulus of elementsN+1toMin that column; - if
TRANS = 'N'andm < n, rows1toNofBcontain the minimum norm solution vectors; - if
TRANS = 'C'andm >= n, rows1toMofBcontain the minimum norm solution vectors; - if
TRANS = 'C'andm < n, rows1toMofBcontain the least squares solution vectors; the residual sum of squares for the solution in each column is given by the sum of squares of the modulus of elementsM+1toNin that column.
- if
LDBโLDB is INTEGER. The leading dimension of the arrayB.LDB >= MAX(1,M,N).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, MN + max( MN, NRHS ) ). For optimal performance,LWORK >= max( 1, (MN + max( MN, NRHS ))*NB ). whereMN = min(M,N)andNBis the optimum block size.
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, thei-th argument had an illegal value> 0: ifINFO = i, thei-th diagonal element of the triangular factor ofAis exactly zero, so thatAdoes not have full rank; the least squares solution could not be computed.
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ซถ Contributors ๐ซถ
November 2022, Igor Kozachenko, Computer Science Division, University of California, Berkeley
Definition at line 201 of file cgelst.f.
๐
dgelst ๐
subroutine dgelst (character trans, integer m, integer n, integer nrhs, double precision, dimension( lda, * ) a, integer lda, double precision, dimension( ldb, * ) b, integer ldb, double precision, dimension( * ) work, integer lwork, integer info)
DGELST solves overdetermined or underdetermined systems for GE matrices using QR or LQ factorization with compact WY representation of Q.
โจ Purpose โจ
DGELST solves overdetermined or underdetermined real linear systems involving an M-by-N matrix A, or its transpose, using a QR or LQ factorization of A with compact WY representation of Q.
The vibe check: A is assumed to have full rank, and only a rudimentary protection against rank-deficient matrices is provided. This subroutine only detects exact rank-deficiency โ where a diagonal element of the triangular factor of A is exactly zero.
It is conceivable for one (or more) of the diagonal elements of the triangular factor of A to be subnormally tiny numbers without this subroutine signalling an error ๐ญ. The solutions computed for such almost-rank-deficient matrices may be less accurate due to a loss of numerical precision.
The following options are provided:
- If
TRANS = 'N'andm >= n: find the least squares solution of an overdetermined system, i.e., solve the least squares problem
minimize || B - A*X ||.
- If
TRANS = 'N'andm < n: find the minimum norm solution of an underdetermined systemA * X = B. - If
TRANS = 'T'andm >= n: find the minimum norm solution of an underdetermined systemA**T * X = B. - If
TRANS = 'T'andm < n: find the least squares solution of an overdetermined system, i.e., solve the least squares problem
minimize || B - A**T * X ||.
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.
๐ Parameters ๐
TRANSโTRANS is CHARACTER*1= 'N': the linear system involvesA;= 'T': the linear system involvesA**T.
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:- if
M >= N,Ais overwritten by details of its QR factorization as returned byDGEQRT; - if
M < N,Ais overwritten by details of its LQ factorization as returned byDGELQT.
- if
LDAโ (and this is exactly where part 1 ends, bestie โ part 2 has the rest ofLDAand the other parameter glow-ups ๐)LDAโLDA is INTEGER, and itโs literally just the leading dimension of the arrayA, bestie:LDA >= max(1,M). ๐BโB is DOUBLE PRECISION array, dimension (LDB,NRHS). On entry, itโs the matrix of right hand side vectors, stored columnwise;BisM-by-NRHSifTRANS = 'N', orN-by-NRHSifTRANS = 'T'. On exit, ifINFO = 0,Bis overwritten by the solution vectors, stored columnwise:- if
TRANS = 'N'andm >= n, rows 1 to n ofBcontain the least squares solution vectors; the residual sum of squares for the solution in each column is given by the sum of squares of elementsN+1toMin that column; - if
TRANS = 'N'andm < n, rows 1 to N ofBcontain the minimum norm solution vectors; - if
TRANS = 'T'andm >= n, rows 1 to M ofBcontain the minimum norm solution vectors; - if
TRANS = 'T'andm < n, rows 1 to M ofBcontain the least squares solution vectors; the residual sum of squares for the solution in each column is given by the sum of squares of elementsM+1toNin that column.
- if
LDBโLDB is INTEGER, the leading dimension of the arrayB. Itโs givingLDB >= MAX(1,M,N), periodt. ๐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. So like:LWORK >= max( 1, MN + max( MN, NRHS ) ).- For optimal performance,
LWORK >= max( 1, (MN + max( MN, NRHS ))*NB ). - where
MN = min(M,N)andNBis the optimum block size. - If
LWORK = -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. No cap. ๐ซถ
INFOโINFO is INTEGER, the vibe check:= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, the i-th diagonal element of the triangular factor ofAis exactly zero, so thatAdoes not have full rank; the least squares solution could not be computed. ๐ญ
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ Contributors
November 2022, Igor Kozachenko, Computer Science Division, University of California, Berkeley.
Definition at line 201 of file dgelst.f.
๐งฎ sgelst
subroutine sgelst (character trans, integer m, integer n, integer nrhs,
real, dimension( lda, * ) a, integer lda, real, dimension( ldb, * ) b,
integer ldb, real, dimension( * ) work, integer lwork, integer info)
SGELST solves overdetermined or underdetermined systems for GE matrices using QR or LQ factorization with compact WY representation of Q. Itโs the REAL girlie of the family, and she ate. ๐
โจ Purpose
SGELST solves overdetermined or underdetermined real linear systems involving an M-by-N matrix A, or its transpose, using a QR or LQ factorization of A with compact WY representation of Q. Obsessed with the compact WY representation, honestly. ๐ฆ
It is assumed that A has full rank, and only a rudimentary protection against rank-deficient matrices is provided. This subroutine only detects exact rank-deficiency, where a diagonal element of the triangular factor of A is exactly zero. ๐ซ
It is conceivable for one (or more) of the diagonal elements of the triangular factor of A to be subnormally tiny numbers without this subroutine signalling an error. The solutions computed for such almost-rank-deficient matrices may be less accurate due to a loss of numerical precision. So like, keep an eye on that, bestie. ๐
The following options are provided:
- If
TRANS = 'N'andm >= n: find the least squares solution of an overdetermined system, i.e., solve the least squares problemminimize || B - A*X ||. - If
TRANS = 'N'andm < n: find the minimum norm solution of an underdetermined systemA * X = B. - If
TRANS = 'T'andm >= n: find the minimum norm solution of an underdetermined systemA**T * X = B. - If
TRANS = 'T'andm < n: find the least squares solution of an overdetermined system, i.e., solve the least squares problemminimize || B - A**T * X ||.
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. Main character energy for matrices, fr fr. ๐
๐ Parameters
TRANSโTRANS is CHARACTER*1= 'N': the linear system involvesA;= 'T': the linear system involvesA**T.
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 REAL array, dimension (LDA,N). On entry, theM-by-NmatrixA. On exit,- if
M >= N,Ais overwritten by details of its QR factorization as returned bySGEQRT; - if
M < N,Ais overwritten by details of its LQ factorization as returned bySGELQT.
- if
LDAโLDA is INTEGER, the leading dimension of the arrayA.LDA >= max(1,M). Slay. ๐BโB is REAL array, dimension (LDB,NRHS). On entry, the matrixBof right hand side vectors, stored columnwise;BisM-by-NRHSifTRANS = 'N', orN-by-NRHSifTRANS = 'T'. On exit, ifINFO = 0,Bis overwritten by the solution vectors, stored columnwise:- if
TRANS = 'N'andm >= n, rows 1 to n ofBcontain the least squares solution vectors; the residual sum of squares for the solution in each column is given by the sum of squares of elementsN+1toMin that column; - if
TRANS = 'N'andm < n, rows 1 to N ofBcontain the minimum norm solution vectors; - if
TRANS = 'T'andm >= n, rows 1 to M ofBcontain the minimum norm solution vectors; - if
TRANS = 'T'andm < n, rows 1 to M ofBcontain the least squares solution vectors; the residual sum of squares for the solution in each column is given by the sum of squares of elementsM+1toNin that column.
- if
LDBโLDB is INTEGER, the leading dimension of the arrayB.LDB >= MAX(1,M,N). โจ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.LWORK >= max( 1, MN + max( MN, NRHS ) ).- For optimal performance,
LWORK >= max( 1, (MN + max( MN, NRHS ))*NB ). - where
MN = min(M,N)andNBis the optimum block size. - If
LWORK = -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, the i-th argument had an illegal value> 0: ifINFO = i, the i-th diagonal element of the triangular factor ofAis exactly zero, so thatAdoes not have full rank; the least squares solution could not be computed. ๐ญ
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ Contributors
November 2022, Igor Kozachenko, Computer Science Division, University of California, Berkeley.
Definition at line 201 of file sgelst.f.
๐ง zgelst
subroutine zgelst (character trans, integer m, integer n, integer nrhs,
complex*16, dimension( lda, * ) a, integer lda, complex*16, dimension(
ldb, * ) b, integer ldb, complex*16, dimension( * ) work, integer lwork,
integer info)
ZGELST solves overdetermined or underdetermined systems for GE matrices using QR or LQ factorization with compact WY representation of Q. Complex edition, iconic behavior only. ๐
โจ Purpose
okay so the actual ZGELST tea is serving linear algebra realness โ no cap. โจ
ZGELST solves overdetermined or underdetermined real linear systems involving an M-by-N matrix A, or its conjugate-transpose, using a QR or LQ factorization of A with compact WY representation of Q. ๐ซถ
โ ๏ธ Rank tea, listen up: it is assumed thatAhas full rank, and only a rudimentary protection against rank-deficient matrices is provided. This subroutine only detects exact rank-deficiency, where a diagonal element of the triangular factor ofAis exactly zero. ๐ญ
Also: it is conceivable for one (or more) of the diagonal elements of the triangular factor of A to be subnormally tiny numbers without this subroutine signalling an error. The solutions computed for such almost-rank-deficient matrices may be less accurate due to a loss of numerical precision. ๐
The following options are provided:
- If
TRANS = 'N'andm >= n: find the least squares solution of an overdetermined system, i.e., solve the least squares problemminimize || B - A*X ||. ๐ - If
TRANS = 'N'andm < n: find the minimum norm solution of an underdetermined systemA * X = B. ๐ธ - If
TRANS = 'C'andm >= n: find the minimum norm solution of an underdetermined systemA**T * X = B. ๐ฆ - If
TRANS = 'C'andm < n: find the least squares solution of an overdetermined system, i.e., solve the least squares problemminimize || B - A**T * X ||. โญ
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. ๐
Parameters ๐
TRANSโTRANS is CHARACTER*1= 'N': the linear system involvesA;= 'C': the linear system involvesA**H.
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-NmatrixA. - On exit:
- if
M >= N,Ais overwritten by details of its QR factorization as returned byZGEQRT; - if
M < N,Ais overwritten by details of its LQ factorization as returned byZGELQT.
- if
- On entry, the
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 matrix
Bof right hand side vectors, stored columnwise;BisM-by-NRHSifTRANS = 'N', orN-by-NRHSifTRANS = 'C'. - On exit, if
INFO = 0,Bis overwritten by the solution vectors, stored columnwise:- if
TRANS = 'N'andm >= n, rows1tonofBcontain the least squares solution vectors; the residual sum of squares for the solution in each column is given by the sum of squares of modulus of elementsN+1toMin that column; - if
TRANS = 'N'andm < n, rows1toNofBcontain the minimum norm solution vectors; - if
TRANS = 'C'andm >= n, rows1toMofBcontain the minimum norm solution vectors; - if
TRANS = 'C'andm < n, rows1toMofBcontain the least squares solution vectors; the residual sum of squares for the solution in each column is given by the sum of squares of the modulus of elementsM+1toNin that column.
- if
- On entry, the matrix
LDBโLDB is INTEGERโ the leading dimension of the arrayB.LDB >= MAX(1,M,N). ๐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 >= max( 1, MN + max( MN, NRHS ) ).- For optimal performance,
LWORK >= max( 1, (MN + max( MN, NRHS ))*NB ). - where
MN = min(M,N)andNBis the optimum block size. - If
LWORK = -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;> 0: ifINFO = i, thei-th diagonal element of the triangular factor ofAis exactly zero, so thatAdoes not have full rank; the least squares solution could not be computed. ๐ญ
Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors: ๐ซถ
November 2022, Igor Kozachenko, Computer Science Division, University of California, Berkeley.
Definition at line 201 of file zgelst.f. ๐
Author (the generated one) ๐ค
Generated automatically by Doxygen for LAPACK from the source code.
that's the whole vibe bestie โ this page is from LAPACK Version 3.12.0, specifically gelst(3). periodt. ๐
โจ
๐ฆ 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