Matrix-vector multiply

 

SGBMV/DGBMV/CGBMV/ZGBMV

Output

y

The updated y vector replaces the input.

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:

trans ≠ ’N’ or ’n’ or ’T’ or ’t’ or ’C’ or ’c’ m < 0

n < 0 kl < 0 ku < 0

ldab < kl+ku+1 incx = 0

incy = 0

Actual character arguments in a subroutine call may 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 y = Ax, where A is a 9 by 6 real band matrix whose lower bandwidth is 2 and whose upper bandwidth is 3. A is stored in an array AB whose dimensions are 10 by 10, x is a real vector 6 elements long stored in an array X of dimension 10, and y is a real vector 9 elements long stored in an array Y, also of dimension 10.

CHARACTER*1 TRANS

INTEGER*4 M,N,KL,KU,LDAB,INCX,INCY

REAL*4 ALPHA,BETA,AB(10,10),X(10),Y(10)

TRANS = ’N’

M = 9

N = 6

KL = 2

KU = 3

ALPHA = 1.0

BETA = 0.0

LDAB = 10

INCX = 1

INCY = 1

CALL SGBMV (TRANS,M,N,KL,KU,ALPHA,AB,LDAB,X,INCX,BETA,Y,INCY)

Chapter 3 Basic Matrix Operations 217