lalsa#

Functions

void slalsa(
    const INT           icompq,
    const INT           smlsiz,
    const INT           n,
    const INT           nrhs,
          f32* restrict B,
    const INT           ldb,
          f32* restrict BX,
    const INT           ldbx,
    const f32* restrict U,
    const INT           ldu,
    const f32* restrict VT,
    const INT* restrict K,
    const f32* restrict difl,
    const f32* restrict difr,
    const f32* restrict Z,
    const f32* restrict poles,
    const INT* restrict givptr,
    const INT* restrict givcol,
    const INT           ldgcol,
    const INT* restrict perm,
    const f32* restrict givnum,
    const f32* restrict C,
    const f32* restrict S,
          f32* restrict work,
          INT* restrict iwork,
          INT*          info
);
void slalsa(const INT icompq, const INT smlsiz, const INT n, const INT nrhs, f32 *restrict B, const INT ldb, f32 *restrict BX, const INT ldbx, const f32 *restrict U, const INT ldu, const f32 *restrict VT, const INT *restrict K, const f32 *restrict difl, const f32 *restrict difr, const f32 *restrict Z, const f32 *restrict poles, const INT *restrict givptr, const INT *restrict givcol, const INT ldgcol, const INT *restrict perm, const f32 *restrict givnum, const f32 *restrict C, const f32 *restrict S, f32 *restrict work, INT *restrict iwork, INT *info)#

SLALSA is an intermediate step in solving the least squares problem by computing the SVD of the coefficient matrix in compact form (The singular vectors are computed as products of simple orthogonal matrices.).

If icompq = 0, SLALSA applies the inverse of the left singular vector matrix of an upper bidiagonal matrix to the right hand side; and if icompq = 1, SLALSA applies the right singular vector matrix to the right hand side. The singular vector matrices were generated in compact form by SLALSA.

Parameters

in
icompq

Specifies whether left or right singular vector matrix: = 0: Left singular vector matrix = 1: Right singular vector matrix

in
smlsiz

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

in
n

The row and column dimensions of the upper bidiagonal matrix.

in
nrhs

The number of columns of B and BX. nrhs >= 1.

inout
B

Array of dimension (ldb, nrhs). On input, contains the right hand sides. On output, contains the solution X.

in
ldb

The leading dimension of B. ldb >= max(1, n).

out
BX

Array of dimension (ldbx, nrhs). Workspace.

in
ldbx

The leading dimension of BX.

in
U

Array of dimension (ldu, smlsiz). Left singular vector matrices of subproblems at bottom level.

in
ldu

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

in
VT

Array of dimension (ldu, smlsiz+1). VT^T contains right singular vector matrices at bottom level.

in
K

Integer array of dimension n.

in
difl

Array of dimension (ldu, nlvl).

in
difr

Array of dimension (ldu, 2*nlvl).

in
Z

Array of dimension (ldu, nlvl).

in
poles

Array of dimension (ldu, 2*nlvl).

in
givptr

Integer array of dimension n.

in
givcol

Integer array of dimension (ldgcol, 2*nlvl).

in
ldgcol

Leading dimension of givcol and perm. ldgcol >= n.

in
perm

Integer array of dimension (ldgcol, nlvl).

in
givnum

Array of dimension (ldu, 2*nlvl).

in
C

Array of dimension n.

in
S

Array of dimension n.

out
work

Array of dimension n.

out
iwork

Integer array of dimension 3*n.

out
info

  • = 0: successful exit.

  • < 0: if info = -i, the i-th argument had illegal value.

Functions

void dlalsa(
    const INT           icompq,
    const INT           smlsiz,
    const INT           n,
    const INT           nrhs,
          f64* restrict B,
    const INT           ldb,
          f64* restrict BX,
    const INT           ldbx,
    const f64* restrict U,
    const INT           ldu,
    const f64* restrict VT,
    const INT* restrict K,
    const f64* restrict difl,
    const f64* restrict difr,
    const f64* restrict Z,
    const f64* restrict poles,
    const INT* restrict givptr,
    const INT* restrict givcol,
    const INT           ldgcol,
    const INT* restrict perm,
    const f64* restrict givnum,
    const f64* restrict C,
    const f64* restrict S,
          f64* restrict work,
          INT* restrict iwork,
          INT*          info
);
void dlalsa(const INT icompq, const INT smlsiz, const INT n, const INT nrhs, f64 *restrict B, const INT ldb, f64 *restrict BX, const INT ldbx, const f64 *restrict U, const INT ldu, const f64 *restrict VT, const INT *restrict K, const f64 *restrict difl, const f64 *restrict difr, const f64 *restrict Z, const f64 *restrict poles, const INT *restrict givptr, const INT *restrict givcol, const INT ldgcol, const INT *restrict perm, const f64 *restrict givnum, const f64 *restrict C, const f64 *restrict S, f64 *restrict work, INT *restrict iwork, INT *info)#

