getsls#

Functions

void sgetsls(
    const char*          trans,
    const INT            m,
    const INT            n,
    const INT            nrhs,
          f32*  restrict A,
    const INT            lda,
          f32*  restrict B,
    const INT            ldb,
          f32*  restrict work,
    const INT            lwork,
          INT*           info
);
void sgetsls(const char *trans, const INT m, const INT n, const INT nrhs, f32 *restrict A, const INT lda, f32 *restrict B, const INT ldb, f32 *restrict work, const INT lwork, INT *info)#

SGETSLS solves overdetermined or underdetermined real linear systems involving an M-by-N matrix A, using a tall skinny QR or short wide LQ factorization of A.

It is assumed that A has full rank, and only a rudimentary protection against rank-deficient matrices is provided.

The following options are provided:

  1. If TRANS = ‘N’ and m >= n: find the least squares solution of an overdetermined system, minimize || B - A*X ||.

  2. If TRANS = ‘N’ and m < n: find the minimum norm solution of an underdetermined system A * X = B.

  3. If TRANS = ‘T’ and m >= n: find the minimum norm solution of an undetermined system A**T * X = B.

  4. If TRANS = ‘T’ and m < n: find the least squares solution of an overdetermined system, minimize || B - A**T * X ||.

Parameters

in
trans

= ‘N’: the linear system involves A; = ‘T’: the linear system involves A**T.

in
m

The number of rows of the matrix A. m >= 0.

in
n

The number of columns of the matrix A. n >= 0.

in
nrhs

The number of right hand sides. nrhs >= 0.

inout
A

Double precision array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR or LQ factorization.

in
lda

The leading dimension of the array A. lda >= max(1, m).

inout
B

Double precision array, dimension (ldb, nrhs). On entry, the right hand side matrix B. On exit, the solution vectors.

in
ldb

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

out
work

Double precision array, dimension (max(1, lwork)). On exit, if info = 0, work[0] contains the optimal lwork.

in
lwork

The dimension of the array work. If lwork = -1 or -2, a workspace query is assumed. If lwork = -1, returns optimal workspace size. If lwork = -2, returns minimal workspace size.

out
info

  • = 0: successful exit

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

  • > 0: if info = i, the i-th diagonal element of the triangular factor of A is exactly zero.

Functions

void dgetsls(
    const char*          trans,
    const INT            m,
    const INT            n,
    const INT            nrhs,
          f64*  restrict A,
    const INT            lda,
          f64*  restrict B,
    const INT            ldb,
          f64*  restrict work,
    const INT            lwork,
          INT*           info
);
void dgetsls(const char *trans, const INT m, const INT n, const INT nrhs, f64 *restrict A, const INT lda, f64 *restrict B, const INT ldb, f64 *restrict work, const INT lwork, INT *info)#

DGETSLS solves overdetermined or underdetermined real linear systems involving an M-by-N matrix A, using a tall skinny QR or short wide LQ factorization of A.

It is assumed that A has full rank, and only a rudimentary protection against rank-deficient matrices is provided.

The following options are provided:

  1. If TRANS = ‘N’ and m >= n: find the least squares solution of an overdetermined system, minimize || B - A*X ||.

  2. If TRANS = ‘N’ and m < n: find the minimum norm solution of an underdetermined system A * X = B.

  3. If TRANS = ‘T’ and m >= n: find the minimum norm solution of an undetermined system A**T * X = B.

  4. If TRANS = ‘T’ and m < n: find the least squares solution of an overdetermined system, minimize || B - A**T * X ||.

Parameters

in
trans

= ‘N’: the linear system involves A; = ‘T’: the linear system involves A**T.

in
m

The number of rows of the matrix A. m >= 0.

in
n

The number of columns of the matrix A. n >= 0.

in
nrhs

The number of right hand sides. nrhs >= 0.

inout
A

Double precision array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR or LQ factorization.

in
lda

The leading dimension of the array A. lda >= max(1, m).

inout
B

Double precision array, dimension (ldb, nrhs). On entry, the right hand side matrix B. On exit, the solution vectors.

in
ldb

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

out
work

Double precision array, dimension (max(1, lwork)). On exit, if info = 0, work[0] contains the optimal lwork.

in
lwork

The dimension of the array work. If lwork = -1 or -2, a workspace query is assumed. If lwork = -1, returns optimal workspace size. If lwork = -2, returns minimal workspace size.

out
info

  • = 0: successful exit

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

  • > 0: if info = i, the i-th diagonal element of the triangular factor of A is exactly zero.

