Skip to content

Commit 3c351aa

Browse files
authored
Merge pull request #924 from TiborGY/master
Clarify documentation of singularity/rank-deficiency checks
2 parents 9840f50 + c3c505b commit 3c351aa

32 files changed

+340
-80
lines changed

SRC/cgels.f

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@
3737
*>
3838
*> CGELS solves overdetermined or underdetermined complex linear systems
3939
*> involving an M-by-N matrix A, or its conjugate-transpose, using a QR
40-
*> or LQ factorization of A. It is assumed that A has full rank.
40+
*> or LQ factorization of A.
41+
*>
42+
*> It is assumed that A has full rank, and only a rudimentary protection
43+
*> against rank-deficient matrices is provided. This subroutine only detects
44+
*> exact rank-deficiency, where a diagonal element of the triangular factor
45+
*> of A is exactly zero.
46+
*>
47+
*> It is conceivable for one (or more) of the diagonal elements of the triangular
48+
*> factor of A to be subnormally tiny numbers without this subroutine signalling
49+
*> an error. The solutions computed for such almost-rank-deficient matrices may
50+
*> be less accurate due to a loss of numerical precision.
4151
*>
4252
*> The following options are provided:
4353
*>
@@ -161,7 +171,7 @@
161171
*> = 0: successful exit
162172
*> < 0: if INFO = -i, the i-th argument had an illegal value
163173
*> > 0: if INFO = i, the i-th diagonal element of the
164-
*> triangular factor of A is zero, so that A does not have
174+
*> triangular factor of A is exactly zero, so that A does not have
165175
*> full rank; the least squares solution could not be
166176
*> computed.
167177
*> \endverbatim

SRC/cgelst.f

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,16 @@
3838
*> CGELST solves overdetermined or underdetermined real linear systems
3939
*> involving an M-by-N matrix A, or its conjugate-transpose, using a QR
4040
*> or LQ factorization of A with compact WY representation of Q.
41-
*> It is assumed that A has full rank.
41+
*>
42+
*> It is assumed that A has full rank, and only a rudimentary protection
43+
*> against rank-deficient matrices is provided. This subroutine only detects
44+
*> exact rank-deficiency, where a diagonal element of the triangular factor
45+
*> of A is exactly zero.
46+
*>
47+
*> It is conceivable for one (or more) of the diagonal elements of the triangular
48+
*> factor of A to be subnormally tiny numbers without this subroutine signalling
49+
*> an error. The solutions computed for such almost-rank-deficient matrices may
50+
*> be less accurate due to a loss of numerical precision.
4251
*>
4352
*> The following options are provided:
4453
*>
@@ -163,7 +172,7 @@
163172
*> = 0: successful exit
164173
*> < 0: if INFO = -i, the i-th argument had an illegal value
165174
*> > 0: if INFO = i, the i-th diagonal element of the
166-
*> triangular factor of A is zero, so that A does not have
175+
*> triangular factor of A is exactly zero, so that A does not have
167176
*> full rank; the least squares solution could not be
168177
*> computed.
169178
*> \endverbatim

SRC/cgetsls.f

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,17 @@
2222
*>
2323
*> CGETSLS solves overdetermined or underdetermined complex linear systems
2424
*> involving an M-by-N matrix A, using a tall skinny QR or short wide LQ
25-
*> factorization of A. It is assumed that A has full rank.
25+
*> factorization of A.
2626
*>
27+
*> It is assumed that A has full rank, and only a rudimentary protection
28+
*> against rank-deficient matrices is provided. This subroutine only detects
29+
*> exact rank-deficiency, where a diagonal element of the triangular factor
30+
*> of A is exactly zero.
31+
*>
32+
*> It is conceivable for one (or more) of the diagonal elements of the triangular
33+
*> factor of A to be subnormally tiny numbers without this subroutine signalling
34+
*> an error. The solutions computed for such almost-rank-deficient matrices may
35+
*> be less accurate due to a loss of numerical precision.
2736
*>
2837
*>
2938
*> The following options are provided:
@@ -141,7 +150,7 @@
141150
*> = 0: successful exit
142151
*> < 0: if INFO = -i, the i-th argument had an illegal value
143152
*> > 0: if INFO = i, the i-th diagonal element of the
144-
*> triangular factor of A is zero, so that A does not have
153+
*> triangular factor of A is exactly zero, so that A does not have
145154
*> full rank; the least squares solution could not be
146155
*> computed.
147156
*> \endverbatim

