gesvd#
Functions
-
void sgesvd(const char *jobu, const char *jobvt, const INT m, const INT n, f32 *restrict A, const INT lda, f32 *restrict S, f32 *restrict U, const INT ldu, f32 *restrict VT, const INT ldvt, f32 *restrict work, const INT lwork, INT *info)#
SGESVD computes the singular value decomposition (SVD) of a real
m-by-nmatrixA, optionally computing the left and/or right singular vectors.The SVD is written
where SIGMA is anA = U * SIGMA * transpose(V)
m-by-nmatrix which is zero except for itsmin(m,n)diagonal elements, U is anm-by-morthogonal matrix, and V is ann-by-northogonal matrix. The diagonal elements of SIGMA are the singular values ofA; they are real and non-negative, and are returned in descending order. The firstmin(m,n)columns of U and V are the left and right singular vectors ofA.Note that the routine returns
V**T, not V.Parameters
injobuSpecifies options for computing all or part of
U:'A': allmcolumns ofUare returned in arrayU;'S': the firstmin(m,n)columns ofUare returned inU;'O': the firstmin(m,n)columns ofUare overwritten onA;'N': no columns ofUare computed.injobvtSpecifies options for computing all or part of
V**T:'A': allnrows ofV**Tare returned in arrayVT;'S': the firstmin(m,n)rows ofV**Tare returned inVT;'O': the firstmin(m,n)rows ofV**Tare overwritten onA;'N': no rows ofV**Tare computed.jobvtandjobucannot both be'O'.inmThe number of rows of the input matrix
A.m>=0.innThe number of columns of the input matrix
A.n>=0.inoutASingle precision array, dimension (
lda,n). On entry, them-by-nmatrixA. On exit, contents depend onjobuandjobvt.inldaThe leading dimension of the array
A.lda>=max(1,m).outSSingle precision array, dimension (
min(m,n)). The singular values ofA, sorted so thatS[i]>=S[i+1].outUSingle precision array, dimension (
ldu, ucol). Ifjobu='A',Ucontains them-by-morthogonal matrixU; ifjobu='S',Ucontains the firstmin(m,n)columns ofU; ifjobu='N'or'O',Uis not referenced.inlduThe leading dimension of the array
U.ldu>=1; ifjobu='S'or'A',ldu>=m.outVTSingle precision array, dimension (
ldvt,n). Ifjobvt='A',VTcontains then-by-northogonal matrixV**T; ifjobvt='S',VTcontains the firstmin(m,n)rows ofV**T; ifjobvt='N'or'O',VTis not referenced.inldvtThe leading dimension of the array
VT.ldvt>=1; ifjobvt='A',ldvt>=n; ifjobvt='S',ldvt>=min(m,n).outworkSingle precision array, dimension (
max(1,lwork)). On exit, ifinfo=0,work[0]returns the optimallwork; ifinfo>0,work[1:min(m,n)-1]contains the unconverged superdiagonal elements of an upper bidiagonal matrix B whose diagonal is inS(not necessarily sorted). B satisfiesA = U * B * VT, so it has the same singular values asA, and singular vectors related byUandVT.inlworkThe dimension of the array
work.lwork >= max(1, 5*min(m,n))for the paths (see comments inside code):PATH 1 (m much larger than n,
jobu='N')PATH 1t (n much larger than m,
jobvt='N')
For good performance,lwork >= max(1, 3*min(m,n) + max(m,n), 5*min(m,n))for the other paths.lworkshould generally be larger. Iflwork=-1, a workspace query is assumed; the routine only calculates the optimal size of theworkarray, returns this value as the first entry of theworkarray.outinfoinfo=0: successful exit.info<0: ifinfo=-i, the i-th argument had an illegal value.info>0: if SBDSQR did not converge,infospecifies how many superdiagonals of an intermediate bidiagonal form B did not converge to zero. See the description ofworkabove for details.
void sgesvd(
const char* jobu,
const char* jobvt,
const INT m,
const INT n,
f32* restrict A,
const INT lda,
f32* restrict S,
f32* restrict U,
const INT ldu,
f32* restrict VT,
const INT ldvt,
f32* restrict work,
const INT lwork,
INT* info
);
Functions
-
void dgesvd(const char *jobu, const char *jobvt, const INT m, const INT n, f64 *restrict A, const INT lda, f64 *restrict S, f64 *restrict U, const INT ldu, f64 *restrict VT, const INT ldvt, f64 *restrict work, const INT lwork, INT *info)#
DGESVD computes the singular value decomposition (SVD) of a real
m-by-nmatrixA, optionally computing the left and/or right singular vectors.The SVD is written
where SIGMA is anA = U * SIGMA * transpose(V)
m-by-nmatrix which is zero except for itsmin(m,n)diagonal elements, U is anm-by-morthogonal matrix, and V is ann-by-northogonal matrix. The diagonal elements of SIGMA are the singular values ofA; they are real and non-negative, and are returned in descending order. The firstmin(m,n)columns of U and V are the left and right singular vectors ofA.Note that the routine returns
V**T, not V.Parameters
injobuSpecifies options for computing all or part of
U:'A': allmcolumns ofUare returned in arrayU;'S': the firstmin(m,n)columns ofUare returned inU;'O': the firstmin(m,n)columns ofUare overwritten onA;'N': no columns ofUare computed.injobvtSpecifies options for computing all or part of
V**T:'A': allnrows ofV**Tare returned in arrayVT;'S': the firstmin(m,n)rows ofV**Tare returned inVT;'O': the firstmin(m,n)rows ofV**Tare overwritten onA;'N': no rows ofV**Tare computed.jobvtandjobucannot both be'O'.inmThe number of rows of the input matrix
A.m>=0.innThe number of columns of the input matrix
A.n>=0.inoutADouble precision array, dimension (
lda,n). On entry, them-by-nmatrixA. On exit, contents depend onjobuandjobvt.inldaThe leading dimension of the array
A.lda>=max(1,m).outSDouble precision array, dimension (
min(m,n)). The singular values ofA, sorted so thatS[i]>=S[i+1].outUDouble precision array, dimension (
ldu, ucol). Ifjobu='A',Ucontains them-by-morthogonal matrixU; ifjobu='S',Ucontains the firstmin(m,n)columns ofU; ifjobu='N'or'O',Uis not referenced.inlduThe leading dimension of the array
U.ldu>=1; ifjobu='S'or'A',ldu>=m.outVTDouble precision array, dimension (
ldvt,n). Ifjobvt='A',VTcontains then-by-northogonal matrixV**T; ifjobvt='S',VTcontains the firstmin(m,n)rows ofV**T; ifjobvt='N'or'O',VTis not referenced.inldvtThe leading dimension of the array
VT.ldvt>=1; ifjobvt='A',ldvt>=n; ifjobvt='S',ldvt>=min(m,n).outworkDouble precision array, dimension (
max(1,lwork)). On exit, ifinfo=0,work[0]returns the optimallwork; ifinfo>0,work[1:min(m,n)-1]contains the unconverged superdiagonal elements of an upper bidiagonal matrix B whose diagonal is inS(not necessarily sorted). B satisfiesA = U * B * VT, so it has the same singular values asA, and singular vectors related byUandVT.inlworkThe dimension of the array
work.lwork >= max(1, 5*min(m,n))for the paths (see comments inside code):PATH 1 (m much larger than n,
jobu='N')PATH 1t (n much larger than m,
jobvt='N')
For good performance,lwork >= max(1, 3*min(m,n) + max(m,n), 5*min(m,n))for the other paths.lworkshould generally be larger. Iflwork=-1, a workspace query is assumed; the routine only calculates the optimal size of theworkarray, returns this value as the first entry of theworkarray.outinfoinfo=0: successful exit.info<0: ifinfo=-i, the i-th argument had an illegal value.info>0: if DBDSQR did not converge,infospecifies how many superdiagonals of an intermediate bidiagonal form B did not converge to zero. See the description ofworkabove for details.
void dgesvd(
const char* jobu,
const char* jobvt,
const INT m,
const INT n,
f64* restrict A,
const INT lda,
f64* restrict S,
f64* restrict U,
const INT ldu,
f64* restrict VT,
const INT ldvt,
f64* restrict work,
const INT lwork,
INT* info
);
Functions
-
void cgesvd(const char *jobu, const char *jobvt, const INT m, const INT n, c64 *restrict A, const INT lda, f32 *restrict S, c64 *restrict U, const INT ldu, c64 *restrict VT, const INT ldvt, c64 *restrict work, const INT lwork, f32 *restrict rwork, INT *info)#
CGESVD computes the singular value decomposition (SVD) of a complex
m-by-nmatrixA, optionally computing the left and/or right singular vectors.The SVD is written
where SIGMA is anA = U * SIGMA * conjugate-transpose(V)
m-by-nmatrix which is zero except for itsmin(m,n)diagonal elements, U is anm-by-munitary matrix, and V is ann-by-nunitary matrix. The diagonal elements of SIGMA are the singular values ofA; they are real and non-negative, and are returned in descending order. The firstmin(m,n)columns of U and V are the left and right singular vectors ofA.Note that the routine returns
V**H, not V.Parameters
injobuSpecifies options for computing all or part of
U:'A': allmcolumns ofUare returned in arrayU;'S': the firstmin(m,n)columns ofUare returned inU;'O': the firstmin(m,n)columns ofUare overwritten onA;'N': no columns ofUare computed.injobvtSpecifies options for computing all or part of
V**H:'A': allnrows ofV**Hare returned in arrayVT;'S': the firstmin(m,n)rows ofV**Hare returned inVT;'O': the firstmin(m,n)rows ofV**Hare overwritten onA;'N': no rows ofV**Hare computed.jobvtandjobucannot both be'O'.inmThe number of rows of the input matrix
A.m>=0.innThe number of columns of the input matrix
A.n>=0.inoutAComplex*8 array, dimension (
lda,n). On entry, them-by-nmatrixA. On exit, contents depend onjobuandjobvt.inldaThe leading dimension of the array
A.lda>=max(1,m).outSSingle precision array, dimension (
min(m,n)). The singular values ofA, sorted so thatS[i]>=S[i+1].outUComplex*8 array, dimension (
ldu, ucol). Ifjobu='A',Ucontains them-by-munitary matrixU; ifjobu='S',Ucontains the firstmin(m,n)columns ofU; ifjobu='N'or'O',Uis not referenced.inlduThe leading dimension of the array
U.ldu>=1; ifjobu='S'or'A',ldu>=m.outVTComplex*8 array, dimension (
ldvt,n). Ifjobvt='A',VTcontains then-by-nunitary matrixV**H; ifjobvt='S',VTcontains the firstmin(m,n)rows ofV**H; ifjobvt='N'or'O',VTis not referenced.inldvtThe leading dimension of the array
VT.ldvt>=1; ifjobvt='A',ldvt>=n; ifjobvt='S',ldvt>=min(m,n).outworkComplex*8 array, dimension (
max(1,lwork)). On exit, ifinfo=0,work[0]returns the optimallwork.inlworkThe dimension of the array
work.lwork>=max(1,2*min(m,n)+max(m,n)). For good performance,lworkshould generally be larger. Iflwork=-1, a workspace query is assumed; the routine only calculates the optimal size of theworkarray, returns this value as the first entry of theworkarray.outrworkSingle precision array, dimension (5*
min(m,n)). On exit, ifinfo>0,rwork[0:min(m,n)-2]contains the unconverged superdiagonal elements of an upper bidiagonal matrix B whose diagonal is inS(not necessarily sorted). B satisfiesA = U * B * VT, so it has the same singular values asA, and singular vectors related byUandVT.outinfoinfo=0: successful exit.info<0: ifinfo=-i, the i-th argument had an illegal value.info>0: if CBDSQR did not converge,infospecifies how many superdiagonals of an intermediate bidiagonal form B did not converge to zero. See the description ofrworkabove for details.
void cgesvd(
const char* jobu,
const char* jobvt,
const INT m,
const INT n,
c64* restrict A,
const INT lda,
f32* restrict S,
c64* restrict U,
const INT ldu,
c64* restrict VT,
const INT ldvt,
c64* restrict work,
const INT lwork,
f32* restrict rwork,
INT* info
);
Functions
-
void zgesvd(const char *jobu, const char *jobvt, const INT m, const INT n, c128 *restrict A, const INT lda, f64 *restrict S, c128 *restrict U, const INT ldu, c128 *restrict VT, const INT ldvt, c128 *restrict work, const INT lwork, f64 *restrict rwork, INT *info)#
ZGESVD computes the singular value decomposition (SVD) of a complex
m-by-nmatrixA, optionally computing the left and/or right singular vectors.The SVD is written
where SIGMA is anA = U * SIGMA * conjugate-transpose(V)
m-by-nmatrix which is zero except for itsmin(m,n)diagonal elements, U is anm-by-munitary matrix, and V is ann-by-nunitary matrix. The diagonal elements of SIGMA are the singular values ofA; they are real and non-negative, and are returned in descending order. The firstmin(m,n)columns of U and V are the left and right singular vectors ofA.Note that the routine returns
V**H, not V.Parameters
injobuSpecifies options for computing all or part of
U:'A': allmcolumns ofUare returned in arrayU;'S': the firstmin(m,n)columns ofUare returned inU;'O': the firstmin(m,n)columns ofUare overwritten onA;'N': no columns ofUare computed.injobvtSpecifies options for computing all or part of
V**H:'A': allnrows ofV**Hare returned in arrayVT;'S': the firstmin(m,n)rows ofV**Hare returned inVT;'O': the firstmin(m,n)rows ofV**Hare overwritten onA;'N': no rows ofV**Hare computed.jobvtandjobucannot both be'O'.inmThe number of rows of the input matrix
A.m>=0.innThe number of columns of the input matrix
A.n>=0.inoutAComplex*16 array, dimension (
lda,n). On entry, them-by-nmatrixA. On exit, contents depend onjobuandjobvt.inldaThe leading dimension of the array
A.lda>=max(1,m).outSDouble precision array, dimension (
min(m,n)). The singular values ofA, sorted so thatS[i]>=S[i+1].outUComplex*16 array, dimension (
ldu, ucol). Ifjobu='A',Ucontains them-by-munitary matrixU; ifjobu='S',Ucontains the firstmin(m,n)columns ofU; ifjobu='N'or'O',Uis not referenced.inlduThe leading dimension of the array
U.ldu>=1; ifjobu='S'or'A',ldu>=m.outVTComplex*16 array, dimension (
ldvt,n). Ifjobvt='A',VTcontains then-by-nunitary matrixV**H; ifjobvt='S',VTcontains the firstmin(m,n)rows ofV**H; ifjobvt='N'or'O',VTis not referenced.inldvtThe leading dimension of the array
VT.ldvt>=1; ifjobvt='A',ldvt>=n; ifjobvt='S',ldvt>=min(m,n).outworkComplex*16 array, dimension (
max(1,lwork)). On exit, ifinfo=0,work[0]returns the optimallwork.inlworkThe dimension of the array
work.lwork>=max(1,2*min(m,n)+max(m,n)). For good performance,lworkshould generally be larger. Iflwork=-1, a workspace query is assumed; the routine only calculates the optimal size of theworkarray, returns this value as the first entry of theworkarray.outrworkDouble precision array, dimension (5*
min(m,n)). On exit, ifinfo>0,rwork[0:min(m,n)-2]contains the unconverged superdiagonal elements of an upper bidiagonal matrix B whose diagonal is inS(not necessarily sorted). B satisfiesA = U * B * VT, so it has the same singular values asA, and singular vectors related byUandVT.outinfoinfo=0: successful exit.info<0: ifinfo=-i, the i-th argument had an illegal value.info>0: if ZBDSQR did not converge,infospecifies how many superdiagonals of an intermediate bidiagonal form B did not converge to zero. See the description ofrworkabove for details.
void zgesvd(
const char* jobu,
const char* jobvt,
const INT m,
const INT n,
c128* restrict A,
const INT lda,
f64* restrict S,
c128* restrict U,
const INT ldu,
c128* restrict VT,
const INT ldvt,
c128* restrict work,
const INT lwork,
f64* restrict rwork,
INT* info
);