HP MLIB User's Guide Vol. 1 7th Ed.

336 HP MLIB User’s Guide
STRSV/DTRSV/CTRSV/ZTRSV Solve triangular system
Example 1 Perform REAL*4 forward elimination using the 75-by-75 unit-diagonal
lower-triangular real matrix stored in an array A whose dimensions are
100-by-100, and x is a real vector 75 elements long stored in an array X of
dimension 100.
CHARACTER*1 UPLO,TRANS,DIAG
INTEGER*4 N,LDA,INCX
REAL*4 A(100,100),X(100)
UPLO = ’L’
TRANS = ’N’
DIAG = ’U’
N = 75
LDA = 100
INCX = 1
CALL STRSV (UPLO,TRANS,DIAG,N,A,LDA,X,INCX)
Example 2 Perform REAL*4 back substitution using the 75-by-75 nonunit-diagonal,
upper-triangular real matrix stored in an array A whose dimensions are
100-by-100, and x is a real vector 75 elements long stored in an array X of
dimension 100.
INTEGER*4 N,LDA
REAL*4 A(100,100),X(100)
N = 75
LDA = 100
CALL STRSV (’UPPER’,’NONTRANS’,’NONUNIT’,N,A,LDA,X,1)