SRC/cggglm.f

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@
6161
*> x
6262
*>
6363
*> where inv(B) denotes the inverse of B.
64+
*>
65+
*> Callers of this subroutine should note that the singularity/rank-deficiency checks
66+
*> implemented in this subroutine are rudimentary. The CTRTRS subroutine called by this
67+
*> subroutine only signals a failure due to singularity if the problem is exactly singular.
68+
*>
69+
*> It is conceivable for one (or more) of the factors involved in the generalized QR
70+
*> factorization of the pair (A, B) to be subnormally close to singularity without this
71+
*> subroutine signalling an error. The solutions computed for such almost-rank-deficient
72+
*> problems may be less accurate due to a loss of numerical precision.
73+
*>
6474
*> \endverbatim
6575
*
6676
* Arguments:
@@ -159,12 +169,12 @@
159169
*> = 0: successful exit.
160170
*> < 0: if INFO = -i, the i-th argument had an illegal value.
161171
*> = 1: the upper triangular factor R associated with A in the
162-
*> generalized QR factorization of the pair (A, B) is
172+
*> generalized QR factorization of the pair (A, B) is exactly
163173
*> singular, so that rank(A) < M; the least squares
164174
*> solution could not be computed.
165175
*> = 2: the bottom (N-M) by (N-M) part of the upper trapezoidal
166176
*> factor T associated with B in the generalized QR
167-
*> factorization of the pair (A, B) is singular, so that
177+
*> factorization of the pair (A, B) is exactly singular, so that
168178
*> rank( A B ) < N; the least squares solution could not
169179
*> be computed.
170180
*> \endverbatim

SRC/cgglse.f

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@
5252
*> matrices (B, A) given by
5353
*>
5454
*> B = (0 R)*Q, A = Z*T*Q.
55+
*>
56+
*> Callers of this subroutine should note that the singularity/rank-deficiency checks
57+
*> implemented in this subroutine are rudimentary. The CTRTRS subroutine called by this
58+
*> subroutine only signals a failure due to singularity if the problem is exactly singular.
59+
*>
60+
*> It is conceivable for one (or more) of the factors involved in the generalized RQ
61+
*> factorization of the pair (B, A) to be subnormally close to singularity without this
62+
*> subroutine signalling an error. The solutions computed for such almost-rank-deficient
63+
*> problems may be less accurate due to a loss of numerical precision.
64+
*>
5565
*> \endverbatim
5666
*
5767
* Arguments:
@@ -153,12 +163,12 @@
153163
*> = 0: successful exit.
154164
*> < 0: if INFO = -i, the i-th argument had an illegal value.
155165
*> = 1: the upper triangular factor R associated with B in the
156-
*> generalized RQ factorization of the pair (B, A) is
166+
*> generalized RQ factorization of the pair (B, A) is exactly
157167
*> singular, so that rank(B) < P; the least squares
158168
*> solution could not be computed.
159169
*> = 2: the (N-P) by (N-P) part of the upper trapezoidal factor
160170
*> T associated with A in the generalized RQ factorization
161-
*> of the pair (B, A) is singular, so that
171+
*> of the pair (B, A) is exactly singular, so that
162172
*> rank( (A) ) < N; the least squares solution could not
163173
*> ( (B) )
164174
*> be computed.

