STRMM and DTRMM compute one of the following matrix-matrix products, using
the scalar alpha, rectangular matrix B, and triangular matrix
A or its transpose:
1. B<--alphaAB | 3. B<--alphaBA |
|
2. B<--alphaATB | 4. B<--alphaBAT |
|
CTRMM and ZTRMM compute one of the following matrix-matrix products, using
the scalar alpha, rectangular matrix B, and triangular matrix
A, its transpose, or its conjugate transpose:
1. B<--alphaAB | 3. B<--alphaBA | 5. B<--alphaAHB |
2. B<--alphaATB | 4. B<--alphaBAT | 6. B<--alphaBAH |
A, B, alpha | Subroutine |
Short-precision real | STRMM |
Long-precision real | DTRMM |
Short-precision complex | CTRMM |
Long-precision complex | ZTRMM |
Fortran | CALL STRMM | DTRMM | CTRMM | ZTRMM (side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb) |
C and C++ | strmm | dtrmm | ctrmm | ztrmm (side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb); |
PL/I | CALL STRMM | DTRMM | CTRMM | ZTRMM (side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb); |
If side = 'L', A is to the left of B in the equation, resulting in either equation 1, 2, or 5.
If side = 'R', A is to the right of B in the equation, resulting in either equation 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 in the computation, resulting in either equation 1 or 3.
If transa = 'T', AT is used in the computation, resulting in either equation 2 or 4.
If transa = 'C', AH is used in the computation, resulting in either equation 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 78, 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.
These subroutines can perform the following matrix-matrix product computations, using the triangular matrix A, its transpose, or its conjugate transpose, where A can be either upper- or lower-triangular:
where:
where:
See references [32] and [38]. If n or m is 0, no computation is performed.
Unable to allocate internal work area.
None
This example shows the computation B<--alphaAB, where A is a 5 by 5 upper triangular matrix that is not unit triangular, and B is a 5 by 3 rectangular matrix.
SIDE UPLO TRANSA DIAG M N ALPHA A LDA B LDB | | | | | | | | | | | CALL STRMM( '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 | | . . . . . | | . . . . . | * *
* * | 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 | | . . . | * *
* * | 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 | | . . . | * *
This example shows the computation B<--alphaATB, where A is a 5 by 5 upper triangular matrix that is not unit triangular, and B is a 5 by 4 rectangular matrix.
SIDE UPLO TRANSA DIAG M N ALPHA A LDA B LDB | | | | | | | | | | | CALL STRMM( '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 | | 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 | | . . . . | * *
* * | -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 | | . . . . | * *
This example shows the computation B<--alphaBA, where A is a 5 by 5 lower triangular matrix that is not unit triangular, and B is a 3 by 5 rectangular matrix.
SIDE UPLO TRANSA DIAG M N ALPHA A LDA B LDB | | | | | | | | | | | CALL STRMM( '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 | | . . . . . | | . . . . . | * *
* * | 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 | | . . . . . | * *
* * | 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 | | . . . . . | * *
This example shows the computation B<--alphaBA, where A is a 6 by 6 upper triangular matrix that is unit triangular, and B is a 1 by 6 rectangular matrix.
SIDE UPLO TRANSA DIAG M N ALPHA A LDA B LDB | | | | | | | | | | | CALL STRMM( '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 2.0 1.0 3.0 -1.0 -2.0 | | . . . . . . | * *
* * B = | 1.0 4.0 -2.0 10.0 2.0 -6.0 | | . . . . . . | * *
This example shows the computation B<--alphaAHB, where A is a 5 by 5 upper triangular matrix that is not unit triangular, and B is a 5 by 1 rectangular matrix.
SIDE UPLO TRANSA DIAG M N ALPHA A LDA B LDB | | | | | | | | | | | CALL CTRMM( '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) | | . . . . . | * *
* * | (3.0, 4.0) | | (-4.0, 2.0) | B = | (-5.0, 0.0) | | (1.0, 3.0) | | (3.0, 1.0) | | . | * *
* * | (-8.0, -19.0) | | (8.0, 21.0) | B = | (44.0, -8.0) | | (13.0, -7.0) | | (19.0, 2.0) | | . | * *