gesdd(3)
πΈ gesdd(3) β Library Functions Manual πΈ
Bestie, this is the gesdd(3) page, and its NAME is literally gesdd β gesdd: SVD, divide and conquer. We're doing the whole group-chat walkthrough, no cap. π
β¨
π SYNOPSIS π
π«Ά Functions π«Ά
CGESDDβ the complex version, okay?
subroutine cgesdd (jobz, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork,
rwork, iwork, info)
CGESDD
DGESDDβ the double precision version.
subroutine dgesdd (jobz, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork,
iwork, info)
DGESDD
SGESDDβ the single precision version.
subroutine sgesdd (jobz, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork,
iwork, info)
SGESDD
ZGESDDβ the complex double precision version.
subroutine zgesdd (jobz, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork,
rwork, iwork, info)
ZGESDD
π« DETAILED DESCRIPTION π«
Okay so the detailed description is basically the function docs below, bestie. Let's get into it. π¦
π FUNCTION DOCUMENTATION π
π
CGESDD β subroutine cgesdd π
subroutine cgesdd (character jobz, integer m, integer n, complex, dimension(
lda, * ) a, integer lda, real, dimension( * ) s, complex, dimension(
ldu, * ) u, integer ldu, complex, dimension( ldvt, * ) vt, integer ldvt,
complex, dimension( * ) work, integer lwork, real, dimension( * ) rwork,
integer, dimension( * ) iwork, integer info)
CGESDD
β¨ Purpose β¨
CGESDD computes the singular value decomposition (SVD) of a complex M-by-N matrix A, optionally computing the left and/or right singular vectors, by using the divide-and-conquer method. The SVD is written
A = U * SIGMA * conjugate-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 unitary matrix, and V is an N-by-N unitary 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 returnsVT = V**H, notV. Iconic behavior, honestly. π
π Parameters π
JOBZβJOBZ is CHARACTER*1. It specifies options for computing all or part of the matrixU:= 'A': allMcolumns ofUand allNrows ofV**Hare returned in the arraysUandVT;= 'S': the firstmin(M,N)columns ofUand the firstmin(M,N)rows ofV**Hare returned in the arraysUandVT;= 'O': ifM >= N, the firstNcolumns ofUare overwritten in the arrayAand all rows ofV**Hare returned in the arrayVT; otherwise, all columns ofUare returned in the arrayUand the firstMrows ofV**Hare overwritten in the arrayA;= 'N': no columns ofUor rows ofV**Hare computed.
MβM is INTEGER. The number of rows of the input matrixA.M >= 0.NβN is INTEGER. The number of columns of the input matrixA.N >= 0.AβA is COMPLEX array, dimension (LDA,N). On entry, theM-by-NmatrixA. On exit:- if
JOBZ = 'O',Ais overwritten with the firstNcolumns ofU(the left singular vectors, stored columnwise) ifM >= N;Ais overwritten with the firstMrows ofV**H(the right singular vectors, stored rowwise) otherwise. - if
JOBZ .ne. 'O', the contents ofAare destroyed.
- if
Bestie, clock that warning: ifJOBZ .ne. 'O', the contents ofAare destroyed. Not a drill. π
LDAβLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).SβS is REAL array, dimension (min(M,N)). The singular values ofA, sorted so thatS(i) >= S(i+1).UβU is COMPLEX array, dimension (LDU,UCOL).UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M < N;UCOL = min(M,N) if JOBZ = 'S'. IfJOBZ = 'A'orJOBZ = 'O'andM < N,Ucontains theM-by-Munitary matrixU; ifJOBZ = 'S',Ucontains the firstmin(M,N)columns ofU(the left singular vectors, stored columnwise); ifJOBZ = 'O'andM >= N, orJOBZ = 'N',Uis not referenced.LDUβLDU is INTEGER. The leading dimension of the arrayU.LDU >= 1; ifJOBZ = 'S'or'A'orJOBZ = 'O'andM < N,LDU >= M.VTβVT is COMPLEX array, dimension (LDVT,N). IfJOBZ = 'A'orJOBZ = 'O'andM >= N,VTcontains theN-by-Nunitary matrixV**H; ifJOBZ = 'S',VTcontains the firstmin(M,N)rows ofV**H(the right singular vectors, stored rowwise); ifJOBZ = 'O'andM < N, orJOBZ = 'N',VTis not referenced.LDVTβLDVT is INTEGER. The leading dimension of the arrayVT.LDVT >= 1; ifJOBZ = 'A'orJOBZ = 'O'andM >= N,LDVT >= N; ifJOBZ = 'S',LDVT >= min(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 >= 1.
If LWORK = -1, a workspace query is assumed. The optimal size for the WORK array is calculated and stored in WORK(1), and no other work except argument checking is performed.
Let mx = max(M,N) and mn = min(M,N).
If JOBZ = 'N', LWORK >= 2*mn + mx. If JOBZ = 'O', LWORK >= 2*mn*mn + 2*mn + mx. If JOBZ = 'S', LWORK >= mn*mn + 3*mn. If JOBZ = 'A', LWORK >= mn*mn + 2*mn + mx.
These are not tight minimums in all cases; see comments inside code. For good performance, LWORK should generally be larger; a query is recommended.
RWORKβRWORK is REAL array, dimension (MAX(1,LRWORK)). Letmx = max(M,N)andmn = min(M,N).
If JOBZ = 'N', LRWORK >= 5*mn (LAPACK <= 3.6 needs 7*mn); else if mx >> mn, LRWORK >= 5*mn*mn + 5*mn; else LRWORK >= max( 5*mn*mn + 5*mn, 2*mx*mn + 2*mn*mn + mn ).
IWORKβIWORK is INTEGER array, dimension (8*min(M,N)).INFOβINFO is INTEGER.< 0: ifINFO = -i, thei-th argument had an illegal value.= -4: ifAhad aNANentry.> 0: the updating process ofSBDSDCdid not converge.= 0: successful exit.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Contributors: π
Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA
Definition at line 219 of file cgesdd.f.
π₯ DGESDD β subroutine dgesdd π₯
subroutine dgesdd (character jobz, integer m, integer n, double precision,
dimension( lda, * ) a, integer lda, double precision, dimension( * ) s,
double precision, dimension( ldu, * ) u, integer ldu, double precision,
dimension( ldvt, * ) vt, integer ldvt, double precision, dimension( * )
work, integer lwork, integer, dimension( * ) iwork, integer info)
DGESDD
β¨ Purpose β¨
DGESDD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing the left and right singular vectors. If singular vectors are desired, it uses a divide-and-conquer algorithm. π¦
The SVD is written
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 returnsVT = V**T, notV. Again:VTis the moment, notVitself. π
π Parameters π
JOBZβJOBZ is CHARACTER*1. It specifies options for computing all or part of the matrixU:= 'A': allMcolumns ofUand allNrows ofV**Tare returned in the arraysUandVT;= 'S': the firstmin(M,N)columns ofUand the firstmin(M,N)rows ofV**Tare returned in the arraysUandVT;= 'O': ifM >= N, the firstNcolumns ofUare overwritten on the arrayAand all rows ofV**Tare returned in the arrayVT; otherwise, all columns ofUare returned in the arrayUand the firstMrows ofV**Tare overwritten in the arrayA;= 'N': no columns ofUor rows ofV**Tare computed.
MβM is INTEGER. The number of rows of the input matrixA.M >= 0.NβN is INTEGER. The number of columns of the input matrixA.N >= 0.AβA is DOUBLE PRECISION array, dimension (LDA,N). On entry, theM-by-NmatrixA. On exit:- if
JOBZ = 'O',Ais overwritten with the firstNcolumns ofU(the left singular vectors, stored columnwise) ifM >= N;Ais overwritten with the firstMrows ofV**T(the right singular vectors, stored rowwise) otherwise. - if
JOBZ .ne. 'O', the contents ofAare destroyed.
- if
Okay but seriously, bestie: ifJOBZ .ne. 'O', the contents ofAare destroyed. Protect your data. π
LDAβLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).SβS is DOUBLE PRECISION array, dimension (min(M,N)). The singular values ofA, sorted so thatS(i) >= S(i+1).UUβ okay soUis aDOUBLE PRECISIONarray, dimension(LDU,UCOL)πUCOL = MifJOBZ = 'A'orJOBZ = 'O'andM < N;UCOL = min(M,N)ifJOBZ = 'S'. IfJOBZ = 'A'orJOBZ = 'O'andM < N,Ucontains theM-by-Morthogonal matrixU; ifJOBZ = 'S',Ucontains the firstmin(M,N)columns ofU(the left singular vectors, stored columnwise); ifJOBZ = 'O'andM >= N, orJOBZ = 'N',Uis not referenced. β¨LDUβLDUisINTEGER. Itβs the leading dimension of the arrayU.LDU >= 1; ifJOBZ = 'S'or'A'orJOBZ = 'O'andM < N, thenLDU >= M. π«ΆVTβVTisDOUBLE PRECISIONarray, dimension(LDVT,N). IfJOBZ = 'A'orJOBZ = 'O'andM >= N,VTcontains theN-by-Northogonal matrixV**T; ifJOBZ = 'S',VTcontains the firstmin(M,N)rows ofV**T(the right singular vectors, stored rowwise); ifJOBZ = 'O'andM < N, orJOBZ = 'N',VTis not referenced. πΈLDVTβLDVTisINTEGER. Leading dimension ofVT.LDVT >= 1; ifJOBZ = 'A'orJOBZ = 'O'andM >= N,LDVT >= N; ifJOBZ = 'S',LDVT >= min(M,N). πWORKβWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK; π₯LWORKβLWORKisINTEGER. Dimension of the arrayWORK.LWORK >= 1. IfLWORK = -1, a workspace query is assumed. The optimal size for theWORKarray is calculated and stored inWORK(1), and no other work except argument checking is performed. Letmx = max(M,N)andmn = min(M,N). IfJOBZ = 'N',LWORK >= 3*mn + max( mx, 7*mn ). IfJOBZ = 'O',LWORK >= 3*mn + max( mx, 5*mn*mn + 4*mn ). IfJOBZ = 'S',LWORK >= 4*mn*mn + 7*mn. IfJOBZ = 'A',LWORK >= 4*mn*mn + 6*mn + mx. These are not tight minimums in all cases; see comments inside code. For good performance,LWORKshould generally be larger; a query is recommended. πIWORKβIWORKisINTEGERarray, dimension(8*min(M,N)). πINFOβINFOisINTEGER.< 0: ifINFO = -i, thei-th argument had an illegal value.= -4: ifAhad aNANentry.> 0:DBDSDCdid not converge, updating process failed.= 0: successful exit. π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors
Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA π§
Definition at line 211 of file dgesdd.f.
subroutine sgesdd
subroutine sgesdd (character jobz, 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, dimension( * ) iwork,
integer info)
SGESDD π
Purpose
okay bestie, SGESDD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing the left and right singular vectors. If singular vectors are desired, it uses a divide-and-conquer algorithm. π₯
The SVD is written
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 returns VT = V**T, not V. π«Ά
Parameters
JOBZβJOBZisCHARACTER*1. Specifies options for computing all or part of the matrixU:= 'A': allMcolumns ofUand allNrows ofV**Tare returned in the arraysUandVT;= 'S': the firstmin(M,N)columns ofUand the firstmin(M,N)rows ofV**Tare returned in the arraysUandVT;= 'O': IfM >= N, the firstNcolumns ofUare overwritten on the arrayAand all rows ofV**Tare returned in the arrayVT; otherwise, all columns ofUare returned in the arrayUand the firstMrows ofV**Tare overwritten in the arrayA;= 'N': no columns ofUor rows ofV**Tare computed. π
MβMisINTEGER. The number of rows of the input matrixA.M >= 0. πΈNβNisINTEGER. The number of columns of the input matrixA.N >= 0. π¦AβAisREALarray, dimension(LDA,N). On entry, theM-by-NmatrixA. On exit, ifJOBZ = 'O',Ais overwritten with the firstNcolumns ofU(the left singular vectors, stored columnwise) ifM >= N;Ais overwritten with the firstMrows ofV**T(the right singular vectors, stored rowwise) otherwise. IfJOBZ .ne. 'O', the contents ofAare destroyed. πLDAβLDAisINTEGER. Leading dimension of the arrayA.LDA >= max(1,M). β¨SβSisREALarray, dimension(min(M,N)). The singular values ofA, sorted so thatS(i) >= S(i+1). πUβUisREALarray, dimension(LDU,UCOL).UCOL = MifJOBZ = 'A'orJOBZ = 'O'andM < N;UCOL = min(M,N)ifJOBZ = 'S'. IfJOBZ = 'A'orJOBZ = 'O'andM < N,Ucontains theM-by-Morthogonal matrixU; ifJOBZ = 'S',Ucontains the firstmin(M,N)columns ofU(the left singular vectors, stored columnwise); ifJOBZ = 'O'andM >= N, orJOBZ = 'N',Uis not referenced. πLDUβLDUisINTEGER. Leading dimension of the arrayU.LDU >= 1; ifJOBZ = 'S'or'A'orJOBZ = 'O'andM < N,LDU >= M. π«ΆVTβVTisREALarray, dimension(LDVT,N). IfJOBZ = 'A'orJOBZ = 'O'andM >= N,VTcontains theN-by-Northogonal matrixV**T; ifJOBZ = 'S',VTcontains the firstmin(M,N)rows ofV**T(the right singular vectors, stored rowwise); ifJOBZ = 'O'andM < N, orJOBZ = 'N',VTis not referenced. πLDVTβLDVTisINTEGER. Leading dimension of the arrayVT.LDVT >= 1; ifJOBZ = 'A'orJOBZ = 'O'andM >= N,LDVT >= N; ifJOBZ = 'S',LDVT >= min(M,N). πWORKβWORKisREALarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK; π₯LWORKβLWORKisINTEGER. The dimension of the arrayWORK.LWORK >= 1. IfLWORK = -1, a workspace query is assumed. The optimal size for theWORKarray is calculated and stored inWORK(1), and no other work except argument checking is performed. Letmx = max(M,N)andmn = min(M,N). IfJOBZ = 'N',LWORK >= 3*mn + max( mx, 7*mn ). IfJOBZ = 'O',LWORK >= 3*mn + max( mx, 5*mn*mn + 4*mn ). IfJOBZ = 'S',LWORK >= 4*mn*mn + 7*mn. IfJOBZ = 'A',LWORK >= 4*mn*mn + 6*mn + mx. These are not tight minimums in all cases; see comments inside code. For good performance,LWORKshould generally be larger; a query is recommended. πIWORKβIWORKisINTEGERarray, dimension(8*min(M,N)). πINFOβINFOisINTEGER.< 0: ifINFO = -i, thei-th argument had an illegal value.= -4: ifAhad aNANentry.> 0:SBDSDCdid not converge, updating process failed.= 0: successful exit. π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors
Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA π§
Definition at line 211 of file sgesdd.f.
subroutine zgesdd
subroutine zgesdd (character jobz, integer m, integer n, complex*16,
dimension( lda, * ) a, integer lda, double precision, dimension( * ) s,
complex*16, dimension( ldu, * ) u, integer ldu, complex*16, dimension(
ldvt, * ) vt, integer ldvt, complex*16, dimension( * ) work, integer
lwork, double precision, dimension( * ) rwork, integer, dimension( * )
iwork, integer info)
ZGESDD π
Purpose
ZGESDD computes the singular value decomposition (SVD) of a complex M-by-N matrix A, optionally computing the left and/or right singular vectors, by using divide-and-conquer method. The SVD is written
A = U * SIGMA * conjugate-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 unitary matrix, and V is an N-by-N unitary 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 returns VT = V**H, not V. π«Ά
Parameters
JOBZJOBZisCHARACTER*1β the main character option: it specifies options for computing all or part of the matrixU, and it's giving choose-your-own-adventure π'A': allMcolumns ofUand allNrows ofV**Hare returned in the arraysUandVT;'S': the firstmin(M,N)columns ofUand the firstmin(M,N)rows ofV**Hare returned in the arraysUandVT;'O': ifM >= N, the firstNcolumns ofUare overwritten in the arrayAand all rows ofV**Hare returned in the arrayVT; otherwise, all columns ofUare returned in the arrayUand the firstMrows ofV**Hare overwritten in the arrayA;'N': no columns ofUor rows ofV**Hare computed.
MisINTEGERβ the number of rows of the input matrixA.M >= 0.NisINTEGERβ the number of columns of the input matrixA.N >= 0.AisCOMPLEX*16array, dimension(LDA,N)β on entry, theM-by-NmatrixA. On exit: ifJOBZ = 'O',Ais overwritten with the firstNcolumns ofU(the left singular vectors, stored columnwise) ifM >= N;Ais overwritten with the firstMrows ofV**H(the right singular vectors, stored rowwise) otherwise. IfJOBZ .ne. 'O', the contents ofAare destroyed. Destroyed, bestie β not preserved.LDAisINTEGERβ the leading dimension of the arrayA.LDA >= max(1,M).SisDOUBLE PRECISIONarray, dimension(min(M,N))β the singular values ofA, sorted so thatS(i) >= S(i+1).UisCOMPLEX*16array, dimension(LDU,UCOL)βUCOL = MifJOBZ = 'A'orJOBZ = 'O'andM < N;UCOL = min(M,N)ifJOBZ = 'S'. IfJOBZ = 'A'orJOBZ = 'O'andM < N,Ucontains theM-by-Munitary matrixU; ifJOBZ = 'S',Ucontains the firstmin(M,N)columns ofU(the left singular vectors, stored columnwise); ifJOBZ = 'O'andM >= N, orJOBZ = 'N',Uis not referenced.LDUisINTEGERβ the leading dimension of the arrayU.LDU >= 1; ifJOBZ = 'S'or'A'orJOBZ = 'O'andM < N,LDU >= M.VTisCOMPLEX*16array, dimension(LDVT,N)β ifJOBZ = 'A'orJOBZ = 'O'andM >= N,VTcontains theN-by-Nunitary matrixV**H; ifJOBZ = 'S',VTcontains the firstmin(M,N)rows ofV**H(the right singular vectors, stored rowwise); ifJOBZ = 'O'andM < N, orJOBZ = 'N',VTis not referenced.LDVTisINTEGERβ the leading dimension of the arrayVT.LDVT >= 1; ifJOBZ = 'A'orJOBZ = 'O'andM >= N,LDVT >= N; ifJOBZ = 'S',LDVT >= min(M,N).WORKisCOMPLEX*16array, dimension(MAX(1,LWORK))β on exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKisINTEGERβ the dimension of the arrayWORK.LWORK >= 1. IfLWORK = -1, a workspace query is assumed: the optimal size for theWORKarray is calculated and stored inWORK(1), and no other work except argument checking is performed. Letmx = max(M,N)andmn = min(M,N).- If
JOBZ = 'N',LWORK >= 2*mn + mx. - If
JOBZ = 'O',LWORK >= 2*mn*mn + 2*mn + mx. - If
JOBZ = 'S',LWORK >= mn*mn + 3*mn. - If
JOBZ = 'A',LWORK >= mn*mn + 2*mn + mx. These are not tight minimums in all cases; see comments inside code. For good performance,LWORKshould generally be larger; a query is recommended. Don't skimp on the workspace, bestie β she needs room.
- If
RWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LRWORK))β letmx = max(M,N)andmn = min(M,N). IfJOBZ = 'N',LRWORK >= 5*mn(LAPACK <= 3.6needs7*mn); else ifmx >> mn,LRWORK >= 5*mn*mn + 5*mn; elseLRWORK >= max( 5*mn*mn + 5*mn, 2*mx*mn + 2*mn*mn + mn ).IWORKisINTEGERarray, dimension(8*min(M,N)).INFOisINTEGERβ the exit-status gossip:INFO < 0: ifINFO = -i, the i-th argument had an illegal value.INFO = -4: ifAhad aNANentry.INFO > 0: The updating process ofDBDSDCdid not converge.INFO = 0: successful exit.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Contributors
Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA
Definition at line 219 of file zgesdd.f.
π€ Author
Generated automatically by Doxygen for LAPACK from the source code.
That's the whole page, bestie π source: LAPACK Β· version: 3.12.0 Β· footer date/page tag: gesdd(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