HP MLIB User's Guide Vol. 1 7th Ed.
248 HP MLIB User’s Guide
SSBMV/DSBMV/CHBMV/ZHBMV Matrix-vector multiply
n < 0
kd < 0
ldab < kd+1
incx = 0
incy = 0
Actual character arguments in a subroutine call can be longer than the
corresponding dummy arguments. Therefore, readability of the CALL
statement may be improved by coding the uplo argument as ’LOWER’ for ’L’ or
’UPPER’ for ’U’. Refer to “Example 2.”
Example 1 Form the REAL*4 matrix-vector product y = Ax, where A is a 75-by-75 real
symmetric band matrix with half bandwidth 15 whose lower triangular part is
stored in an array AB whose dimensions are 25-by-100, and x and y are real
vectors 75 elements long stored in arrays X and Y of dimension 100,
respectively.
CHARACTER*1 UPLO
INTEGER*4 N,KD,LDAB,INCX,INCY
REAL*4 AB(25,100),X(100),Y(100)
UPLO = ’L’
N = 75
KD = 15
LDAB = 25
INCX = 1
INCY = 1
CALL SSBMV (UPLO, N, KD, 1.0, AB, LDAB, X, INCX, 0.0, Y, INCY)
Example 2 Form the REAL*8 matrix-vector product y = Ax, where A is a 75-by-75 real
symmetric band matrix with half bandwidth 15 whose upper triangle is stored
in an array AB whose dimensions are 25-by-100, and x and y are real vectors 75
elements long stored in arrays X and Y of dimension 100, respectively.
INTEGER*4 N,KD,LDAB
REAL*4 AB(25,100),X(100),Y(100)
N = 75
KD = 15
LDAB = 25
CALL DSBMV (’UPPER’, N, KD, 1.0, AB, LDAB, X, 1, 1.0, Y, 1)