gglse#
Functions
-
void sgglse(const INT m, const INT n, const INT p, f32 *restrict A, const INT lda, f32 *restrict B, const INT ldb, f32 *restrict C, f32 *restrict D, f32 *restrict X, f32 *restrict work, const INT lwork, INT *info)#
SGGLSE solves the linear equality-constrained least squares (LSE) problem:
where A is an M-by-N matrix, B is a P-by-N matrix, c is a given M-vector, and d is a given P-vector. It is assumed that P <= N <= M+P, andminimize || c - A*x ||_2 subject to B*x = d
These conditions ensure that the LSE problem has a unique solution, which is obtained using a generalized RQ factorization of the matrices (B, A) given byrank(B) = P and rank( (A) ) = N. ( (B) )
B = (0 R)*Q, A = Z*T*Q.
If lwork = -1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla.
Parameters
inmThe number of rows of the matrix A. m >= 0.
innThe number of columns of the matrices A and B. n >= 0.
inpThe number of rows of the matrix B. 0 <= p <= n <= m+p.
inoutADouble precision array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, the elements on and above the diagonal of the array contain the min(M,N)-by-N upper trapezoidal matrix T.
inldaThe leading dimension of the array A. lda >= max(1, m).
inoutBDouble precision array, dimension (ldb, n). On entry, the P-by-N matrix B. On exit, the upper triangle of the subarray B(1:P,N-P+1:N) contains the P-by-P upper triangular matrix R.
inldbThe leading dimension of the array B. ldb >= max(1, p).
inoutCDouble precision array, dimension (m). On entry, C contains the right hand side vector for the least squares part of the LSE problem. On exit, the residual sum of squares for the solution is given by the sum of squares of elements N-P+1 to M of vector C.
inoutDDouble precision array, dimension (p). On entry, D contains the right hand side vector for the constrained equation. On exit, D is destroyed.
outXDouble precision array, dimension (n). On exit, X is the solution of the LSE problem.
outworkDouble precision array, dimension (max(1, lwork)). On exit, if info = 0, work[0] returns the optimal lwork.
inlworkThe dimension of the array work. lwork >= max(1, m+n+p). For optimum performance lwork >= p+min(m,n)+max(m,n)*NB, where NB is an upper bound for the optimal blocksizes for SGEQRF, SGERQF, SORMQR and SORMRQ.
outinfo= 0: successful exit.
< 0: if info = -i, the i-th argument had an illegal value.
= 1: the upper triangular factor R associated with B in the generalized RQ factorization of the pair (B, A) is exactly singular, so that rank(B) < P; the least squares solution could not be computed.
= 2: the (N-P) by (N-P) part of the upper trapezoidal factor T associated with A in the generalized RQ factorization of the pair (B, A) is exactly singular, so that rank( (A) ) < N; the least squares solution could not ( (B) ) be computed.
void sgglse(
const INT m,
const INT n,
const INT p,
f32* restrict A,
const INT lda,
f32* restrict B,
const INT ldb,
f32* restrict C,
f32* restrict D,
f32* restrict X,
f32* restrict work,
const INT lwork,
INT* info
);
Functions
-
void dgglse(const INT m, const INT n, const INT p, f64 *restrict A, const INT lda, f64 *restrict B, const INT ldb, f64 *restrict C, f64 *restrict D, f64 *restrict X, f64 *restrict work, const INT lwork, INT *info)#
DGGLSE solves the linear equality-constrained least squares (LSE) problem:
where A is an M-by-N matrix, B is a P-by-N matrix, c is a given M-vector, and d is a given P-vector. It is assumed that P <= N <= M+P, andminimize || c - A*x ||_2 subject to B*x = d
These conditions ensure that the LSE problem has a unique solution, which is obtained using a generalized RQ factorization of the matrices (B, A) given byrank(B) = P and rank( (A) ) = N. ( (B) )
B = (0 R)*Q, A = Z*T*Q.
If lwork = -1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla.
Parameters
inmThe number of rows of the matrix A. m >= 0.
innThe number of columns of the matrices A and B. n >= 0.
inpThe number of rows of the matrix B. 0 <= p <= n <= m+p.
inoutADouble precision array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, the elements on and above the diagonal of the array contain the min(M,N)-by-N upper trapezoidal matrix T.
inldaThe leading dimension of the array A. lda >= max(1, m).
inoutBDouble precision array, dimension (ldb, n). On entry, the P-by-N matrix B. On exit, the upper triangle of the subarray B(1:P,N-P+1:N) contains the P-by-P upper triangular matrix R.
inldbThe leading dimension of the array B. ldb >= max(1, p).
inoutCDouble precision array, dimension (m). On entry, C contains the right hand side vector for the least squares part of the LSE problem. On exit, the residual sum of squares for the solution is given by the sum of squares of elements N-P+1 to M of vector C.
inoutDDouble precision array, dimension (p). On entry, D contains the right hand side vector for the constrained equation. On exit, D is destroyed.
outXDouble precision array, dimension (n). On exit, X is the solution of the LSE problem.
outworkDouble precision array, dimension (max(1, lwork)). On exit, if info = 0, work[0] returns the optimal lwork.
inlworkThe dimension of the array work. lwork >= max(1, m+n+p). For optimum performance lwork >= p+min(m,n)+max(m,n)*NB, where NB is an upper bound for the optimal blocksizes for DGEQRF, DGERQF, DORMQR and DORMRQ.
outinfo= 0: successful exit.
< 0: if info = -i, the i-th argument had an illegal value.
= 1: the upper triangular factor R associated with B in the generalized RQ factorization of the pair (B, A) is exactly singular, so that rank(B) < P; the least squares solution could not be computed.
= 2: the (N-P) by (N-P) part of the upper trapezoidal factor T associated with A in the generalized RQ factorization of the pair (B, A) is exactly singular, so that rank( (A) ) < N; the least squares solution could not ( (B) ) be computed.
void dgglse(
const INT m,
const INT n,
const INT p,
f64* restrict A,
const INT lda,
f64* restrict B,
const INT ldb,
f64* restrict C,
f64* restrict D,
f64* restrict X,
f64* restrict work,
const INT lwork,
INT* info
);
Functions
-
void cgglse(const INT m, const INT n, const INT p, c64 *restrict A, const INT lda, c64 *restrict B, const INT ldb, c64 *restrict C, c64 *restrict D, c64 *restrict X, c64 *restrict work, const INT lwork, INT *info)#
CGGLSE solves the linear equality-constrained least squares (LSE) problem:
where A is an M-by-N matrix, B is a P-by-N matrix, c is a given M-vector, and d is a given P-vector. It is assumed that P <= N <= M+P, andminimize || c - A*x ||_2 subject to B*x = d
These conditions ensure that the LSE problem has a unique solution, which is obtained using a generalized RQ factorization of the matrices (B, A) given byrank(B) = P and rank( (A) ) = N. ( (B) )
B = (0 R)*Q, A = Z*T*Q.
If lwork = -1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla.
Parameters
inmThe number of rows of the matrix A. m >= 0.
innThe number of columns of the matrices A and B. n >= 0.
inpThe number of rows of the matrix B. 0 <= p <= n <= m+p.
inoutASingle complex array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, the elements on and above the diagonal of the array contain the min(M,N)-by-N upper trapezoidal matrix T.
inldaThe leading dimension of the array A. lda >= max(1, m).
inoutBSingle complex array, dimension (ldb, n). On entry, the P-by-N matrix B. On exit, the upper triangle of the subarray B(1:P,N-P+1:N) contains the P-by-P upper triangular matrix R.
inldbThe leading dimension of the array B. ldb >= max(1, p).
inoutCSingle complex array, dimension (m). On entry, C contains the right hand side vector for the least squares part of the LSE problem. On exit, the residual sum of squares for the solution is given by the sum of squares of elements N-P+1 to M of vector C.
inoutDSingle complex array, dimension (p). On entry, D contains the right hand side vector for the constrained equation. On exit, D is destroyed.
outXSingle complex array, dimension (n). On exit, X is the solution of the LSE problem.
outworkSingle complex array, dimension (max(1, lwork)). On exit, if info = 0, work[0] returns the optimal lwork.
inlworkThe dimension of the array work. lwork >= max(1, m+n+p). For optimum performance lwork >= p+min(m,n)+max(m,n)*NB, where NB is an upper bound for the optimal blocksizes for CGEQRF, CGERQF, CUNMQR and CUNMRQ.
outinfo= 0: successful exit.
< 0: if info = -i, the i-th argument had an illegal value.
= 1: the upper triangular factor R associated with B in the generalized RQ factorization of the pair (B, A) is exactly singular, so that rank(B) < P; the least squares solution could not be computed.
= 2: the (N-P) by (N-P) part of the upper trapezoidal factor T associated with A in the generalized RQ factorization of the pair (B, A) is exactly singular, so that rank( (A) ) < N; the least squares solution could not ( (B) ) be computed.
void cgglse(
const INT m,
const INT n,
const INT p,
c64* restrict A,
const INT lda,
c64* restrict B,
const INT ldb,
c64* restrict C,
c64* restrict D,
c64* restrict X,
c64* restrict work,
const INT lwork,
INT* info
);
Functions
-
void zgglse(const INT m, const INT n, const INT p, c128 *restrict A, const INT lda, c128 *restrict B, const INT ldb, c128 *restrict C, c128 *restrict D, c128 *restrict X, c128 *restrict work, const INT lwork, INT *info)#
ZGGLSE solves the linear equality-constrained least squares (LSE) problem:
where A is an M-by-N matrix, B is a P-by-N matrix, c is a given M-vector, and d is a given P-vector. It is assumed that P <= N <= M+P, andminimize || c - A*x ||_2 subject to B*x = d
These conditions ensure that the LSE problem has a unique solution, which is obtained using a generalized RQ factorization of the matrices (B, A) given byrank(B) = P and rank( (A) ) = N. ( (B) )
B = (0 R)*Q, A = Z*T*Q.
If lwork = -1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla.
Parameters
inmThe number of rows of the matrix A. m >= 0.
innThe number of columns of the matrices A and B. n >= 0.
inpThe number of rows of the matrix B. 0 <= p <= n <= m+p.
inoutADouble complex array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, the elements on and above the diagonal of the array contain the min(M,N)-by-N upper trapezoidal matrix T.
inldaThe leading dimension of the array A. lda >= max(1, m).
inoutBDouble complex array, dimension (ldb, n). On entry, the P-by-N matrix B. On exit, the upper triangle of the subarray B(1:P,N-P+1:N) contains the P-by-P upper triangular matrix R.
inldbThe leading dimension of the array B. ldb >= max(1, p).
inoutCDouble complex array, dimension (m). On entry, C contains the right hand side vector for the least squares part of the LSE problem. On exit, the residual sum of squares for the solution is given by the sum of squares of elements N-P+1 to M of vector C.
inoutDDouble complex array, dimension (p). On entry, D contains the right hand side vector for the constrained equation. On exit, D is destroyed.
outXDouble complex array, dimension (n). On exit, X is the solution of the LSE problem.
outworkDouble complex array, dimension (max(1, lwork)). On exit, if info = 0, work[0] returns the optimal lwork.
inlworkThe dimension of the array work. lwork >= max(1, m+n+p). For optimum performance lwork >= p+min(m,n)+max(m,n)*NB, where NB is an upper bound for the optimal blocksizes for ZGEQRF, ZGERQF, ZUNMQR and ZUNMRQ.
outinfo= 0: successful exit.
< 0: if info = -i, the i-th argument had an illegal value.
= 1: the upper triangular factor R associated with B in the generalized RQ factorization of the pair (B, A) is exactly singular, so that rank(B) < P; the least squares solution could not be computed.
= 2: the (N-P) by (N-P) part of the upper trapezoidal factor T associated with A in the generalized RQ factorization of the pair (B, A) is exactly singular, so that rank( (A) ) < N; the least squares solution could not ( (B) ) be computed.
void zgglse(
const INT m,
const INT n,
const INT p,
c128* restrict A,
const INT lda,
c128* restrict B,
const INT ldb,
c128* restrict C,
c128* restrict D,
c128* restrict X,
c128* restrict work,
const INT lwork,
INT* info
);