SRC/ctbtrs.f

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,14 @@
3939
*>
4040
*> A * X = B, A**T * X = B, or A**H * X = B,
4141
*>
42-
*> where A is a triangular band matrix of order N, and B is an
43-
*> N-by-NRHS matrix. A check is made to verify that A is nonsingular.
42+
*> where A is a triangular band matrix of order N, and B is an N-by-NRHS matrix.
43+
*>
44+
*> This subroutine verifies that A is nonsingular, but callers should note that only exact
45+
*> singularity is detected. It is conceivable for one or more diagonal elements of A to be
46+
*> subnormally tiny numbers without this subroutine signalling an error.
47+
*>
48+
*> If a possible loss of numerical precision due to near-singular matrices is a concern, the
49+
*> caller should verify that A is nonsingular within some tolerance before calling this subroutine.
4450
*> \endverbatim
4551
*
4652
* Arguments:
@@ -125,7 +131,7 @@
125131
*> INFO is INTEGER
126132
*> = 0: successful exit
127133
*> < 0: if INFO = -i, the i-th argument had an illegal value
128-
*> > 0: if INFO = i, the i-th diagonal element of A is zero,
134+
*> > 0: if INFO = i, the i-th diagonal element of A is exactly zero,
129135
*> indicating that the matrix is singular and the
130136
*> solutions X have not been computed.
131137
*> \endverbatim

SRC/ctptrs.f

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@
3838
*>
3939
*> A * X = B, A**T * X = B, or A**H * X = B,
4040
*>
41-
*> where A is a triangular matrix of order N stored in packed format,
42-
*> and B is an N-by-NRHS matrix. A check is made to verify that A is
43-
*> nonsingular.
41+
*> where A is a triangular matrix of order N stored in packed format, and B is an N-by-NRHS matrix.
42+
*>
43+
*> This subroutine verifies that A is nonsingular, but callers should note that only exact
44+
*> singularity is detected. It is conceivable for one or more diagonal elements of A to be
45+
*> subnormally tiny numbers without this subroutine signalling an error.
46+
*>
47+
*> If a possible loss of numerical precision due to near-singular matrices is a concern, the
48+
*> caller should verify that A is nonsingular within some tolerance before calling this subroutine.
4449
*> \endverbatim
4550
*
4651
* Arguments:
@@ -110,7 +115,7 @@
110115
*> INFO is INTEGER
111116
*> = 0: successful exit
112117
*> < 0: if INFO = -i, the i-th argument had an illegal value
113-
*> > 0: if INFO = i, the i-th diagonal element of A is zero,
118+
*> > 0: if INFO = i, the i-th diagonal element of A is exactly zero,
114119
*> indicating that the matrix is singular and the
115120
*> solutions X have not been computed.
116121
*> \endverbatim

SRC/ctrtrs.f

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,14 @@
3939
*>
4040
*> A * X = B, A**T * X = B, or A**H * X = B,
4141
*>
42-
*> where A is a triangular matrix of order N, and B is an N-by-NRHS
43-
*> matrix. A check is made to verify that A is nonsingular.
42+
*> where A is a triangular matrix of order N, and B is an N-by-NRHS matrix.
43+
*>
44+
*> This subroutine verifies that A is nonsingular, but callers should note that only exact
45+
*> singularity is detected. It is conceivable for one or more diagonal elements of A to be
46+
*> subnormally tiny numbers without this subroutine signalling an error.
47+
*>
48+
*> If a possible loss of numerical precision due to near-singular matrices is a concern, the
49+
*> caller should verify that A is nonsingular within some tolerance before calling this subroutine.
4450
*> \endverbatim
4551
*
4652
* Arguments:
@@ -119,7 +125,7 @@
119125
*> INFO is INTEGER
120126
*> = 0: successful exit
121127
*> < 0: if INFO = -i, the i-th argument had an illegal value
122-
*> > 0: if INFO = i, the i-th diagonal element of A is zero,
128+
*> > 0: if INFO = i, the i-th diagonal element of A is exactly zero,
123129
*> indicating that the matrix is singular and the solutions
124130
*> X have not been computed.
125131
*> \endverbatim

