STRSM and DTRSM perform one of the following solves for a triangular system
of equations with multiple right-hand sides, using scalar alpha, rectangular
matrix B, and triangular matrix A or its
transpose:
Solution | Equation |
|
---|---|---|
1. B<--alpha(A-1)B | AX = alphaB |
|
2. B<--alpha(A-T)B | ATX = alphaB |
|
3. B<--alphaB(A-1) | XA = alphaB |
|
4. B<--alphaB(A-T) | XAT = alphaB |
|
CTRSM and ZTRSM perform one of the following solves for a triangular system
of equations with multiple right-hand sides, using scalar alpha, rectangular
matrix B, and triangular matrix A, its transpose, or its
conjugate transpose:
Solution | Equation |
|
---|---|---|
1. B<--alpha(A-1)B | AX = alphaB |
|
2. B<--alpha(A-T)B | ATX = alphaB |
|
3. B<--alphaB(A-1) | XA = alphaB |
|
4. B<--alphaB(A-T) | XAT = alphaB |
|
5. B<--alpha(A-H)B | AHX = alphaB |
|
6. B<--alphaB(A-H) | XAH = alphaB |
|
A, B, alpha | Subroutine |
Short-precision real | STRSM |
Long-precision real | DTRSM |
Short-precision complex | CTRSM |
Long-precision complex | ZTRSM |
Fortran | CALL STRSM | DTRSM | CTRSM | ZTRSM (side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb) |
C and C++ | strsm | dtrsm | ctrsm | ztrsm (side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb); |
PL/I | CALL STRSM | DTRSM | CTRSM | ZTRSM (side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb); |
If side = 'L', A is to the left of B, resulting in solution 1, 2, or 5.
If side = 'R', A is to the right of B, resulting in solution 3, 4, or 6.
Specified as: a single character. It must be 'L' or 'R'.
If uplo = 'U', A is an upper triangular matrix.
If uplo = 'L', A is a lower triangular matrix.
Specified as: a single character. It must be 'U' or 'L'.
If transa = 'N', A is used, resulting in solution 1 or 3.
If transa = 'T', AT is used, resulting in solution 2 or 4.
If transa = 'C', AH is used, resulting in solution 5 or 6.
Specified as: a single character. It must be 'N', 'T', or 'C'.
If diag = 'U', A is a unit triangular matrix.
If diag = 'N', A is not a unit triangular matrix.
Specified as: a single character. It must be 'U' or 'N'.
If side = 'L', m is the order of triangular matrix A.
Specified as: a fullword integer, where:
If side = 'L', 0 <= m <= lda and m <= ldb.
If side = 'R', 0 <= m <= ldb.
If side = 'R', n is the order of triangular matrix A.
Specified as: a fullword integer; n >= 0, and:
If side = 'R', n <= lda.
If side = 'L', A is order m.
If side = 'R', A is order n.
Specified as: a two-dimensional array, containing numbers of the data type indicated in Table 103, where:
If side = 'L', its size must be lda by (at least) m.
If side = 'R', it size must be lda by (at least) n.
If side = 'L', lda >= m.
If side = 'R', lda >= n.
Returned as: an ldb by (at least) n array, containing numbers of the data type indicated in Table 103.
These subroutines solve a triangular system of equations with multiple right-hand sides. The solution B may be any of the following, where A is a triangular matrix and B is a rectangular matrix:
where:
If n or m is 0, no computation is performed. See references [32] and [36].
Unable to allocate internal work area.
None
This example shows the solution B<--alpha(A-1)B, where A is a real 5 by 5 upper triangular matrix that is not unit triangular, and B is a real 5 by 3 rectangular matrix.
SIDE UPLO TRANSA DIAG M N ALPHA A LDA B LDB | | | | | | | | | | | CALL STRSM( 'L' , 'U' , 'N' , 'N' , 5 , 3 , 1.0 , A , 7 , B , 6 )
* * | 3.0 -1.0 2.0 2.0 1.0 | | . -2.0 4.0 -1.0 3.0 | | . . -3.0 0.0 2.0 | A = | . . . 4.0 -2.0 | | . . . . 1.0 | | . . . . . | | . . . . . | * *
* * | 6.0 10.0 -2.0 | | -16.0 -1.0 6.0 | B = | -2.0 1.0 -4.0 | | 14.0 0.0 -14.0 | | -1.0 2.0 1.0 | | . . . | * *
* * | 2.0 3.0 1.0 | | 5.0 5.0 4.0 | B = | 0.0 1.0 2.0 | | 3.0 1.0 -3.0 | | -1.0 2.0 1.0 | | . . . | * *
This example shows the solution B<--alpha(A-T)B, where A is a real 5 by 5 upper triangular matrix that is not unit triangular, and B is a real 5 by 4 rectangular matrix.
SIDE UPLO TRANSA DIAG M N ALPHA A LDA B LDB | | | | | | | | | | | CALL STRSM( 'L' , 'U' , 'T' , 'N' , 5 , 4 , 1.0 , A , 7 , B , 6 )
* * | -1.0 -4.0 -2.0 2.0 3.0 | | . -2.0 2.0 2.0 2.0 | | . . -3.0 -1.0 4.0 | A = | . . . 1.0 0.0 | | . . . . -2.0 | | . . . . . | | . . . . . | * *
* * | -1.0 -2.0 -3.0 -4.0 | | 2.0 -2.0 -14.0 -12.0 | B = | 10.0 5.0 -8.0 -7.0 | | 14.0 15.0 1.0 8.0 | | -3.0 4.0 3.0 16.0 | | . . . . | * *
* * | 1.0 2.0 3.0 4.0 | | 3.0 3.0 -1.0 2.0 | B = | -2.0 -1.0 0.0 1.0 | | 4.0 4.0 -3.0 -3.0 | | 2.0 2.0 2.0 2.0 | | . . . . | * *
This example shows the solution B<--alphaB(A-1), where A is a real 5 by 5 lower triangular matrix that is not unit triangular, and B is a real 3 by 5 rectangular matrix.
SIDE UPLO TRANSA DIAG M N ALPHA A LDA B LDB | | | | | | | | | | | CALL STRSM( 'R' , 'L' , 'N' , 'N' , 3 , 5 , 1.0 , A , 7 , B , 4 )
* * | 2.0 . . . . | | 2.0 3.0 . . . | | 2.0 1.0 1.0 . . | A = | 0.0 3.0 0.0 -2.0 . | | 2.0 4.0 -1.0 2.0 -1.0 | | . . . . . | | . . . . . | * *
* * | 10.0 4.0 0.0 0.0 1.0 | B = | 10.0 14.0 -4.0 6.0 -3.0 | | -8.0 2.0 -5.0 4.0 -2.0 | | . . . . . | * *
* * | 3.0 4.0 -1.0 -1.0 -1.0 | B = | 2.0 1.0 -1.0 0.0 3.0 | | -2.0 -1.0 -3.0 0.0 2.0 | | . . . . . | * *
This example shows the solution B<--alphaB(A-1), where A is a real 6 by 6 upper triangular matrix that is unit triangular, and B is a real 1 by 6 rectangular matrix.
SIDE UPLO TRANSA DIAG M N ALPHA A LDA B LDB | | | | | | | | | | | CALL STRSM( 'R' , 'U' , 'N' , 'U' , 1 , 6 , 1.0 , A , 7 , B , 2 )
* * | . 2.0 -3.0 1.0 2.0 4.0 | | . . 0.0 1.0 1.0 -2.0 | | . . . 4.0 -1.0 1.0 | A = | . . . . 0.0 -1.0 | | . . . . . 2.0 | | . . . . . . | | . . . . . . | * *
* * B = | 1.0 4.0 -2.0 10.0 2.0 -6.0 | | . . . . . . | * *
* * B = | 1.0 2.0 1.0 3.0 -1.0 -2.0 | | . . . . . . | * *
This example shows the solution B<--alphaB(A-1), where A is a complex 5 by 5 lower triangular matrix that is not unit triangular, and B is a complex 3 by 5 rectangular matrix.
SIDE UPLO TRANSA DIAG M N ALPHA A LDA B LDB | | | | | | | | | | | CALL CTRSM( 'R' , 'L' , 'N' , 'N' , 3 , 5 , ALPHA , A , 7 , B , 4 ) ALPHA = (1.0, 0.0)
* * | (2.0, -3.0) . . . . | | (2.0, -4.0) (3.0, -1.0) . . . | | (2.0, 2.0) (1.0, 2.0) (1.0, 1.0) . . | A = | (0.0, 0.0) (3.0, -1.0) (0.0, -1.0) (-2.0, 1.0) . | | (2.0, 2.0) (4.0, 0.0) (-1.0, 2.0) (2.0, -4.0) (-1.0, -4.0) | | . . . . . | | . . . . . | * *
* * | (22.0, -41.0) (7.0, -26.0) (9.0, 0.0) (-15.0, -3.0) (-15.0, 8.0) | B = | (29.0, -18.0) (24.0, -10.0) (9.0, 6.0) (-12.0, -24.0) (-19.0, -8.0) | | (-15.0, 2.0) (-3.0, -21.0) (-2.0, 4.0) (-4.0, -12.0) (-10.0, -6.0) | | . . . . . | * *
* * | (3.0, 0.0) (4.0, 0.0) (-1.0, -2.0) (-1.0, -1.0) (-1.0, -4.0) | B = | (2.0, -1.0) (1.0, 2.0) (-1.0, -3.0) (0.0, 2.0) (3.0, -4.0) | | (-2.0, 1.0) (-1.0, -3.0) (-3.0, 1.0) (0.0, 0.0) (2.0, -2.0) | | . . . . . | * *
This example shows the solution B<--alpha(A-H)B, where A is a complex 5 by 5 upper triangular matrix that is not unit triangular, and B is a complex 5 by 1 rectangular matrix.
SIDE UPLO TRANSA DIAG M N ALPHA A LDA B LDB | | | | | | | | | | | CALL CTRSM( 'L' , 'U' , 'C' , 'N' , 5 , 1 , ALPHA , A , 6 , B , 6 ) ALPHA = (1.0, 0.0)
* * | (-4.0, 1.0) (4.0, -3.0) (-1.0, 3.0) (0.0, 0.0) (-1.0, 0.0) | | . (-2.0, 0.0) (-3.0, -1.0) (-2.0, -1.0) (4.0, 3.0) | A = | . . (-5.0, 3.0) (-3.0, -3.0) (-5.0, -5.0) | | . . . (4.0, -4.0) (2.0, 0.0) | | . . . . (2.0, -1.0) | | . . . . . | * *
* * | (-8.0, -19.0) | | (8.0, 21.0) | B = | (44.0, -8.0) | | (13.0, -7.0) | | (19.0, 2.0) | | . | * *
* * | (3.0, 4.0) | | (-4.0, 2.0) | B = | (-5.0, 0.0) | | (1.0, 3.0) | | (3.0, 1.0) | | . | * *