These subroutines compute the minimal norm linear least squares solution of
AX is congruent to B, where A is a general
matrix, using the singular value decomposition computed by SGESVF or
DGESVF.
V, UB, X, s, tau | Subroutine |
Short-precision real | SGESVS |
Long-precision real | DGESVS |
Fortran | CALL SGESVS | DGESVS (v, ldv, ub, ldub, nb, s, x, ldx, m, n, tau) |
C and C++ | sgesvs | dgesvs (v, ldv, ub, ldub, nb, s, x, ldx, m, n, tau); |
PL/I | CALL SGESVS | DGESVS (v, ldv, ub, ldub, nb, s, x, ldx, m, n, tau); |
Specified as: an ldv by (at least) n array, containing numbers of the data type indicated in Table 118.
Specified as: an ldub by (at least) nb array, containing numbers of the data type indicated in Table 118.
Specified as: a one-dimensional array of (at least) length n, containing numbers of the data type indicated in Table 118; si >= 0.
Returned as: an ldx by (at least) nb array, containing numbers of the data type indicated in Table 118.
where DELTAij are the errors in aij. In problems where the matrix elements are known exactly or are only affected by roundoff errors:
where:
For more information, see references [13], [58], [78], and pages 134 to 151 in reference [99].
The minimal norm linear least squares solution of AX is congruent to B, where A is a real general matrix, is computed using the singular value decomposition, produced by a preceding call to SGESVF or DGESVF. From SGESVF or DGESVF, the singular value decomposition of A is given by the following:
The linear least squares of solution X, for AX is congruent to B, is given by the following formula:
where:
If m or n is equal to 0, no computation is performed. See references [13], [58], [78], and pages 134 to 151 in reference [99]. These algorithms have a tendency to generate underflows that may hurt overall performance. The system default is to mask underflow, which improves the performance of these subroutines.
None
This example finds the linear least squares solution for the underdetermined system AX is congruent to B, using the singular value decomposition computed by DGESVF. Matrix A is:
* * | 1.0 2.0 2.0 | | 2.0 4.0 5.0 | * *
and matrix B is:
* * | 1.0 | | 4.0 | * *
On output, matrix UTB is overwritten.
V LDV UB LDUB NB S X LDX M N TAU | | | | | | | | | | | CALL DGESVS( V , 3 , UB , 3 , 1 , S , X , 3 , 2 , 3 , TAU )
* * | -0.304 -0.894 0.328 | V = | -0.608 0.447 0.656 | | -0.733 0.000 -0.680 | * *
* * | -4.061 | UB = | 0.000 | | -0.714 | * * S = (7.342, 0.000, 0.305) TAU = 0.3993D-14
* * | -0.600 | X = | -1.200 | | 2.000 | * *
This example finds the linear least squares solution for the overdetermined system AX is congruent to B, using the singular value decomposition computed by DGESVF. Matrix A is:
* * | 1.0 4.0 | | 2.0 5.0 | | 3.0 6.0 | * *
and where B is:
* * | 7.0 10.0 | | 8.0 11.0 | | 9.0 12.0 | * *
On output, matrix UTB is overwritten.
V LDV UB LDUB NB S X LDX M N TAU | | | | | | | | | | | CALL DGESVS( V , 3 , UB , 3 , 2 , S , X , 2 , 3 , 2 , TAU )
* * | 0.922 -0.386 | V = | -0.386 -0.922 | | . . | * *
* * | -1.310 -2.321 | UB = | -13.867 -18.963 | | . . | * * S = (0.773, 9.508) TAU = 0.5171D-14
* * X = | -1.000 -2.000 | | 2.000 3.000 | * *