DLALSA is an intermediate step in solving the least squares problem by computing the SVD of the coefficient matrix in compact form (The singular vectors are computed as products of simple orthogonal matrices.).

If icompq = 0, DLALSA applies the inverse of the left singular vector matrix of an upper bidiagonal matrix to the right hand side; and if icompq = 1, DLALSA applies the right singular vector matrix to the right hand side. The singular vector matrices were generated in compact form by DLALSA.

Parameters

in
icompq

Specifies whether left or right singular vector matrix: = 0: Left singular vector matrix = 1: Right singular vector matrix

in
smlsiz

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

in
n

The row and column dimensions of the upper bidiagonal matrix.

in
nrhs

The number of columns of B and BX. nrhs >= 1.

inout
B

Array of dimension (ldb, nrhs). On input, contains the right hand sides. On output, contains the solution X.

in
ldb

The leading dimension of B. ldb >= max(1, n).

out
BX

Array of dimension (ldbx, nrhs). Workspace.

in
ldbx

The leading dimension of BX.

in
U

Array of dimension (ldu, smlsiz). Left singular vector matrices of subproblems at bottom level.

in
ldu

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

in
VT

Array of dimension (ldu, smlsiz+1). VT^T contains right singular vector matrices at bottom level.

in
K

Integer array of dimension n.

in
difl

Array of dimension (ldu, nlvl).

in
difr

Array of dimension (ldu, 2*nlvl).

in
Z

Array of dimension (ldu, nlvl).

in
poles

Array of dimension (ldu, 2*nlvl).

in
givptr

Integer array of dimension n.

in
givcol

Integer array of dimension (ldgcol, 2*nlvl).

in
ldgcol

Leading dimension of givcol and perm. ldgcol >= n.

in
perm

Integer array of dimension (ldgcol, nlvl).

in
givnum

Array of dimension (ldu, 2*nlvl).

in
C

Array of dimension n.

in
S

Array of dimension n.

out
work

Array of dimension n.

out
iwork

Integer array of dimension 3*n.

out
info

  • = 0: successful exit.

  • < 0: if info = -i, the i-th argument had illegal value.

Functions

void clalsa(
    const INT           icompq,
    const INT           smlsiz,
    const INT           n,
    const INT           nrhs,
          c64* restrict B,
    const INT           ldb,
          c64* restrict BX,
    const INT           ldbx,
    const f32* restrict U,
    const INT           ldu,
    const f32* restrict VT,
    const INT* restrict K,
    const f32* restrict difl,
    const f32* restrict difr,
    const f32* restrict Z,
    const f32* restrict poles,
    const INT* restrict givptr,
    const INT* restrict givcol,
    const INT           ldgcol,
    const INT* restrict perm,
    const f32* restrict givnum,
    const f32* restrict C,
    const f32* restrict S,
          f32* restrict rwork,
          INT* restrict iwork,
          INT*          info
);
void clalsa(const INT icompq, const INT smlsiz, const INT n, const INT nrhs, c64 *restrict B, const INT ldb, c64 *restrict BX, const INT ldbx, const f32 *restrict U, const INT ldu, const f32 *restrict VT, const INT *restrict K, const f32 *restrict difl, const f32 *restrict difr, const f32 *restrict Z, const f32 *restrict poles, const INT *restrict givptr, const INT *restrict givcol, const INT ldgcol, const INT *restrict perm, const f32 *restrict givnum, const f32 *restrict C, const f32 *restrict S, f32 *restrict rwork, INT *restrict iwork, INT *info)#

CLALSA is an intermediate step in solving the least squares problem by computing the SVD of the coefficient matrix in compact form (The singular vectors are computed as products of simple orthogonal matrices.).

