lalsd#

Functions

void slalsd(
    const char*          uplo,
    const INT            smlsiz,
    const INT            n,
    const INT            nrhs,
          f32*  restrict D,
          f32*  restrict E,
          f32*  restrict B,
    const INT            ldb,
    const f32            rcond,
          INT*           rank,
          f32*  restrict work,
          INT*  restrict iwork,
          INT*           info
);
void slalsd(const char *uplo, const INT smlsiz, const INT n, const INT nrhs, f32 *restrict D, f32 *restrict E, f32 *restrict B, const INT ldb, const f32 rcond, INT *rank, f32 *restrict work, INT *restrict iwork, INT *info)#

SLALSD uses the singular value decomposition of A to solve the least squares problem of finding X to minimize the Euclidean norm of each column of A*X-B, where A is N-by-N upper bidiagonal, and X and B are N-by-NRHS.

The solution X overwrites B.

The singular values of A smaller than RCOND times the largest singular value are treated as zero in solving the least squares problem; in this case a minimum norm solution is returned. The actual singular values are returned in D in ascending order.

Parameters

in
uplo

= ‘U’: D and E define an upper bidiagonal matrix. = ‘L’: D and E define a lower bidiagonal matrix.

in
smlsiz

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

in
n

The dimension of the bidiagonal matrix. n >= 0.

in
nrhs

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

inout
D

Array of dimension n. On entry, the main diagonal. On exit, the singular values in ascending order.

inout
E

Array of dimension n-1. On entry, the super-diagonal. On exit, E has been destroyed.

inout
B

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

in
ldb

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

in
rcond

The singular values less than or equal to rcond*max(S) are treated as zero. If rcond < 0, machine precision is used.

out
rank

The number of singular values > rcond*max(S).

out
work

Array of dimension at least (9*n + 2*n*smlsiz + 8*n*nlvl + n*nrhs + (smlsiz+1)^2).

out
iwork

Integer array of dimension at least (3*n*nlvl + 11*n).

out
info

  • = 0: successful exit.

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

  • > 0: The algorithm failed to compute a singular value.

Functions

void dlalsd(
    const char*          uplo,
    const INT            smlsiz,
    const INT            n,
    const INT            nrhs,
          f64*  restrict D,
          f64*  restrict E,
          f64*  restrict B,
    const INT            ldb,
    const f64            rcond,
          INT*           rank,
          f64*  restrict work,
          INT*  restrict iwork,
          INT*           info
);
void dlalsd(const char *uplo, const INT smlsiz, const INT n, const INT nrhs, f64 *restrict D, f64 *restrict E, f64 *restrict B, const INT ldb, const f64 rcond, INT *rank, f64 *restrict work, INT *restrict iwork, INT *info)#

DLALSD uses the singular value decomposition of A to solve the least squares problem of finding X to minimize the Euclidean norm of each column of A*X-B, where A is N-by-N upper bidiagonal, and X and B are N-by-NRHS.

The solution X overwrites B.

The singular values of A smaller than RCOND times the largest singular value are treated as zero in solving the least squares problem; in this case a minimum norm solution is returned. The actual singular values are returned in D in ascending order.

Parameters

in
uplo

= ‘U’: D and E define an upper bidiagonal matrix. = ‘L’: D and E define a lower bidiagonal matrix.

in
smlsiz

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

in
n

The dimension of the bidiagonal matrix. n >= 0.

in
nrhs

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

inout
D

Array of dimension n. On entry, the main diagonal. On exit, the singular values in ascending order.

inout
E

Array of dimension n-1. On entry, the super-diagonal. On exit, E has been destroyed.

inout
B

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

in
ldb

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

in
rcond

The singular values less than or equal to rcond*max(S) are treated as zero. If rcond < 0, machine precision is used.

out
rank

The number of singular values > rcond*max(S).

out
work

Array of dimension at least (9*n + 2*n*smlsiz + 8*n*nlvl + n*nrhs + (smlsiz+1)^2).

out
iwork

Integer array of dimension at least (3*n*nlvl + 11*n).

out
info

  • = 0: successful exit.

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

  • > 0: The algorithm failed to compute a singular value.

Functions

void clalsd(
    const char*          uplo,
    const INT            smlsiz,
    const INT            n,
    const INT            nrhs,
          f32*  restrict D,
          f32*  restrict E,
          c64*  restrict B,
    const INT            ldb,
    const f32            rcond,
          INT*           rank,
          c64*  restrict work,
          f32*  restrict rwork,
          INT*  restrict iwork,
          INT*           info
);
void clalsd(const char *uplo, const INT smlsiz, const INT n, const INT nrhs, f32 *restrict D, f32 *restrict E, c64 *restrict B, const INT ldb, const f32 rcond, INT *rank, c64 *restrict work, f32 *restrict rwork, INT *restrict iwork, INT *info)#