SRC/dgels.f

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@
3737
*>
3838
*> DGELS solves overdetermined or underdetermined real linear systems
3939
*> involving an M-by-N matrix A, or its transpose, using a QR or LQ
40-
*> factorization of A. It is assumed that A has full rank.
40+
*> factorization of A.
41+
*>
42+
*> It is assumed that A has full rank, and only a rudimentary protection
43+
*> against rank-deficient matrices is provided. This subroutine only detects
44+
*> exact rank-deficiency, where a diagonal element of the triangular factor
45+
*> of A is exactly zero.
46+
*>
47+
*> It is conceivable for one (or more) of the diagonal elements of the triangular
48+
*> factor of A to be subnormally tiny numbers without this subroutine signalling
49+
*> an error. The solutions computed for such almost-rank-deficient matrices may
50+
*> be less accurate due to a loss of numerical precision.
4151
*>
4252
*> The following options are provided:
4353
*>
@@ -162,7 +172,7 @@
162172
*> = 0: successful exit
163173
*> < 0: if INFO = -i, the i-th argument had an illegal value
164174
*> > 0: if INFO = i, the i-th diagonal element of the
165-
*> triangular factor of A is zero, so that A does not have
175+
*> triangular factor of A is exactly zero, so that A does not have
166176
*> full rank; the least squares solution could not be
167177
*> computed.
168178
*> \endverbatim

SRC/dgelst.f

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,16 @@
3838
*> DGELST solves overdetermined or underdetermined real linear systems
3939
*> involving an M-by-N matrix A, or its transpose, using a QR or LQ
4040
*> factorization of A with compact WY representation of Q.
41-
*> It is assumed that A has full rank.
41+
*>
42+
*> It is assumed that A has full rank, and only a rudimentary protection
43+
*> against rank-deficient matrices is provided. This subroutine only detects
44+
*> exact rank-deficiency, where a diagonal element of the triangular factor
45+
*> of A is exactly zero.
46+
*>
47+
*> It is conceivable for one (or more) of the diagonal elements of the triangular
48+
*> factor of A to be subnormally tiny numbers without this subroutine signalling
49+
*> an error. The solutions computed for such almost-rank-deficient matrices may
50+
*> be less accurate due to a loss of numerical precision.
4251
*>
4352
*> The following options are provided:
4453
*>
@@ -163,7 +172,7 @@
163172
*> = 0: successful exit
164173
*> < 0: if INFO = -i, the i-th argument had an illegal value
165174
*> > 0: if INFO = i, the i-th diagonal element of the
166-
*> triangular factor of A is zero, so that A does not have
175+
*> triangular factor of A is exactly zero, so that A does not have
167176
*> full rank; the least squares solution could not be
168177
*> computed.
169178
*> \endverbatim

SRC/dgetsls.f

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,17 @@
2222
*>
2323
*> DGETSLS solves overdetermined or underdetermined real linear systems
2424
*> involving an M-by-N matrix A, using a tall skinny QR or short wide LQ
25-
*> factorization of A. It is assumed that A has full rank.
25+
*> factorization of A.
2626
*>
27+
*> It is assumed that A has full rank, and only a rudimentary protection
28+
*> against rank-deficient matrices is provided. This subroutine only detects
29+
*> exact rank-deficiency, where a diagonal element of the triangular factor
30+
*> of A is exactly zero.
31+
*>
32+
*> It is conceivable for one (or more) of the diagonal elements of the triangular
33+
*> factor of A to be subnormally tiny numbers without this subroutine signalling
34+
*> an error. The solutions computed for such almost-rank-deficient matrices may
35+
*> be less accurate due to a loss of numerical precision.
2736
*>
2837
*>
2938
*> The following options are provided:
@@ -141,7 +150,7 @@
141150
*> = 0: successful exit
142151
*> < 0: if INFO = -i, the i-th argument had an illegal value
143152
*> > 0: if INFO = i, the i-th diagonal element of the
144-
*> triangular factor of A is zero, so that A does not have
153+
*> triangular factor of A is exactly zero, so that A does not have
145154
*> full rank; the least squares solution could not be
146155
*> computed.
147156
*> \endverbatim

