gelsy#
Functions
-
void sgelsy(const INT m, const INT n, const INT nrhs, f32 *restrict A, const INT lda, f32 *restrict B, const INT ldb, INT *restrict jpvt, const f32 rcond, INT *rank, f32 *restrict work, const INT lwork, INT *info)#
SGELSY computes the minimum-norm solution to a real linear least squares problem: minimize || A * X - B || using a complete orthogonal factorization of A.
A is an M-by-N matrix which may be rank-deficient.
The routine first computes a QR factorization with column pivoting: A * P = Q * [ R11 R12 ] [ 0 R22 ] with R11 defined as the largest leading submatrix whose estimated condition number is less than 1/RCOND. The order of R11, RANK, is the effective rank of A.
Then, R22 is considered to be negligible, and R12 is annihilated by orthogonal transformations from the right, arriving at the complete orthogonal factorization: A * P = Q * [ T11 0 ] * Z [ 0 0 ] The minimum-norm solution is then X = P * Z^T * [ inv(T11)*Q1^T*B ] [ 0 ] where Q1 consists of the first RANK columns of Q.
Parameters
inmThe number of rows of A. m >= 0.
innThe number of columns of 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, overwritten by details of the complete orthogonal factorization.
inldaLeading dimension of A. lda >= max(1, m).
inoutBDouble precision array, dimension (ldb, nrhs). On entry, the m-by-nrhs right hand side matrix. On exit, the n-by-nrhs solution matrix X.
inldbLeading dimension of B. ldb >= max(1, m, n).
inoutjpvtInteger array, dimension (n). On entry, if jpvt[i] != 0, the i-th column of A is permuted to the front of AP; otherwise column i is free. On exit, if jpvt[i] = k, then the i-th column of A*P was the k-th column of A (0-based).
inrcondUsed to determine effective rank of A. Columns whose condition number exceeds 1/rcond are treated as zero.
outrankThe effective rank of A, i.e., the order of R11.
outworkDouble precision array, dimension (max(1, lwork)). On exit, work[0] returns the optimal lwork.
inlworkDimension of work. If lwork == -1, workspace query only.
outinfo= 0: successful exit
< 0: if info = -i, the i-th argument had an illegal value.
void sgelsy(
const INT m,
const INT n,
const INT nrhs,
f32* restrict A,
const INT lda,
f32* restrict B,
const INT ldb,
INT* restrict jpvt,
const f32 rcond,
INT* rank,
f32* restrict work,
const INT lwork,
INT* info
);
Functions
-
void dgelsy(const INT m, const INT n, const INT nrhs, f64 *restrict A, const INT lda, f64 *restrict B, const INT ldb, INT *restrict jpvt, const f64 rcond, INT *rank, f64 *restrict work, const INT lwork, INT *info)#
DGELSY computes the minimum-norm solution to a real linear least squares problem: minimize || A * X - B || using a complete orthogonal factorization of A.
A is an M-by-N matrix which may be rank-deficient.
The routine first computes a QR factorization with column pivoting: A * P = Q * [ R11 R12 ] [ 0 R22 ] with R11 defined as the largest leading submatrix whose estimated condition number is less than 1/RCOND. The order of R11, RANK, is the effective rank of A.
Then, R22 is considered to be negligible, and R12 is annihilated by orthogonal transformations from the right, arriving at the complete orthogonal factorization: A * P = Q * [ T11 0 ] * Z [ 0 0 ] The minimum-norm solution is then X = P * Z^T * [ inv(T11)*Q1^T*B ] [ 0 ] where Q1 consists of the first RANK columns of Q.
Parameters
inmThe number of rows of A. m >= 0.
innThe number of columns of 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, overwritten by details of the complete orthogonal factorization.
inldaLeading dimension of A. lda >= max(1, m).
inoutBDouble precision array, dimension (ldb, nrhs). On entry, the m-by-nrhs right hand side matrix. On exit, the n-by-nrhs solution matrix X.
inldbLeading dimension of B. ldb >= max(1, m, n).
inoutjpvtInteger array, dimension (n). On entry, if jpvt[i] != 0, the i-th column of A is permuted to the front of AP; otherwise column i is free. On exit, if jpvt[i] = k, then the i-th column of A*P was the k-th column of A (0-based).
inrcondUsed to determine effective rank of A. Columns whose condition number exceeds 1/rcond are treated as zero.
outrankThe effective rank of A, i.e., the order of R11.
outworkDouble precision array, dimension (max(1, lwork)). On exit, work[0] returns the optimal lwork.
inlworkDimension of work. If lwork == -1, workspace query only.
outinfo= 0: successful exit
< 0: if info = -i, the i-th argument had an illegal value.
void dgelsy(
const INT m,
const INT n,
const INT nrhs,
f64* restrict A,
const INT lda,
f64* restrict B,
const INT ldb,
INT* restrict jpvt,
const f64 rcond,
INT* rank,
f64* restrict work,
const INT lwork,
INT* info
);
Functions
-
void cgelsy(const INT m, const INT n, const INT nrhs, c64 *restrict A, const INT lda, c64 *restrict B, const INT ldb, INT *restrict jpvt, const f32 rcond, INT *rank, c64 *restrict work, const INT lwork, f32 *restrict rwork, INT *info)#
CGELSY computes the minimum-norm solution to a complex linear least squares problem: minimize || A * X - B || using a complete orthogonal factorization of A.
A is an M-by-N matrix which may be rank-deficient.
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 routine first computes a QR factorization with column pivoting: A * P = Q * [ R11 R12 ] [ 0 R22 ] with R11 defined as the largest leading submatrix whose estimated condition number is less than 1/RCOND. The order of R11, RANK, is the effective rank of A.
Then, R22 is considered to be negligible, and R12 is annihilated by unitary transformations from the right, arriving at the complete orthogonal factorization: A * P = Q * [ T11 0 ] * Z [ 0 0 ] The minimum-norm solution is then X = P * Z**H [ inv(T11)*Q1**H*B ] [ 0 ] where Q1 consists of the first RANK columns of Q.
Parameters
inmThe number of rows of A. m >= 0.
innThe number of columns of A. n >= 0.
innrhsThe number of right hand sides. nrhs >= 0.
inoutAComplex array, dimension (lda, n). On entry, the m-by-n matrix A. On exit, overwritten by details of the complete orthogonal factorization.
inldaLeading dimension of A. lda >= max(1, m).
inoutBComplex array, dimension (ldb, nrhs). On entry, the m-by-nrhs right hand side matrix. On exit, the n-by-nrhs solution matrix X.
inldbLeading dimension of B. ldb >= max(1, m, n).
inoutjpvtInteger array, dimension (n). On entry, if jpvt[i] != 0, the i-th column of A is permuted to the front of AP; otherwise column i is free. On exit, if jpvt[i] = k, then the i-th column of A*P was the k-th column of A (0-based).
inrcondUsed to determine effective rank of A. Columns whose condition number exceeds 1/rcond are treated as zero.
outrankThe effective rank of A, i.e., the order of R11.
outworkComplex array, dimension (max(1, lwork)). On exit, work[0] returns the optimal lwork.
inlworkDimension of work. If lwork == -1, workspace query only.
outrworkSingle precision array, dimension (2*n).
outinfo= 0: successful exit
< 0: if info = -i, the i-th argument had an illegal value.
void cgelsy(
const INT m,
const INT n,
const INT nrhs,
c64* restrict A,
const INT lda,
c64* restrict B,
const INT ldb,
INT* restrict jpvt,
const f32 rcond,
INT* rank,
c64* restrict work,
const INT lwork,
f32* restrict rwork,
INT* info
);
Functions
-
void zgelsy(const INT m, const INT n, const INT nrhs, c128 *restrict A, const INT lda, c128 *restrict B, const INT ldb, INT *restrict jpvt, const f64 rcond, INT *rank, c128 *restrict work, const INT lwork, f64 *restrict rwork, INT *info)#
ZGELSY computes the minimum-norm solution to a complex linear least squares problem: minimize || A * X - B || using a complete orthogonal factorization of A.
A is an M-by-N matrix which may be rank-deficient.
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 routine first computes a QR factorization with column pivoting: A * P = Q * [ R11 R12 ] [ 0 R22 ] with R11 defined as the largest leading submatrix whose estimated condition number is less than 1/RCOND. The order of R11, RANK, is the effective rank of A.
Then, R22 is considered to be negligible, and R12 is annihilated by unitary transformations from the right, arriving at the complete orthogonal factorization: A * P = Q * [ T11 0 ] * Z [ 0 0 ] The minimum-norm solution is then X = P * Z**H [ inv(T11)*Q1**H*B ] [ 0 ] where Q1 consists of the first RANK columns of Q.
Parameters
inmThe number of rows of A. m >= 0.
innThe number of columns of A. n >= 0.
innrhsThe number of right hand sides. nrhs >= 0.
inoutAComplex array, dimension (lda, n). On entry, the m-by-n matrix A. On exit, overwritten by details of the complete orthogonal factorization.
inldaLeading dimension of A. lda >= max(1, m).
inoutBComplex array, dimension (ldb, nrhs). On entry, the m-by-nrhs right hand side matrix. On exit, the n-by-nrhs solution matrix X.
inldbLeading dimension of B. ldb >= max(1, m, n).
inoutjpvtInteger array, dimension (n). On entry, if jpvt[i] != 0, the i-th column of A is permuted to the front of AP; otherwise column i is free. On exit, if jpvt[i] = k, then the i-th column of A*P was the k-th column of A (0-based).
inrcondUsed to determine effective rank of A. Columns whose condition number exceeds 1/rcond are treated as zero.
outrankThe effective rank of A, i.e., the order of R11.
outworkComplex array, dimension (max(1, lwork)). On exit, work[0] returns the optimal lwork.
inlworkDimension of work. If lwork == -1, workspace query only.
outrworkDouble precision array, dimension (2*n).
outinfo= 0: successful exit
< 0: if info = -i, the i-th argument had an illegal value.
void zgelsy(
const INT m,
const INT n,
const INT nrhs,
c128* restrict A,
const INT lda,
c128* restrict B,
const INT ldb,
INT* restrict jpvt,
const f64 rcond,
INT* rank,
c128* restrict work,
const INT lwork,
f64* restrict rwork,
INT* info
);