SGESVD(3)
π SGESVD β Library Functions Manual π
bestie, welcome to the sgesvd.f(3) page from the Library Functions Manual. Header path vibes: /home/abui...RC/sgesvd.f(3). This is the LAPACK routine for SVD, and yes she ate πβ¨
π NAME π
This pageβs name is literally this exact path, no cap:
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/sgesvd.f
β¨ SYNOPSIS β¨
π§ Functions/Subroutines π§
subroutine SGESVD (jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work,
lwork, info)
SGESVD computes the singular value decomposition (SVD) for GE
matrices
πΈ Function/Subroutine Documentation πΈ
subroutine SGESVD (character jobu, character jobvt, integer m, integer n,
real, dimension( lda, * ) a, integer lda, real, dimension( * ) s, real,
dimension( ldu, * ) u, integer ldu, real, dimension( ldvt, * ) vt,
integer ldvt, real, dimension( * ) work, integer lwork, integer info)
SGESVD computes the singular value decomposition (SVD) for GE matrices
π Purpose π
Okay so SGESVD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing the left and/or right singular vectors. The SVD is written like this, iconic behavior:
A = U * SIGMA * transpose(V)
where SIGMA is an M-by-N matrix which is zero except for its min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA are the singular values of A; they are real and non-negative, and are returned in descending order. The first min(m,n) columns of U and V are the left and right singular vectors of A.
π Note that the routine returnsV**T, notV. Thatβs the whole tea.
π Parameters π
π JOBU
JOBU is CHARACTER*1 β specifies options for computing all or part of the matrix U:
= 'A':all M columns ofUare returned in arrayU:= 'S':the firstmin(m,n)columns ofU(the left singular vectors) are returned in the arrayU;= 'O':the firstmin(m,n)columns ofU(the left singular vectors) are overwritten on the arrayA;= 'N':no columns ofU(no left singular vectors) are computed.
π JOBVT
JOBVT is CHARACTER*1 β specifies options for computing all or part of the matrix V**T:
= 'A':all N rows ofV**Tare returned in the arrayVT;= 'S':the firstmin(m,n)rows ofV**T(the right singular vectors) are returned in the arrayVT;= 'O':the firstmin(m,n)rows ofV**T(the right singular vectors) are overwritten on the arrayA;= 'N':no rows ofV**T(no right singular vectors) are computed.
π¨ Real talk:JOBVTandJOBUcannot both be'O'.
π M
M is INTEGER β the number of rows of the input matrix A. M >= 0.
π N
N is INTEGER β the number of columns of the input matrix A. N >= 0.
π A
A is REAL array, dimension (LDA,N).
- On entry, the M-by-N matrix
A. - On exit,
- if
JOBU = 'O',Ais overwritten with the firstmin(m,n)columns ofU(the left singular vectors, stored columnwise); - if
JOBVT = 'O',Ais overwritten with the firstmin(m,n)rows ofV**T(the right singular vectors, stored rowwise); - if
JOBU .ne. 'O'andJOBVT .ne. 'O', the contents ofAare destroyed.
- if
π LDA
LDA is INTEGER β the leading dimension of the array A. LDA >= max(1,M).
π S
S is REAL array, dimension (min(M,N)) β the singular values of A, sorted so that S(i) >= S(i+1).
π U
U is REAL array, dimension (LDU,UCOL) β (LDU,M) if JOBU = 'A' or (LDU,min(M,N)) if JOBU = 'S'.
- If
JOBU = 'A',Ucontains the M-by-M orthogonal matrixU; - if
JOBU = 'S',Ucontains the firstmin(m,n)columns ofU(the left singular vectors, stored columnwise); - if
JOBU = 'N'or'O',Uis not referenced.
π LDU
LDU is INTEGER β the leading dimension of the array U. LDU >= 1; if JOBU = 'S' or 'A', LDU >= M.
π VT
VT is REAL array, dimension (LDVT,N).
- If
JOBVT = 'A',VTcontains the N-by-N orthogonal matrixV**T; - if
JOBVT = 'S',VTcontains the firstmin(m,n)rows ofV**T(the right singular vectors, stored rowwise); - if
JOBVT = 'N'or'O',VTis not referenced.
π LDVT
LDVT is INTEGER β the leading dimension of the array VT. LDVT >= 1; if JOBVT = 'A', LDVT >= N; if JOBVT = 'S', LDVT >= min(M,N).
π WORK
WORK is REAL array, dimension (MAX(1,LWORK)).
- On exit, if
INFO = 0,WORK(1)returns the optimalLWORK; - if
INFO > 0,WORK(2:MIN(M,N))contains the unconverged superdiagonal elements of an upper bidiagonal matrixBwhose diagonal is inS(not necessarily sorted).BsatisfiesA = U * B * VT, so it has the same singular values asA, and singular vectors related byUandVT.
π LWORK
LWORK is INTEGER β the dimension of the array WORK.
LWORK >= MAX(1,5*MIN(M,N)) for the paths (see comments inside code):
PATH 1(Mmuch larger thanN,JOBU='N')PATH 1t(Nmuch larger thanM,JOBVT='N')
LWORK >= MAX(1,3*MIN(M,N)+MAX(M,N),5*MIN(M,N)) for the other paths.
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:ifSBDSQRdid not converge,INFOspecifies how many superdiagonals of an intermediate bidiagonal formBdid not converge to zero. See the description ofWORKabove for details.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 209 of file sgesvd.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
Cute sign-off bestie: thatβs the tea from LAPACK Version 3.12.0, and the page path is /home/abui...RC/sgesvd.f(3). Stay slay πβ¨π¦
π¦ 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