SRC/dggglm.f

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@
6161
*> x
6262
*>
6363
*> where inv(B) denotes the inverse of B.
64+
*>
65+
*> Callers of this subroutine should note that the singularity/rank-deficiency checks
66+
*> implemented in this subroutine are rudimentary. The DTRTRS subroutine called by this
67+
*> subroutine only signals a failure due to singularity if the problem is exactly singular.
68+
*>
69+
*> It is conceivable for one (or more) of the factors involved in the generalized QR
70+
*> factorization of the pair (A, B) to be subnormally close to singularity without this
71+
*> subroutine signalling an error. The solutions computed for such almost-rank-deficient
72+
*> problems may be less accurate due to a loss of numerical precision.
73+
*>
6474
*> \endverbatim
6575
*
6676
* Arguments:
@@ -159,12 +169,12 @@
159169
*> = 0: successful exit.
160170
*> < 0: if INFO = -i, the i-th argument had an illegal value.
161171
*> = 1: the upper triangular factor R associated with A in the
162-
*> generalized QR factorization of the pair (A, B) is
172+
*> generalized QR factorization of the pair (A, B) is exactly
163173
*> singular, so that rank(A) < M; the least squares
164174
*> solution could not be computed.
165175
*> = 2: the bottom (N-M) by (N-M) part of the upper trapezoidal
166176
*> factor T associated with B in the generalized QR
167-
*> factorization of the pair (A, B) is singular, so that
177+
*> factorization of the pair (A, B) is exactly singular, so that
168178
*> rank( A B ) < N; the least squares solution could not
169179
*> be computed.
170180
*> \endverbatim

SRC/dgglse.f

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@
5252
*> matrices (B, A) given by
5353
*>
5454
*> B = (0 R)*Q, A = Z*T*Q.
55+
*>
56+
*> Callers of this subroutine should note that the singularity/rank-deficiency checks
57+
*> implemented in this subroutine are rudimentary. The DTRTRS subroutine called by this
58+
*> subroutine only signals a failure due to singularity if the problem is exactly singular.
59+
*>
60+
*> It is conceivable for one (or more) of the factors involved in the generalized RQ
61+
*> factorization of the pair (B, A) to be subnormally close to singularity without this
62+
*> subroutine signalling an error. The solutions computed for such almost-rank-deficient
63+
*> problems may be less accurate due to a loss of numerical precision.
64+
*>
5565
*> \endverbatim
5666
*
5767
* Arguments:
@@ -153,12 +163,12 @@
153163
*> = 0: successful exit.
154164
*> < 0: if INFO = -i, the i-th argument had an illegal value.
155165
*> = 1: the upper triangular factor R associated with B in the
156-
*> generalized RQ factorization of the pair (B, A) is
166+
*> generalized RQ factorization of the pair (B, A) is exactly
157167
*> singular, so that rank(B) < P; the least squares
158168
*> solution could not be computed.
159169
*> = 2: the (N-P) by (N-P) part of the upper trapezoidal factor
160170
*> T associated with A in the generalized RQ factorization
161-
*> of the pair (B, A) is singular, so that
171+
*> of the pair (B, A) is exactly singular, so that
162172
*> rank( (A) ) < N; the least squares solution could not
163173
*> ( (B) )
164174
*> be computed.

SRC/dtbtrs.f

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,14 @@
3939
*>
4040
*> A * X = B or A**T * X = B,
4141
*>
42-
*> where A is a triangular band matrix of order N, and B is an
43-
*> N-by NRHS matrix. A check is made to verify that A is nonsingular.
42+
*> where A is a triangular band matrix of order N, and B is an N-by-NRHS matrix.
43+
*>
44+
*> This subroutine verifies that A is nonsingular, but callers should note that only exact
45+
*> singularity is detected. It is conceivable for one or more diagonal elements of A to be
46+
*> subnormally tiny numbers without this subroutine signalling an error.
47+
*>
48+
*> If a possible loss of numerical precision due to near-singular matrices is a concern, the
49+
*> caller should verify that A is nonsingular within some tolerance before calling this subroutine.
4450
*> \endverbatim
4551
*
4652
* Arguments:
@@ -125,7 +131,7 @@
125131
*> INFO is INTEGER
126132
*> = 0: successful exit
127133
*> < 0: if INFO = -i, the i-th argument had an illegal value
128-
*> > 0: if INFO = i, the i-th diagonal element of A is zero,
134+
*> > 0: if INFO = i, the i-th diagonal element of A is exactly zero,
129135
*> indicating that the matrix is singular and the
130136
*> solutions X have not been computed.
131137
*> \endverbatim

0 commit comments

Comments
 (0)