Functions

void cgetsls(
    const char*          trans,
    const INT            m,
    const INT            n,
    const INT            nrhs,
          c64*  restrict A,
    const INT            lda,
          c64*  restrict B,
    const INT            ldb,
          c64*  restrict work,
    const INT            lwork,
          INT*           info
);
void cgetsls(const char *trans, const INT m, const INT n, const INT nrhs, c64 *restrict A, const INT lda, c64 *restrict B, const INT ldb, c64 *restrict work, const INT lwork, INT *info)#

CGETSLS solves overdetermined or underdetermined complex linear systems involving an M-by-N matrix A, using a tall skinny QR or short wide LQ factorization of A.

It is assumed that A has full rank, and only a rudimentary protection against rank-deficient matrices is provided.

The following options are provided:

  1. If TRANS = ‘N’ and m >= n: find the least squares solution of an overdetermined system, minimize || B - A*X ||.

  2. If TRANS = ‘N’ and m < n: find the minimum norm solution of an underdetermined system A * X = B.

  3. If TRANS = ‘C’ and m >= n: find the minimum norm solution of an undetermined system A**H * X = B.

  4. If TRANS = ‘C’ and m < n: find the least squares solution of an overdetermined system, minimize || B - A**H * X ||.

Parameters

in
trans

= ‘N’: the linear system involves A; = ‘C’: the linear system involves A**H.

in
m

The number of rows of the matrix A. m >= 0.

in
n

The number of columns of the matrix A. n >= 0.

in
nrhs

The number of right hand sides. nrhs >= 0.

inout
A

Single complex array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR or LQ factorization.

in
lda

The leading dimension of the array A. lda >= max(1, m).

inout
B

Single complex array, dimension (ldb, nrhs). On entry, the right hand side matrix B. On exit, the solution vectors.

in
ldb

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

out
work

Single complex array, dimension (max(1, lwork)). On exit, if info = 0, work[0] contains the optimal lwork.

in
lwork

The dimension of the array work. If lwork = -1 or -2, a workspace query is assumed. If lwork = -1, returns optimal workspace size. If lwork = -2, returns minimal workspace size.

out
info

  • = 0: successful exit

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

  • > 0: if info = i, the i-th diagonal element of the triangular factor of A is exactly zero.

Functions

void zgetsls(
    const char*          trans,
    const INT            m,
    const INT            n,
    const INT            nrhs,
          c128* restrict A,
    const INT            lda,
          c128* restrict B,
    const INT            ldb,
          c128* restrict work,
    const INT            lwork,
          INT*           info
);
void zgetsls(const char *trans, const INT m, const INT n, const INT nrhs, c128 *restrict A, const INT lda, c128 *restrict B, const INT ldb, c128 *restrict work, const INT lwork, INT *info)#

ZGETSLS solves overdetermined or underdetermined complex linear systems involving an M-by-N matrix A, using a tall skinny QR or short wide LQ factorization of A.

It is assumed that A has full rank, and only a rudimentary protection against rank-deficient matrices is provided.

The following options are provided:

  1. If TRANS = ‘N’ and m >= n: find the least squares solution of an overdetermined system, minimize || B - A*X ||.

  2. If TRANS = ‘N’ and m < n: find the minimum norm solution of an underdetermined system A * X = B.

  3. If TRANS = ‘C’ and m >= n: find the minimum norm solution of an undetermined system A**H * X = B.

  4. If TRANS = ‘C’ and m < n: find the least squares solution of an overdetermined system, minimize || B - A**H * X ||.

Parameters

in
trans

= ‘N’: the linear system involves A; = ‘C’: the linear system involves A**H.

in
m

The number of rows of the matrix A. m >= 0.

in
n

The number of columns of the matrix A. n >= 0.

in
nrhs

The number of right hand sides. nrhs >= 0.

inout
A

Double complex array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR or LQ factorization.

in
lda

The leading dimension of the array A. lda >= max(1, m).

inout
B

Double complex array, dimension (ldb, nrhs). On entry, the right hand side matrix B. On exit, the solution vectors.

in
ldb

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

out
work

Double complex array, dimension (max(1, lwork)). On exit, if info = 0, work[0] contains the optimal lwork.

in
lwork

The dimension of the array work. If lwork = -1 or -2, a workspace query is assumed. If lwork = -1, returns optimal workspace size. If lwork = -2, returns minimal workspace size.

out
info

  • = 0: successful exit

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

  • > 0: if info = i, the i-th diagonal element of the triangular factor of A is exactly zero.