If ICOMPQ = 0, CLALSA applies the inverse of the left singular vector matrix of an upper bidiagonal matrix to the right hand side; and if ICOMPQ = 1, CLALSA applies the right singular vector matrix to the right hand side. The singular vector matrices were generated in compact form by CLALSA.

Parameters

in
icompq

Specifies whether the left or the right singular vector matrix is involved. = 0: Left singular vector matrix = 1: Right singular vector matrix

in
smlsiz

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

in
n

The row and column dimensions of the upper bidiagonal matrix.

in
nrhs

The number of columns of B and BX. nrhs must be at least 1.

inout
B

Complex array, dimension (ldb, nrhs). On input, B contains the right hand sides of the least squares problem in rows 1 through M. On output, B contains the solution X in rows 1 through N.

in
ldb

The leading dimension of B in the calling subprogram. ldb must be at least max(1, max(M, N)).

out
BX

Complex array, dimension (ldbx, nrhs). On exit, the result of applying the left or right singular vector matrix to B.

in
ldbx

The leading dimension of BX.

in
U

Double array, dimension (ldu, smlsiz). On entry, U contains the left singular vector matrices of all subproblems at the bottom level.

in
ldu

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

in
VT

Double array, dimension (ldu, smlsiz+1). On entry, VT**H contains the right singular vector matrices of all subproblems at the bottom level.

in
K

Integer array, dimension (N).

in
difl

Double array, dimension (ldu, nlvl). where NLVL = INT(log_2 (N/(SMLSIZ+1))) + 1.

in
difr

Double array, dimension (ldu, 2 * nlvl). On entry, DIFL(*, I) and DIFR(*, 2 * I - 1) record distances between singular values on the I-th level and singular values on the (I-1)-th level, and DIFR(*, 2 * I) record the normalizing factors of the right singular vectors matrices of subproblems on I-th level.

in
Z

Double array, dimension (ldu, nlvl). On entry, Z(1, I) contains the components of the deflation- adjusted updating row vector for subproblems on the I-th level.

in
poles

Double array, dimension (ldu, 2 * nlvl). On entry, POLES(*, 2 * I - 1: 2 * I) contains the new and old singular values involved in the secular equations on the I-th level.

in
givptr

Integer array, dimension (N). On entry, GIVPTR(I) records the number of Givens rotations performed on the I-th problem on the computation tree.

in
givcol

Integer array, dimension (ldgcol, 2 * nlvl). On entry, for each I, GIVCOL(*, 2 * I - 1: 2 * I) records the locations of Givens rotations performed on the I-th level on the computation tree.

in
ldgcol

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

in
perm

Integer array, dimension (ldgcol, nlvl). On entry, PERM(*, I) records permutations done on the I-th level of the computation tree.

in
givnum

Double array, dimension (ldu, 2 * nlvl). On entry, GIVNUM(*, 2 * I - 1: 2 * I) records the C- and S- values of Givens rotations performed on the I-th level on the computation tree.

in
C

Double array, dimension (N). On entry, if the I-th subproblem is not square, C(I) contains the C-value of a Givens rotation related to the right null space of the I-th subproblem.

in
S

Double array, dimension (N). On entry, if the I-th subproblem is not square, S(I) contains the S-value of a Givens rotation related to the right null space of the I-th subproblem.

out
rwork

Double array, dimension at least max((SMLSIZ+1)*NRHS*3, N*(1+NRHS) + 2*NRHS).

out
iwork

Integer array, dimension (3*N).

out
info

= 0: successful exit. < 0: if info = -i, the i-th argument had an illegal value.

Functions

void zlalsa(
    const INT            icompq,
    const INT            smlsiz,
    const INT            n,
    const INT            nrhs,
          c128* restrict B,
    const INT            ldb,
          c128* restrict BX,
    const INT            ldbx,
    const f64*  restrict U,
    const INT            ldu,
    const f64*  restrict VT,
    const INT*  restrict K,
    const f64*  restrict difl,
    const f64*  restrict difr,
    const f64*  restrict Z,
    const f64*  restrict poles,
    const INT*  restrict givptr,
    const INT*  restrict givcol,
    const INT            ldgcol,
    const INT*  restrict perm,
    const f64*  restrict givnum,
    const f64*  restrict C,
    const f64*  restrict S,
          f64*  restrict rwork,
          INT*  restrict iwork,
          INT*           info
);
void zlalsa(const INT icompq, const INT smlsiz, const INT n, const INT nrhs, c128 *restrict B, const INT ldb, c128 *restrict BX, const INT ldbx, const f64 *restrict U, const INT ldu, const f64 *restrict VT, const INT *restrict K, const f64 *restrict difl, const f64 *restrict difr, const f64 *restrict Z, const f64 *restrict poles, const INT *restrict givptr, const INT *restrict givcol, const INT ldgcol, const INT *restrict perm, const f64 *restrict givnum, const f64 *restrict C, const f64 *restrict S, f64 *restrict rwork, INT *restrict iwork, INT *info)#

