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

326 HP MLIB User’s Guide
STRMV/DTRMV/CTRMV/ZTRMV Matrix-vector multiply
Notes These subprograms conform to specifications of the Level 2 BLAS.
If an error in the arguments is detected, the subprograms call error handler
XERBLA, which writes an error message onto the standard error file and
terminates execution. The standard version of XERBLA (refer to the end of this
chapter) can be replaced with a user-supplied version to change the error
procedure. Error conditions are:
uplo ’L’ or ’l’ or ’U’ or ’u’
trans ’N’ or ’n’ or ’T’ or ’t’ or ’C’ or ’c’
diag ’N’ or ’n’ or ’U’ or ’u’
n < 0
lda < max(n,1)
incx = 0
Actual character arguments in a subroutine call can be longer than the
corresponding dummy arguments. Therefore, readability of the CALL
statement can be improved by coding the trans argument as ’NORMAL’ or
’NONTRANS’ for ’N’, ’TRANSPOSE’ for ’T’, or ’CTRANS’ for ’C’. Refer to
“Example 2.
Example 1 Form the REAL*4 matrix-vector product Ax, where A is a 9-by-9 unit-diagonal
lower-triangular real matrix stored in an array A whose dimensions are
10-by-10, and x is a real vector 9 elements long stored in an array X of
dimension 10.
CHARACTER*1 UPLO,TRANS,DIAG
INTEGER*4 N,LDA,INCX
REAL*4 A(10,10),X(10)
UPLO = ’L’
TRANS = ’N’
DIAG = ’U’
N = 9
LDA = 10
INCX = 1
CALL STRMV (UPLO,TRANS,DIAG,N,A,LDA,X,INCX)
Example 2 Form the REAL*8 matrix-vector product A
T
x, where A is a 9-by-9
nonunit-diagonal, upper-triangular real matrix stored in an array A whose
dimensions are 10-by-10, and x is a real vector 9 elements long stored in an
array X of dimension 10.
INTEGER*4 N,LDA
REAL*8 A(10,10),X(10)
N = 6
LDA = 10
CALL DTRMV (’UPPER’,’TRANSPOSE’,’NONUNIT’,N,A,LDA,X,1)