SRC/zlalsd.f(3)
π SRC/zlalsd.f(3) β Library Functions Manual β¨
okay bestie, gather round, because this one is a baddie π β it's a Fortran subroutine straight out of LAPACK, living its best life over in SRC/zlalsd.f, and honestly? It's giving main character energy. Let's get into it π
πΈ NAME πΈ
SRC/zlalsd.f β no cap, that's the whole name, she's lowkey mysterious like that π¦
β¨ SYNOPSIS β¨
Functions/Subroutines π«Ά
subroutine zlalsd (uplo, smlsiz, n, nrhs, d, e, b, ldb, rcond, rank,
work, rwork, iwork, info)
ZLALSD uses the singular value decomposition of A to solve the least squares problem. That's her whole personality and she ate π
π Function/Subroutine Documentation π
subroutine zlalsd (character uplo, integer smlsiz, integer n, integer nrhs,
double precision, dimension( * ) d, double precision, dimension( * ) e,
complex*16, dimension( ldb, * ) b, integer ldb, double precision rcond,
integer rank, complex*16, dimension( * ) work, double precision,
dimension( * ) rwork, integer, dimension( * ) iwork, integer info)
ZLALSD uses the singular value decomposition of A to solve the least squares problem. (Yes, that's the same sentence, she's consistent, we stan a consistent icon β)
π― Purpose
ok so here's the vibe: ZLALSD uses the singular value decomposition of A to solve the least squares problem of finding X to minimize the Euclidean norm of each column of A*X-B, where A is N-by-N upper bidiagonal, and X and B are N-by-NRHS. The solution X overwrites B. π₯
And the plot twist: the singular values of A smaller than RCOND times the largest singular value are treated as zero when solving the least squares problem β and in that case a minimum norm solution is returned. The actual singular values are returned in D in ascending order. periodt π
π Parameters
UPLOβ isCHARACTER*1. The glow-up selector, fr:= 'U':DandEdefine an upper bidiagonal matrix.= 'L':DandEdefine a lower bidiagonal matrix.
SMLSIZβ isINTEGER. The maximum size of the subproblems at the bottom of the computation tree. (the little subproblems at the bottom of the tree are the tiny babies and this is their size limit π§)Nβ isINTEGER. The dimension of the bidiagonal matrix.N >= 0.NRHSβ isINTEGER. The number of columns ofB.NRHSmust be at least1. (like, minimum one column or why are we even here π)Dβ isDOUBLE PRECISIONarray, dimension(N). On entryDcontains the main diagonal of the bidiagonal matrix. On exit, ifINFO = 0,Dcontains its singular values. She starts as a diagonal and leaves as a star β¨Eβ isDOUBLE PRECISIONarray, dimension(N-1). Contains the super-diagonal entries of the bidiagonal matrix. On exit,Ehas been destroyed. π rip bestie, she did not survive the function call.Bβ isCOMPLEX*16array, dimension(LDB,NRHS). On input,Bcontains the right hand sides of the least squares problem. On output,Bcontains the solutionX. glow-up of the century, honestly πLDBβ isINTEGER. The leading dimension ofBin the calling subprogram.LDBmust be at leastmax(1,N).RCONDβ isDOUBLE PRECISION. The singular values ofAless than or equal toRCONDtimes the largest singular value are treated as zero in solving the least squares problem. IfRCONDis negative, machine precision is used instead. For example, ifdiag(S)*X=Bwere the least squares problem, wherediag(S)is a diagonal matrix of singular values, the solution would beX(i) = B(i) / S(i)ifS(i)is greater thanRCOND*max(S), andX(i) = 0ifS(i)is less than or equal toRCOND*max(S). (she's the threshold queen, the cutoff icon, the "you're too small, we're not doing that" gatekeeper πͺ)RANKβ isINTEGER. The number of singular values ofAgreater thanRCONDtimes the largest singular value. Basically the headcount of singular values that made the cut πWORKβ isCOMPLEX*16array, dimension(N * NRHS).RWORKβ isDOUBLE PRECISIONarray, dimension at least
(9*N + 2*N*SMLSIZ + 8*N*NLVL + 3*SMLSIZ*NRHS +
MAX( (SMLSIZ+1)**2, N*(1+NRHS) + 2*NRHS ),
where
NLVL = MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 )
yes, that's a real formula, yes it's a lot, no we're not going to pretend it's short π
IWORKβ isINTEGERarray, dimension at least(3*N*NLVL + 11*N).INFOβ isINTEGER. The narrator of the story, the vibe check at the end π= 0: successful exit. slay π< 0: ifINFO = -i, thei-th argument had an illegal value. π> 0: The algorithm failed to compute a singular value while working on the submatrix lying in rows and columnsINFO/(N+1)throughMOD(INFO,N+1). π that submatrix is NOT having a good day.
π«Ά 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 179 of file zlalsd.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code. (not me writing a fanfic, the robots did this one π€)
ok that's the whole page, bestie β every flag, every array, every formula, all of it, preserved with love and a lot of emoji π
watch out for E on exit, genuinely. she's destroyed. gone. do not pass go, do not read that array π
LAPACK Β· Version 3.12.0 Β· SRC/zlalsd.f(3) β mwah, that's a wrap, ily, go call your BLAS π¦ππ
π¦ 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