Previous Next Contents Generated Index Doc Set Home



Product of a Triangular Matrix and a General Matrix

This subroutines described in this section compute the following functions of the triangular matrix A and the general matrix B:

Operation
TRANSA
SIDE
Matrix A

'N' or 'n'

'L' or 'l'

m x m

'T' or 't'

'L' or 'l'

m x m

'C' or 'c'

'L' or 'l'

m x m

'N' or 'n'

'R' or 'r'

n x n

'T' or 't'

'R' or 'r'

n x n

'C' or 'c'

'R' or 'r'

n x n

Calling Sequence

CALL DTRMM 
(SIDE, UPLO, TRANSA, DIAG, M, N, DALPHA, DA, LDA, DB, 
LDB)
CALL STRMM 
(SIDE, UPLO, TRANSA, DIAG, M, N, SALPHA, SA, LDA, SB, 
LDB)
CALL ZTRMM 
(SIDE, UPLO, TRANSA, DIAG, M, N, ZALPHA, ZA, LDA, ZB, 
LDB)
CALL CTRMM 
(SIDE, UPLO, TRANSA, DIAG, M, N, CALPHA, CA, LDA, CB, 
LDB)






void dtrmm 
(char side, char uplo, char transa, char diag, int m, 
int n, double dalpha, double *da, int lda, double *db, 
int ldb)
void strmm 
(char side, char uplo, char transa, char diag, int m, 
int n, float salpha, float *sa, int lda, float *sb, int 
ldb)
void ztrmm 
(char side, char uplo, char transa, char diag, int m, 
int n, doublecomplex *zalpha, doublecomplex *za, int 
lda, doublecomplex *zb, int ldb)
void ctrmm 
(char side, char uplo, char transa, char diag, int m, 
int n, complex *calpha, complex *ca, int lda, complex 
*cb, int ldb)

Arguments

SIDE

Indicates whether the product involving matrices A and B should be formed as AB or BA. The legal values for SIDE are listed below. Any value not listed below is illegal.

'L' or 'l'

Compute AB.

'R' or 'r'

Compute BA.

UPLO

Indicates whether the values in a matrix reside in the upper or lower triangle of the array in which it is stored. The legal values for UPLO are listed below. Any value not listed below is illegal.

'L' or 'l'

Only lower triangle of array will be referenced.

'U' or 'u'

Only upper triangle of array will be referenced.

TRANSA

Indicates how to use the matrix stored in A. The legal values for TRANSA are listed below. Any value not listed below is illegal.

'N' or 'n'

Use the matrix as it is stored in A.

'T' or 't'

Use the transpose of the matrix stored in A.

'C' or 'c'

Use the conjugate transpose of the matrix stored in A.

DIAG

Indicates whether the matrix is unit triangular:

'U' or 'u'

Unit triangular

'N' or 'n'

Not unit triangular

M, N

Indicate the size of matrix A as shown in the table above.

xALPHA

Scalar that scales the input value of the matrix stored in A.

xA

Two-dimensional array in which one of the input matrices is stored.

LDA

Leading dimension of the array A as specified in the dimension or type statement. LDA max (1,N).

If SIDE = 'L' or 'l', LDA max (1,M).

xB

Two-dimensional array.

On entry, one of the input matrices.

On exit, the result matrix.

LDB

Leading dimension of the array B as specified in the dimension or type statement. LDB max(1,M).

Sample Program

 
      PROGRAM TEST
      IMPLICIT NONE
C
      INTEGER LDA, LDC, M, N
      PARAMETER        (M = 3)
      PARAMETER        (LDA = M)
      PARAMETER        (LDC = M)
      PARAMETER        (N = 2)
C
      DOUBLE PRECISION  A(LDA,M), ALPHA, C(LDA,N)
      INTEGER           I, J
C
      EXTERNAL          DTRMM
      INTRINSIC         DBLE
C
C     Initialize the array A to store in triangular form the
C     matrix A shown below.  Initialize the array C to store
C     the matrix C shown below.
C
C          1               11  12
C     A =  2  4       C =  21  22
C          3  5  6         31  32
C
      DATA A / 1.0D0, 2.0D0, 3.0D0, 8D8, 4.0D0, 5.0D0, 8D8, 
     $         8D8, 6.0D0 /
      DATA C / 1.1D1, 2.1D1, 3.1D1, 1.2D1, 2.2D1, 3.2D1 /
C
      PRINT 1000
      DO 100, I = 1, M
        PRINT 1010, (A(I,J), J = 1, I)
  100 CONTINUE
      PRINT 1020
      PRINT 1030, ((C(I,J), J = 1, N), I = 1, M)
      ALPHA = 2.0D0
      CALL DTRMM ('LEFT SIDE A', 'LOWER TRIANGULAR A',
     $            'NO TRANSPOSE A', 'NO UNIT DIAGONAL A', M, N, 
     $             ALPHA, A, LDA, C, LDC)
      PRINT 1040
      PRINT 1030, ((C(I,J), J = 1, N), I = 1, M)
C
 1000 FORMAT (1X, 'A:')
 1010 FORMAT (3(2X, F5.1))
 1020 FORMAT (/1X, 'C:')
 1030 FORMAT (2(2X, F5.1))
 1040 FORMAT (/1X, 'AC:')
C
      END
 

Sample Output

 
 A:
    1.0
    2.0    4.0
    3.0    5.0    6.0



 C:
   11.0   12.0
   21.0   22.0
   31.0   32.0



 AC:
   22.0   24.0
  212.0  224.0
  648.0  676.0






Previous Next Contents Generated Index Doc Set Home