Solve triangular systems

STRSM/DTRSM/CTRSM/ZTRSM

Example 1 Form the REAL*4 matrix solution A−1B, where A is a 6-by-6 nonunit-diagonal, upper-triangular real matrix stored in an array A whose dimensions are

10-by-10 and B is a 6-by-8 real matrix stored in an array B of dimension 10-by-10. The matrix solution overwrites the input B matrix.

CHARACTER*1 SIDE,UPLO,TRANSA,DIAG

INTEGER*4 M,N,LDA,LDB

REAL*4 ALPHA,A(10,10),B(10,10)

SIDE = ’L’

UPLO = ’U’

TRANSA = ’N’

DIAG = ’N’

M = 6

N = 8

ALPHA = 1.0

LDA = 10

LDB = 10

CALL STRSM (SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB)

Example 2 Form the REAL*8 matrix solution qBAT, where q is a real scalar, B is a 6-by-8 real matrix stored in an array B of dimension 10-by-10, and A is a 8-by-8 unit-diagonal lower-triangular real matrix stored in an array A whose dimensions are 10-by-10. The matrix solution overwrites the input B matrix.

INTEGER*4 M,N,LDA,LDB

REAL*8

Q,A(10,10),B(10,10)

M = 6

 

N = 8

 

LDA

= 10

 

LDB

= 10

 

CALL DTRSM (’RIGHT’,’LOWER’,’TRANS’,’UNIT’,M,N,Q,A,LDA,B,LDB)

Chapter 3 Basic Matrix Operations 331