CLALSD uses the singular value decomposition of A to solve the least squares problem of finding X to minimize the Euclidean norm of each column of A*X-B, where A is N-by-N upper bidiagonal, and X and B are N-by-NRHS.

The solution X overwrites B.

The singular values of A smaller than RCOND times the largest singular value are treated as zero in solving the least squares problem; in this case a minimum norm solution is returned. The actual singular values are returned in D in ascending order.

Parameters

in
uplo

= ‘U’: D and E define an upper bidiagonal matrix. = ‘L’: D and E define a lower bidiagonal matrix.

in
smlsiz

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

in
n

The dimension of the bidiagonal matrix. n >= 0.

in
nrhs

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

inout
D

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

inout
E

Double array, dimension (N-1). Contains the super-diagonal entries of the bidiagonal matrix. On exit, E has been destroyed.

inout
B

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

in
ldb

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

in
rcond

The singular values of A less than or equal to RCOND times the largest singular value are treated as zero in solving the least squares problem. If RCOND is negative, machine precision is used instead. For example, if diag(S)*X=B were the least squares problem, where diag(S) is a diagonal matrix of singular values, the solution would be X(i) = B(i) / S(i) if S(i) is greater than RCOND*max(S), and X(i) = 0 if S(i) is less than or equal to RCOND*max(S).

out
rank

The number of singular values of A greater than RCOND times the largest singular value.

out
work

Complex array, dimension (N * NRHS).

out
rwork

Double array, dimension at least (9*N + 2*N*SMLSIZ + 8*N*NLVL + 3*SMLSIZ*NRHS + max((SMLSIZ+1)**2, N*(1+NRHS) + 2*NRHS)), where NLVL = max(0, INT(LOG_2(MIN(M,N)/(SMLSIZ+1))) + 1).

out
iwork

Integer array, dimension at least (3*N*NLVL + 11*N).

out
info

= 0: successful exit. < 0: if info = -i, the i-th argument had an illegal value. > 0: The algorithm failed to compute a singular value while working on the submatrix lying in rows and columns INFO/(N+1) through MOD(INFO,N+1).

Functions

void zlalsd(
    const char*          uplo,
    const INT            smlsiz,
    const INT            n,
    const INT            nrhs,
          f64*  restrict D,
          f64*  restrict E,
          c128* restrict B,
    const INT            ldb,
    const f64            rcond,
          INT*           rank,
          c128* restrict work,
          f64*  restrict rwork,
          INT*  restrict iwork,
          INT*           info
);
void zlalsd(const char *uplo, const INT smlsiz, const INT n, const INT nrhs, f64 *restrict D, f64 *restrict E, c128 *restrict B, const INT ldb, const f64 rcond, INT *rank, c128 *restrict work, f64 *restrict rwork, INT *restrict iwork, INT *info)#

ZLALSD uses the singular value decomposition of A to solve the least squares problem of finding X to minimize the Euclidean norm of each column of A*X-B, where A is N-by-N upper bidiagonal, and X and B are N-by-NRHS.

The solution X overwrites B.

The singular values of A smaller than RCOND times the largest singular value are treated as zero in solving the least squares problem; in this case a minimum norm solution is returned. The actual singular values are returned in D in ascending order.

Parameters

in
uplo

= ‘U’: D and E define an upper bidiagonal matrix. = ‘L’: D and E define a lower bidiagonal matrix.

in
smlsiz

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

in
n

The dimension of the bidiagonal matrix. n >= 0.

in
nrhs

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

inout
D

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

inout
E

Double array, dimension (N-1). Contains the super-diagonal entries of the bidiagonal matrix. On exit, E has been destroyed.

inout
B

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

in
ldb

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

in
rcond

The singular values of A less than or equal to RCOND times the largest singular value are treated as zero in solving the least squares problem. If RCOND is negative, machine precision is used instead. For example, if diag(S)*X=B were the least squares problem, where diag(S) is a diagonal matrix of singular values, the solution would be X(i) = B(i) / S(i) if S(i) is greater than RCOND*max(S), and X(i) = 0 if S(i) is less than or equal to RCOND*max(S).

out
rank

The number of singular values of A greater than RCOND times the largest singular value.

out
work

Complex array, dimension (N * NRHS).

out
rwork

Double array, dimension at least (9*N + 2*N*SMLSIZ + 8*N*NLVL + 3*SMLSIZ*NRHS + max((SMLSIZ+1)**2, N*(1+NRHS) + 2*NRHS)), where NLVL = max(0, INT(LOG_2(MIN(M,N)/(SMLSIZ+1))) + 1).

out
iwork

Integer array, dimension at least (3*N*NLVL + 11*N).

out
info

= 0: successful exit. < 0: if info = -i, the i-th argument had an illegal value. > 0: The algorithm failed to compute a singular value while working on the submatrix lying in rows and columns INFO/(N+1) through MOD(INFO,N+1).