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
);
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-m matrix B with diagonal D and offdiagonal E, where m = 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

in
icompq

Specifies 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.

in
smlsiz

The maximum size of the subproblems at the bottom of the computation tree.

in
n

The row dimension of the upper bidiagonal matrix. This is also the dimension of the main diagonal array D.

in
sqre

Specifies the column dimension of the bidiagonal matrix. sqre=0: The bidiagonal matrix has column dimension m=n; sqre=1: The bidiagonal matrix has column dimension m=n+1.

inout
D

Array of dimension (n). On entry D contains the main diagonal of the bidiagonal matrix. On exit D, if info=0, contains its singular values.

in
E

Array of dimension (m-1). Contains the subdiagonal entries of the bidiagonal matrix. On exit, E has been destroyed.

out
U

Array of dimension (ldu, smlsiz) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, U contains the left singular vector matrices of all subproblems at the bottom level.

in
ldu

ldu>=n. The leading dimension of arrays U, VT, DIFL, DIFR, POLES, GIVNUM, and Z.

out
VT

Array of dimension (ldu, smlsiz+1) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, VT**T contains the right singular vector matrices of all subproblems at the bottom level.

out
K

Integer array of dimension (n) if icompq=1 and dimension 1 if icompq=0. If icompq=1, on exit, K[i] is the dimension of the i-th secular equation on the computation tree.

out
DIFL

Array of dimension (ldu, nlvl), where nlvl = floor(log_2(n/smlsiz)).

out
DIFR

Array of dimension (ldu, 2*nlvl) if icompq=1 and dimension (n) if icompq=0. If icompq=1, on exit, DIFL[0:n-1, i] and DIFR[0:n-1, 2*i] record distances between singular values on the i-th level and singular values on the (i-1)-th level, and DIFR[0:n-1, 2*i+1] contains the normalizing factors for the right singular vector matrix. See SLASD8 for details.

out
Z

Array of dimension (ldu, nlvl) if icompq=1 and dimension (n) if icompq=0. The first K elements of Z[0, i] contain the components of the deflation-adjusted updating row vector for subproblems on the i-th level.

out
POLES

Array of dimension (ldu, 2*nlvl) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, POLES[0, 2*i] and POLES[0, 2*i+1] contain the new and old singular values involved in the secular equations on the i-th level.

out
GIVPTR

Integer array of dimension (n) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, GIVPTR[i] records the number of Givens rotations performed on the i-th problem on the computation tree.

out
GIVCOL

Integer array of dimension (ldgcol, 2*nlvl) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, for each i, GIVCOL[0, 2*i] and GIVCOL[0, 2*i+1] record the locations of Givens rotations performed on the i-th level on the computation tree.

in
ldgcol

ldgcol>=n. The leading dimension of arrays GIVCOL and PERM.

out
PERM

Integer array of dimension (ldgcol, nlvl) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, PERM[0, i] records permutations done on the i-th level of the computation tree.

out
GIVNUM

Array of dimension (ldu, 2*nlvl) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, for each i, GIVNUM[0, 2*i] and GIVNUM[0, 2*i+1] record the C- and S- values of Givens rotations performed on the i-th level on the computation tree.

out
C

Array of dimension (n) if icompq=1, and dimension 1 if icompq=0. If icompq=1 and 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.

out
S

Array of dimension (n) if icompq=1, and dimension 1 if icompq=0. If icompq=1 and 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.

out
work

Array of dimension (6*n + (smlsiz+1)*(smlsiz+1)).

out
IWORK

Integer array of dimension (7*n).

out
info

info=0: successful exit. info<0: if info=-i, the i-th argument had an illegal value. info>0: if info=1, a singular value did not converge.

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
);
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-m matrix B with diagonal D and offdiagonal E, where m = 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

in
icompq

Specifies 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.

in
smlsiz

The maximum size of the subproblems at the bottom of the computation tree.

in
n

The row dimension of the upper bidiagonal matrix. This is also the dimension of the main diagonal array D.

in
sqre

Specifies the column dimension of the bidiagonal matrix. sqre=0: The bidiagonal matrix has column dimension m=n; sqre=1: The bidiagonal matrix has column dimension m=n+1.

inout
D

Array of dimension (n). On entry D contains the main diagonal of the bidiagonal matrix. On exit D, if info=0, contains its singular values.

in
E

Array of dimension (m-1). Contains the subdiagonal entries of the bidiagonal matrix. On exit, E has been destroyed.

out
U

Array of dimension (ldu, smlsiz) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, U contains the left singular vector matrices of all subproblems at the bottom level.

in
ldu

ldu>=n. The leading dimension of arrays U, VT, DIFL, DIFR, POLES, GIVNUM, and Z.

out
VT

Array of dimension (ldu, smlsiz+1) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, VT**T contains the right singular vector matrices of all subproblems at the bottom level.

out
K

Integer array of dimension (n) if icompq=1 and dimension 1 if icompq=0. If icompq=1, on exit, K[i] is the dimension of the i-th secular equation on the computation tree.

out
DIFL

Array of dimension (ldu, nlvl), where nlvl = floor(log_2(n/smlsiz)).

out
DIFR

Array of dimension (ldu, 2*nlvl) if icompq=1 and dimension (n) if icompq=0. If icompq=1, on exit, DIFL[0:n-1, i] and DIFR[0:n-1, 2*i] record distances between singular values on the i-th level and singular values on the (i-1)-th level, and DIFR[0:n-1, 2*i+1] contains the normalizing factors for the right singular vector matrix. See DLASD8 for details.

out
Z

Array of dimension (ldu, nlvl) if icompq=1 and dimension (n) if icompq=0. The first K elements of Z[0, i] contain the components of the deflation-adjusted updating row vector for subproblems on the i-th level.

out
POLES

Array of dimension (ldu, 2*nlvl) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, POLES[0, 2*i] and POLES[0, 2*i+1] contain the new and old singular values involved in the secular equations on the i-th level.

out
GIVPTR

Integer array of dimension (n) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, GIVPTR[i] records the number of Givens rotations performed on the i-th problem on the computation tree.

out
GIVCOL

Integer array of dimension (ldgcol, 2*nlvl) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, for each i, GIVCOL[0, 2*i] and GIVCOL[0, 2*i+1] record the locations of Givens rotations performed on the i-th level on the computation tree.

in
ldgcol

ldgcol>=n. The leading dimension of arrays GIVCOL and PERM.

out
PERM

Integer array of dimension (ldgcol, nlvl) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, PERM[0, i] records permutations done on the i-th level of the computation tree.

out
GIVNUM

Array of dimension (ldu, 2*nlvl) if icompq=1, and not referenced if icompq=0. If icompq=1, on exit, for each i, GIVNUM[0, 2*i] and GIVNUM[0, 2*i+1] record the C- and S- values of Givens rotations performed on the i-th level on the computation tree.

out
C

Array of dimension (n) if icompq=1, and dimension 1 if icompq=0. If icompq=1 and 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.

out
S

Array of dimension (n) if icompq=1, and dimension 1 if icompq=0. If icompq=1 and 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.

out
work

Array of dimension (6*n + (smlsiz+1)*(smlsiz+1)).

out
IWORK

Integer array of dimension (7*n).

out
info

info=0: successful exit. info<0: if info=-i, the i-th argument had an illegal value. info>0: if info=1, a singular value did not converge.