ZGELSD(3)
π ZGELSD(3) π
okay bestie, welcome to ZGELSD(3) from the Library Functions Manual β this is the page for the LAPACK subroutine that is absolutely carrying the minimum-norm least-squares agenda. π No cap, it's a whole SVD moment.
πΈ NAME πΈ
The NAME section on this one is literally a path, not a drill: /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/zgelsd.f. That's it. That's the name. π
β¨ SYNOPSIS β¨
π§ Functions/Subroutines π§
subroutine ZGELSD (m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work,
lwork, rwork, iwork, info)
ZGELSD computes the minimum-norm solution to a linear least squares problem for GE matrices. π«Ά
π¦ Function/Subroutine Documentation π¦
subroutine ZGELSD (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, dimension( * ) iwork, integer
info)
ZGELSD computes the minimum-norm solution to a linear least squares problem for GE matrices. Yes, it said it twice. It's confident. π
π Purpose π
okay so here's the whole vibe: ZGELSD computes the minimum-norm solution to a real 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. π
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. Literally multitasking. β¨
The problem is solved in three steps:
- Reduce the coefficient matrix
Ato bidiagonal form with Householder transformations, reducing the original problem into a (BLS). - Solve the BLS using a divide and conquer approach.
- Apply back all the Householder transformations to solve the original least squares problem.
The effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value. Rank check: iconic. π
π 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βAisCOMPLEX*16array, dimension(LDA,N). On entry, theM-by-NmatrixA. On exit,Ahas been destroyed. RIP boo, you had a good run. πLDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisCOMPLEX*16array, 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 thei-th column is given by the sum of squares of the modulus of elementsn+1:min that column.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,M,N).SβSisDOUBLE PRECISIONarray, dimension(min(M,N)). The singular values ofAin decreasing order. The condition number ofAin the 2-norm =S(1)/S(min(m,n)).RCONDβRCONDisDOUBLE 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βRANKisINTEGER. The effective rank ofA, i.e., the number of singular values which are greater thanRCOND*S(1).WORKβWORKisCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORKisINTEGER. The dimension of the arrayWORK.LWORKmust be at least 1. The exact minimum amount of workspace needed depends onM,NandNRHS. As long asLWORKis at least
2*N + N*NRHS
if M is greater than or equal to N or
2*M + M*NRHS
if M is less than N, the code will execute correctly. 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 array WORK and the minimum sizes of the arrays RWORK and IWORK, and returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK is issued by XERBLA.
RWORKβRWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LRWORK)).
LRWORK >=
10*N + 2*N*SMLSIZ + 8*N*NLVL + 3*SMLSIZ*NRHS +
MAX( (SMLSIZ+1)**2, N*(1+NRHS) + 2*NRHS )
if M is greater than or equal to N or
10*M + 2*M*SMLSIZ + 8*M*NLVL + 3*SMLSIZ*NRHS +
MAX( (SMLSIZ+1)**2, N*(1+NRHS) + 2*NRHS )
if M is less than N, the code will execute correctly. SMLSIZ is returned by ILAENV and is equal to the maximum size of the subproblems at the bottom of the computation tree (usually about 25), and
NLVL = MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 )
On exit, if INFO = 0, RWORK(1) returns the minimum LRWORK.
IWORKβIWORKisINTEGERarray, dimension(MAX(1,LIWORK)).
LIWORK >= max(1, 3*MINMN*NLVL + 11*MINMN),
where MINMN = MIN( M,N ). On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
INFOβINFOisINTEGER.= 0: successful exit. slay. β¨< 0: ifINFO = -i, thei-th argument had an illegal value.> 0: the algorithm for computing the SVD failed to converge; ifINFO = i,ioff-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.
π Contributors π
- Ming Gu and Ren-Cang Li, Computer Science Division, University of California at Berkeley, USA
- Osni Marques, LBNL/NERSC, USA
π Definition at line 217 of file zgelsd.f π
π«Ά Author π«Ά
Generated automatically by Doxygen for LAPACK from the source code.
π that's the whole manual page, bestie β official sign-off vibes: LAPACK Version 3.12.0, source /home/abui...RC/zgelsd.f(3). The footer doesn't hand us a separate date, so I'm not inventing one β periodt. π
π¦ 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