gelss#
Functions
-
void sgelss(const INT m, const INT n, const INT nrhs, f32 *restrict A, const INT lda, f32 *restrict B, const INT ldb, f32 *restrict S, const f32 rcond, INT *rank, f32 *restrict work, const INT lwork, INT *info)#
SGELSS computes the minimum norm solution to a real linear least squares problem:
using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient.Minimize 2-norm(| b - A*x |).
Several right hand side vectors b and solution vectors x can be handled in a single call; they are stored as the columns of the M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.
The effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value.
Parameters
inmThe number of rows of the matrix A. m >= 0.
innThe number of columns of the matrix A. n >= 0.
innrhsThe number of right hand sides. nrhs >= 0.
inoutADouble precision array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, the first min(m,n) rows of A are overwritten with its right singular vectors, stored rowwise.
inldaThe leading dimension of A. lda >= max(1, m).
inoutBDouble precision array, dimension (ldb, nrhs). On entry, the M-by-NRHS right hand side matrix B. On exit, B is overwritten by the N-by-NRHS solution matrix X. If m >= n and RANK = n, the residual sum-of-squares for the solution in the i-th column is given by the sum of squares of elements n+1:m in that column.
inldbThe leading dimension of B. ldb >= max(1, max(m, n)).
outSDouble precision array, dimension (min(m, n)). The singular values of A in decreasing order. The condition number of A in the 2-norm = S(1)/S(min(m,n)).
inrcondRCOND is used to determine the effective rank of A. Singular values S(i) <= RCOND*S(1) are treated as zero. If RCOND < 0, machine precision is used instead.
outrankThe effective rank of A, i.e., the number of singular values which are greater than RCOND*S(1).
outworkDouble precision array, dimension (max(1, lwork)). On exit, if info = 0, work[0] returns the optimal lwork.
inlworkThe dimension of work. lwork >= 1, and also: lwork >= 3*min(m,n) + max(2*min(m,n), max(m,n), nrhs). For good performance, lwork should generally be larger. If lwork = -1, a workspace query is assumed.
outinfo= 0: successful exit
< 0: if info = -i, the i-th argument had an illegal value
> 0: the algorithm for computing the SVD failed to converge; if info = i, i off-diagonal elements of an intermediate bidiagonal form did not converge to zero.
void sgelss(
const INT m,
const INT n,
const INT nrhs,
f32* restrict A,
const INT lda,
f32* restrict B,
const INT ldb,
f32* restrict S,
const f32 rcond,
INT* rank,
f32* restrict work,
const INT lwork,
INT* info
);
Functions
-
void dgelss(const INT m, const INT n, const INT nrhs, f64 *restrict A, const INT lda, f64 *restrict B, const INT ldb, f64 *restrict S, const f64 rcond, INT *rank, f64 *restrict work, const INT lwork, INT *info)#
DGELSS computes the minimum norm solution to a real linear least squares problem:
using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient.Minimize 2-norm(| b - A*x |).
Several right hand side vectors b and solution vectors x can be handled in a single call; they are stored as the columns of the M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.
The effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value.
Parameters
inmThe number of rows of the matrix A. m >= 0.
innThe number of columns of the matrix A. n >= 0.
innrhsThe number of right hand sides. nrhs >= 0.
inoutADouble precision array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, the first min(m,n) rows of A are overwritten with its right singular vectors, stored rowwise.
inldaThe leading dimension of A. lda >= max(1, m).
inoutBDouble precision array, dimension (ldb, nrhs). On entry, the M-by-NRHS right hand side matrix B. On exit, B is overwritten by the N-by-NRHS solution matrix X. If m >= n and RANK = n, the residual sum-of-squares for the solution in the i-th column is given by the sum of squares of elements n+1:m in that column.
inldbThe leading dimension of B. ldb >= max(1, max(m, n)).
outSDouble precision array, dimension (min(m, n)). The singular values of A in decreasing order. The condition number of A in the 2-norm = S(1)/S(min(m,n)).
inrcondRCOND is used to determine the effective rank of A. Singular values S(i) <= RCOND*S(1) are treated as zero. If RCOND < 0, machine precision is used instead.
outrankThe effective rank of A, i.e., the number of singular values which are greater than RCOND*S(1).
outworkDouble precision array, dimension (max(1, lwork)). On exit, if info = 0, work[0] returns the optimal lwork.
inlworkThe dimension of work. lwork >= 1, and also: lwork >= 3*min(m,n) + max(2*min(m,n), max(m,n), nrhs). For good performance, lwork should generally be larger. If lwork = -1, a workspace query is assumed.
outinfo= 0: successful exit
< 0: if info = -i, the i-th argument had an illegal value
> 0: the algorithm for computing the SVD failed to converge; if info = i, i off-diagonal elements of an intermediate bidiagonal form did not converge to zero.
void dgelss(
const INT m,
const INT n,
const INT nrhs,
f64* restrict A,
const INT lda,
f64* restrict B,
const INT ldb,
f64* restrict S,
const f64 rcond,
INT* rank,
f64* restrict work,
const INT lwork,
INT* info
);
Functions
-
void cgelss(const INT m, const INT n, const INT nrhs, c64 *restrict A, const INT lda, c64 *restrict B, const INT ldb, f32 *restrict S, const f32 rcond, INT *rank, c64 *restrict work, const INT lwork, f32 *restrict rwork, INT *info)#
CGELSS computes the minimum norm solution to a complex linear least squares problem:
using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient.Minimize 2-norm(| b - A*x |).
Several right hand side vectors b and solution vectors x can be handled in a single call; they are stored as the columns of the M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.
The effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value.
Parameters
inmThe number of rows of the matrix A. m >= 0.
innThe number of columns of the matrix A. n >= 0.
innrhsThe number of right hand sides. nrhs >= 0.
inoutAComplex*16 array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, the first min(m,n) rows of A are overwritten with its right singular vectors, stored rowwise.
inldaThe leading dimension of A. lda >= max(1, m).
inoutBComplex*16 array, dimension (ldb, nrhs). On entry, the M-by-NRHS right hand side matrix B. On exit, B is overwritten by the N-by-NRHS solution matrix X.
inldbThe leading dimension of B. ldb >= max(1, max(m, n)).
outSSingle precision array, dimension (min(m, n)). The singular values of A in decreasing order.
inrcondRCOND is used to determine the effective rank of A. Singular values S(i) <= RCOND*S(1) are treated as zero. If RCOND < 0, machine precision is used instead.
outrankThe effective rank of A.
outworkComplex*16 array, dimension (max(1, lwork)). On exit, if info = 0, work[0] returns the optimal lwork.
inlworkThe dimension of work. lwork >= 1, and also: lwork >= 2*min(m,n) + max(m,n,nrhs). If lwork = -1, a workspace query is assumed.
outrworkSingle precision array, dimension (5*min(m,n)).
outinfo= 0: successful exit
< 0: if info = -i, the i-th argument had an illegal value
> 0: the algorithm for computing the SVD failed to converge; if info = i, i off-diagonal elements of an intermediate bidiagonal form did not converge to zero.
void cgelss(
const INT m,
const INT n,
const INT nrhs,
c64* restrict A,
const INT lda,
c64* restrict B,
const INT ldb,
f32* restrict S,
const f32 rcond,
INT* rank,
c64* restrict work,
const INT lwork,
f32* restrict rwork,
INT* info
);
Functions
-
void zgelss(const INT m, const INT n, const INT nrhs, c128 *restrict A, const INT lda, c128 *restrict B, const INT ldb, f64 *restrict S, const f64 rcond, INT *rank, c128 *restrict work, const INT lwork, f64 *restrict rwork, INT *info)#
ZGELSS computes the minimum norm solution to a complex linear least squares problem:
using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient.Minimize 2-norm(| b - A*x |).
Several right hand side vectors b and solution vectors x can be handled in a single call; they are stored as the columns of the M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.
The effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value.
Parameters
inmThe number of rows of the matrix A. m >= 0.
innThe number of columns of the matrix A. n >= 0.
innrhsThe number of right hand sides. nrhs >= 0.
inoutAComplex*16 array, dimension (lda, n). On entry, the M-by-N matrix A. On exit, the first min(m,n) rows of A are overwritten with its right singular vectors, stored rowwise.
inldaThe leading dimension of A. lda >= max(1, m).
inoutBComplex*16 array, dimension (ldb, nrhs). On entry, the M-by-NRHS right hand side matrix B. On exit, B is overwritten by the N-by-NRHS solution matrix X.
inldbThe leading dimension of B. ldb >= max(1, max(m, n)).
outSDouble precision array, dimension (min(m, n)). The singular values of A in decreasing order.
inrcondRCOND is used to determine the effective rank of A. Singular values S(i) <= RCOND*S(1) are treated as zero. If RCOND < 0, machine precision is used instead.
outrankThe effective rank of A.
outworkComplex*16 array, dimension (max(1, lwork)). On exit, if info = 0, work[0] returns the optimal lwork.
inlworkThe dimension of work. lwork >= 1, and also: lwork >= 2*min(m,n) + max(m,n,nrhs). If lwork = -1, a workspace query is assumed.
outrworkDouble precision array, dimension (5*min(m,n)).
outinfo= 0: successful exit
< 0: if info = -i, the i-th argument had an illegal value
> 0: the algorithm for computing the SVD failed to converge; if info = i, i off-diagonal elements of an intermediate bidiagonal form did not converge to zero.
void zgelss(
const INT m,
const INT n,
const INT nrhs,
c128* restrict A,
const INT lda,
c128* restrict B,
const INT ldb,
f64* restrict S,
const f64 rcond,
INT* rank,
c128* restrict work,
const INT lwork,
f64* restrict rwork,
INT* info
);