lasda#
Functions
-
void slasda(const INT icompq, const INT smlsiz, const INT n, const INT sqre, f32 *restrict D, f32 *restrict E, f32 *restrict U, const INT ldu, f32 *restrict VT, INT *restrict K, f32 *restrict DIFL, f32 *restrict DIFR, f32 *restrict Z, f32 *restrict POLES, INT *restrict GIVPTR, INT *restrict GIVCOL, const INT ldgcol, INT *restrict PERM, f32 *restrict GIVNUM, f32 *restrict C, f32 *restrict S, f32 *restrict work, INT *restrict IWORK, INT *info)#
Using a divide and conquer approach, SLASDA computes the singular value decomposition (SVD) of a real upper bidiagonal
n-by-mmatrix B with diagonalDand offdiagonalE, wherem = n + sqre.The algorithm computes the singular values in the SVD
B = U * S * VT. The orthogonal matrices U and VT are optionally computed in compact form.A related subroutine, SLASD0, computes the singular values and the singular vectors in explicit form.
- Contributors:
Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA
Parameters
inicompqSpecifies whether singular vectors are to be computed in compact form, as follows
icompq=0: Compute singular values only.icompq=1: Compute singular vectors of upper bidiagonal matrix in compact form.insmlsizThe maximum size of the subproblems at the bottom of the computation tree.
innThe row dimension of the upper bidiagonal matrix. This is also the dimension of the main diagonal array
D.insqreSpecifies the column dimension of the bidiagonal matrix.
sqre=0: The bidiagonal matrix has column dimensionm=n;sqre=1: The bidiagonal matrix has column dimensionm=n+1.inoutDArray of dimension (
n). On entryDcontains the main diagonal of the bidiagonal matrix. On exitD, ifinfo=0, contains its singular values.inEArray of dimension (
m-1). Contains the subdiagonal entries of the bidiagonal matrix. On exit,Ehas been destroyed.outUArray of dimension (
ldu,smlsiz) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit,Ucontains the left singular vector matrices of all subproblems at the bottom level.inlduldu>=n. The leading dimension of arraysU,VT,DIFL,DIFR,POLES,GIVNUM, andZ.outVTArray of dimension (
ldu,smlsiz+1) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit,VT**Tcontains the right singular vector matrices of all subproblems at the bottom level.outKInteger array of dimension (
n) ificompq=1and dimension 1 ificompq=0. Ificompq=1, on exit,K[i]is the dimension of the i-th secular equation on the computation tree.outDIFLArray of dimension (
ldu,nlvl), wherenlvl = floor(log_2(n/smlsiz)).outDIFRArray of dimension (
ldu,2*nlvl) ificompq=1and dimension (n) ificompq=0. Ificompq=1, on exit,DIFL[0:n-1, i]andDIFR[0:n-1, 2*i]record distances between singular values on the i-th level and singular values on the (i-1)-th level, andDIFR[0:n-1, 2*i+1]contains the normalizing factors for the right singular vector matrix. See SLASD8 for details.outZArray of dimension (
ldu,nlvl) ificompq=1and dimension (n) ificompq=0. The firstKelements ofZ[0, i]contain the components of the deflation-adjusted updating row vector for subproblems on the i-th level.outPOLESArray of dimension (
ldu,2*nlvl) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit,POLES[0, 2*i]andPOLES[0, 2*i+1]contain the new and old singular values involved in the secular equations on the i-th level.outGIVPTRInteger array of dimension (
n) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit,GIVPTR[i]records the number of Givens rotations performed on the i-th problem on the computation tree.outGIVCOLInteger array of dimension (
ldgcol,2*nlvl) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit, for each i,GIVCOL[0, 2*i]andGIVCOL[0, 2*i+1]record the locations of Givens rotations performed on the i-th level on the computation tree.inldgcolldgcol>=n. The leading dimension of arraysGIVCOLandPERM.outPERMInteger array of dimension (
ldgcol,nlvl) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit,PERM[0, i]records permutations done on the i-th level of the computation tree.outGIVNUMArray of dimension (
ldu,2*nlvl) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit, for each i,GIVNUM[0, 2*i]andGIVNUM[0, 2*i+1]record the C- and S- values of Givens rotations performed on the i-th level on the computation tree.outCArray of dimension (
n) ificompq=1, and dimension 1 ificompq=0. Ificompq=1and the i-th subproblem is not square, on exit,C[i]contains the C-value of a Givens rotation related to the right null space of the i-th subproblem.outSArray of dimension (
n) ificompq=1, and dimension 1 ificompq=0. Ificompq=1and the i-th subproblem is not square, on exit,S[i]contains the S-value of a Givens rotation related to the right null space of the i-th subproblem.outworkArray of dimension (
6*n + (smlsiz+1)*(smlsiz+1)).outIWORKInteger array of dimension (
7*n).outinfoinfo=0: successful exit.info<0: ifinfo=-i, the i-th argument had an illegal value.info>0: ifinfo=1, a singular value did not converge.
void slasda(
const INT icompq,
const INT smlsiz,
const INT n,
const INT sqre,
f32* restrict D,
f32* restrict E,
f32* restrict U,
const INT ldu,
f32* restrict VT,
INT* restrict K,
f32* restrict DIFL,
f32* restrict DIFR,
f32* restrict Z,
f32* restrict POLES,
INT* restrict GIVPTR,
INT* restrict GIVCOL,
const INT ldgcol,
INT* restrict PERM,
f32* restrict GIVNUM,
f32* restrict C,
f32* restrict S,
f32* restrict work,
INT* restrict IWORK,
INT* info
);
Functions
-
void dlasda(const INT icompq, const INT smlsiz, const INT n, const INT sqre, f64 *restrict D, f64 *restrict E, f64 *restrict U, const INT ldu, f64 *restrict VT, INT *restrict K, f64 *restrict DIFL, f64 *restrict DIFR, f64 *restrict Z, f64 *restrict POLES, INT *restrict GIVPTR, INT *restrict GIVCOL, const INT ldgcol, INT *restrict PERM, f64 *restrict GIVNUM, f64 *restrict C, f64 *restrict S, f64 *restrict work, INT *restrict IWORK, INT *info)#
Using a divide and conquer approach, DLASDA computes the singular value decomposition (SVD) of a real upper bidiagonal
n-by-mmatrix B with diagonalDand offdiagonalE, wherem = n + sqre.The algorithm computes the singular values in the SVD
B = U * S * VT. The orthogonal matrices U and VT are optionally computed in compact form.A related subroutine, DLASD0, computes the singular values and the singular vectors in explicit form.
- Contributors:
Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA
Parameters
inicompqSpecifies whether singular vectors are to be computed in compact form, as follows
icompq=0: Compute singular values only.icompq=1: Compute singular vectors of upper bidiagonal matrix in compact form.insmlsizThe maximum size of the subproblems at the bottom of the computation tree.
innThe row dimension of the upper bidiagonal matrix. This is also the dimension of the main diagonal array
D.insqreSpecifies the column dimension of the bidiagonal matrix.
sqre=0: The bidiagonal matrix has column dimensionm=n;sqre=1: The bidiagonal matrix has column dimensionm=n+1.inoutDArray of dimension (
n). On entryDcontains the main diagonal of the bidiagonal matrix. On exitD, ifinfo=0, contains its singular values.inEArray of dimension (
m-1). Contains the subdiagonal entries of the bidiagonal matrix. On exit,Ehas been destroyed.outUArray of dimension (
ldu,smlsiz) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit,Ucontains the left singular vector matrices of all subproblems at the bottom level.inlduldu>=n. The leading dimension of arraysU,VT,DIFL,DIFR,POLES,GIVNUM, andZ.outVTArray of dimension (
ldu,smlsiz+1) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit,VT**Tcontains the right singular vector matrices of all subproblems at the bottom level.outKInteger array of dimension (
n) ificompq=1and dimension 1 ificompq=0. Ificompq=1, on exit,K[i]is the dimension of the i-th secular equation on the computation tree.outDIFLArray of dimension (
ldu,nlvl), wherenlvl = floor(log_2(n/smlsiz)).outDIFRArray of dimension (
ldu,2*nlvl) ificompq=1and dimension (n) ificompq=0. Ificompq=1, on exit,DIFL[0:n-1, i]andDIFR[0:n-1, 2*i]record distances between singular values on the i-th level and singular values on the (i-1)-th level, andDIFR[0:n-1, 2*i+1]contains the normalizing factors for the right singular vector matrix. See DLASD8 for details.outZArray of dimension (
ldu,nlvl) ificompq=1and dimension (n) ificompq=0. The firstKelements ofZ[0, i]contain the components of the deflation-adjusted updating row vector for subproblems on the i-th level.outPOLESArray of dimension (
ldu,2*nlvl) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit,POLES[0, 2*i]andPOLES[0, 2*i+1]contain the new and old singular values involved in the secular equations on the i-th level.outGIVPTRInteger array of dimension (
n) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit,GIVPTR[i]records the number of Givens rotations performed on the i-th problem on the computation tree.outGIVCOLInteger array of dimension (
ldgcol,2*nlvl) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit, for each i,GIVCOL[0, 2*i]andGIVCOL[0, 2*i+1]record the locations of Givens rotations performed on the i-th level on the computation tree.inldgcolldgcol>=n. The leading dimension of arraysGIVCOLandPERM.outPERMInteger array of dimension (
ldgcol,nlvl) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit,PERM[0, i]records permutations done on the i-th level of the computation tree.outGIVNUMArray of dimension (
ldu,2*nlvl) ificompq=1, and not referenced ificompq=0. Ificompq=1, on exit, for each i,GIVNUM[0, 2*i]andGIVNUM[0, 2*i+1]record the C- and S- values of Givens rotations performed on the i-th level on the computation tree.outCArray of dimension (
n) ificompq=1, and dimension 1 ificompq=0. Ificompq=1and the i-th subproblem is not square, on exit,C[i]contains the C-value of a Givens rotation related to the right null space of the i-th subproblem.outSArray of dimension (
n) ificompq=1, and dimension 1 ificompq=0. Ificompq=1and the i-th subproblem is not square, on exit,S[i]contains the S-value of a Givens rotation related to the right null space of the i-th subproblem.outworkArray of dimension (
6*n + (smlsiz+1)*(smlsiz+1)).outIWORKInteger array of dimension (
7*n).outinfoinfo=0: successful exit.info<0: ifinfo=-i, the i-th argument had an illegal value.info>0: ifinfo=1, a singular value did not converge.
void dlasda(
const INT icompq,
const INT smlsiz,
const INT n,
const INT sqre,
f64* restrict D,
f64* restrict E,
f64* restrict U,
const INT ldu,
f64* restrict VT,
INT* restrict K,
f64* restrict DIFL,
f64* restrict DIFR,
f64* restrict Z,
f64* restrict POLES,
INT* restrict GIVPTR,
INT* restrict GIVCOL,
const INT ldgcol,
INT* restrict PERM,
f64* restrict GIVNUM,
f64* restrict C,
f64* restrict S,
f64* restrict work,
INT* restrict IWORK,
INT* info
);