These subroutines solve the following systems of equations for multiple right-hand sides, where A, X, and B are general matrices. SGESM and DGESM solve one of the following:
CGESM and ZGESM solve one of the following:
These subroutines use the results of the factorization of matrix
A, produced by a preceding call to SGEF/SGEFCD, DGEF/DGEFP/DGEFCD,
CGEF, or ZGEF, respectively.
| A, B, X | Subroutine |
| Short-precision real | SGESM |
| Long-precision real | DGESM |
| Short-precision complex | CGESM |
| Long-precision complex | ZGESM |
| Fortran | CALL SGESM | DGESM | CGESM | ZGESM (trans, a, lda, n, ipvt, b, ldb, nrhs) |
| C and C++ | sgesm | dgesm | cgesm | zgesm (trans, a, lda, n, ipvt, b, ldb, nrhs); |
| PL/I | CALL SGESM | DGESM | CGESM | ZGESM (trans, a, lda, n, ipvt, b, ldb, nrhs); |
If transa = 'N', A is used in the computation, resulting in equation 1.
If transa = 'T', AT is used in the computation, resulting in equation 2.
If transa = 'C', AH is used in the computation, resulting in equation 3.
Specified as: a single character. It must be 'N', 'T', or 'C'.
One of the following systems of equations is solved for multiple right-hand sides:
where A, B, and X are general matrices. These subroutines use the results of the factorization of matrix A, produced by a preceding call to SGEF/SGEFCD, DGEF/DGEFP/DGEFCD, CGEF, or ZGEF, respectively. For a description of how A is factored, see SGEF, DGEF, CGEF, and ZGEF--General Matrix Factorization.
If n or nrhs is 0, no computation is performed. See references [36] and [38].
None
This part of the example shows how to solve the system AX = B for two right-hand sides, where matrix A is the same matrix factored in the Example 1 for SGEF and DGEF.
TRANS A LDA N IPVT B LDB NRHS
| | | | | | | |
CALL SGESM( 'N' , A , 9 , 9 , IPVT , B , 9 , 2 )
* *
| 4.0 10.0 |
| 5.0 15.0 |
| 9.0 24.0 |
| 10.0 35.0 |
B = | 11.0 48.0 |
| 12.0 63.0 |
| 12.0 70.0 |
| 12.0 78.0 |
| 33.0 266.0 |
* *
* *
| 1.0 1.0 |
| 1.0 2.0 |
| 1.0 3.0 |
| 1.0 4.0 |
B = | 1.0 5.0 |
| 1.0 6.0 |
| 1.0 7.0 |
| 1.0 8.0 |
| 1.0 9.0 |
* *
This part of the example shows how to solve the system ATX = B for two right-hand sides, where matrix A is the input matrix factored in Example 1 for SGEF and DGEF.
TRANS A LDA N IPVT B LDB NRHS
| | | | | | | |
CALL SGESM( 'T' , A , 9 , 9 , IPVT , B , 9 , 2 )
* *
| 6.0 15.0 |
| 8.0 26.0 |
| 10.0 40.0 |
| 12.0 57.0 |
B = | 13.0 76.0 |
| 14.0 97.0 |
| 15.0 120.0 |
| 15.0 125.0 |
| 15.0 129.0 |
* *
* *
| 1.0 1.0 |
| 1.0 2.0 |
| 1.0 3.0 |
| 1.0 4.0 |
B = | 1.0 5.0 |
| 1.0 6.0 |
| 1.0 7.0 |
| 1.0 8.0 |
| 1.0 9.0 |
* *
This part of the example shows how to solve the system AX = B for two right-hand sides, where matrix A is the same matrix factored in the Example 2 for CGEF and ZGEF.
TRANS A LDA N IPVT B LDB NRHS
| | | | | | | |
CALL CGESM( 'N' , A , 4 , 4 , IPVT , B , 4 , 2 )
* *
| (-10.0, 85.0) (-11.0, 53.0) |
B = | (-6.0, 61.0) (-6.0, 54.0) |
| (10.0, 38.0) (2.0, 40.0) |
| (58.0, 168.0) (15.0, 105.0) |
* *
* *
| (9.0, 0.0) (1.0, 1.0) |
B = | (5.0, 1.0) (2.0, 2.0) |
| (1.0, 6.0) (3.0, 3.0) |
| (3.0, 4.0) (4.0, 4.0) |
* *
This part of the example shows how to solve the system ATX = B for two right-hand sides, where matrix A is the input matrix factored in Example 2 for CGEF and ZGEF.
TRANS A LDA N IPVT B LDB NRHS
| | | | | | | |
CALL CGESM( 'T' , A , 4 , 4 , IPVT , B , 4 , 2 )
* *
| (71.0, 12.0) (18.0, 68.0) |
B = | (61.0, -70.0) (-27.0, 71.0) |
| (123.0, -34.0) (-11.0, 97.0) |
| (68.0, 7.0) (28.0, 50.0) |
* *
* *
| (9.0, 0.0) (1.0, 1.0) |
B = | (5.0, 1.0) (2.0, 2.0) |
| (1.0, 6.0) (3.0, 3.0) |
| (3.0, 4.0) (4.0, 4.0) |
* *
This part of the example shows how to solve the system AHX = B for two right-hand sides, where matrix A is the input matrix factored in Example 2 for CGEF and ZGEF.
TRANS A LDA N IPVT B LDB NRHS
| | | | | | | |
CALL CGESM( 'C' , A , 4 , 4 , IPVT , B , 4 , 2 )
* *
| (58.0, -3.0) (45.0, 20.0) |
B = | (68.0, -31.0) (83.0, -20.0) |
| (89.0, -22.0) (98.0, 1.0) |
| (53.0, 15.0) (45.0, 25.0) |
* *
* *
| (1.0, 4.0) (4.0, 5.0) |
B = | (2.0, 3.0) (3.0, 4.0) |
| (3.0, 2.0) (2.0, 3.0) |
| (4.0, 1.0) (1.0, 2.0) |
* *