ZLALSA is an intermediate step in solving the least squares problem by computing the SVD of the coefficient matrix in compact form (The singular vectors are computed as products of simple orthogonal matrices.).

If ICOMPQ = 0, ZLALSA applies the inverse of the left singular vector matrix of an upper bidiagonal matrix to the right hand side; and if ICOMPQ = 1, ZLALSA applies the right singular vector matrix to the right hand side. The singular vector matrices were generated in compact form by ZLALSA.

Parameters

in
icompq

Specifies whether the left or the right singular vector matrix is involved. = 0: Left singular vector matrix = 1: Right singular vector matrix

in
smlsiz

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

in
n

The row and column dimensions of the upper bidiagonal matrix.

in
nrhs

The number of columns of B and BX. nrhs must be at least 1.

inout
B

Complex array, dimension (ldb, nrhs). On input, B contains the right hand sides of the least squares problem in rows 1 through M. On output, B contains the solution X in rows 1 through N.

in
ldb

The leading dimension of B in the calling subprogram. ldb must be at least max(1, max(M, N)).

out
BX

Complex array, dimension (ldbx, nrhs). On exit, the result of applying the left or right singular vector matrix to B.

in
ldbx

The leading dimension of BX.

in
U

Double array, dimension (ldu, smlsiz). On entry, U contains the left singular vector matrices of all subproblems at the bottom level.

in
ldu

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

in
VT

Double array, dimension (ldu, smlsiz+1). On entry, VT**H contains the right singular vector matrices of all subproblems at the bottom level.

in
K

Integer array, dimension (N).

in
difl

Double array, dimension (ldu, nlvl). where NLVL = INT(log_2 (N/(SMLSIZ+1))) + 1.

in
difr

Double array, dimension (ldu, 2 * nlvl). On entry, DIFL(*, I) and DIFR(*, 2 * I - 1) record distances between singular values on the I-th level and singular values on the (I-1)-th level, and DIFR(*, 2 * I) record the normalizing factors of the right singular vectors matrices of subproblems on I-th level.

in
Z

Double array, dimension (ldu, nlvl). On entry, Z(1, I) contains the components of the deflation- adjusted updating row vector for subproblems on the I-th level.

in
poles

Double array, dimension (ldu, 2 * nlvl). On entry, POLES(*, 2 * I - 1: 2 * I) contains the new and old singular values involved in the secular equations on the I-th level.

in
givptr

Integer array, dimension (N). On entry, GIVPTR(I) records the number of Givens rotations performed on the I-th problem on the computation tree.

in
givcol

Integer array, dimension (ldgcol, 2 * nlvl). On entry, for each I, GIVCOL(*, 2 * I - 1: 2 * I) records the locations of Givens rotations performed on the I-th level on the computation tree.

in
ldgcol

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

in
perm

Integer array, dimension (ldgcol, nlvl). On entry, PERM(*, I) records permutations done on the I-th level of the computation tree.

in
givnum

Double array, dimension (ldu, 2 * nlvl). On entry, GIVNUM(*, 2 * I - 1: 2 * I) records the C- and S- values of Givens rotations performed on the I-th level on the computation tree.

in
C

Double array, dimension (N). On entry, if the I-th subproblem is not square, C(I) contains the C-value of a Givens rotation related to the right null space of the I-th subproblem.

in
S

Double array, dimension (N). On entry, if the I-th subproblem is not square, S(I) contains the S-value of a Givens rotation related to the right null space of the I-th subproblem.

out
rwork

Double array, dimension at least max((SMLSIZ+1)*NRHS*3, N*(1+NRHS) + 2*NRHS).

out
iwork

Integer array, dimension (3*N).

out
info

= 0: successful exit. < 0: if info = -i, the i-th argument had an illegal value.