# ?gbmv

Computes a matrix-vector product using a general band matrix

## Syntax

FORTRAN 77:

call sgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy )

call dgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy )

call cgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy )

call zgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy )

Fortran 95:

call gbmv(a, x, y [,kl] [,m] [,alpha] [,beta] [,trans])

## Description

The ?gbmv routines perform a matrix-vector operation defined as
`y := alpha*A*x + beta*y`

or
`y := alpha*A'*x + beta*y,`

or
`y := alpha *conjg(A')*x + beta*y,`

where:

alpha and beta are scalars,

x and y are vectors,

A is an m-by-n band matrix, with kl sub-diagonals and ku super-diagonals.

## Input Parameters

trans

  CHARACTER*1. Specifies the operation:

  If `trans= 'N'` or `'n'`, then `y := alpha*A*x + beta*y`

  If `trans= 'T'` or `'t'`, then `y := alpha*A'*x + beta*y`

  If `trans= 'C'` or `'c'`, then `y := alpha *conjg(A')*x + beta*y`

m

  INTEGER. Specifies the number of rows of the matrix A.

  The value of m must be at least zero.

n

  INTEGER. Specifies the number of columns of the matrix A.

  The value of n must be at least zero.

kl

  INTEGER. Specifies the number of sub-diagonals of the matrix A.

  The value of kl must satisfy `0` ≤ kl.

ku

  INTEGER. Specifies the number of super-diagonals of the matrix A.

  The value of ku must satisfy `0` ≤ ku.

alpha

  REAL for sgbmv

  DOUBLE PRECISION for dgbmv

  COMPLEX for cgbmv

  DOUBLE COMPLEX for zgbmv

  Specifies the scalar alpha.

a

  REAL for sgbmv

  DOUBLE PRECISION for dgbmv

  COMPLEX for cgbmv

  DOUBLE COMPLEX for zgbmv

  Array, DIMENSION `(lda, n)`.

  Before entry, the leading `(kl + ku + 1)` by n part of the array a must contain the matrix of coefficients. This matrix must be supplied column-by-column, with the leading diagonal of the matrix in row `(ku + 1)` of the array, the first super-diagonal starting at position 2 in row ku, the first sub-diagonal starting at position 1 in row `(ku + 2)`, and so on. Elements in the array a that do not correspond to elements in the band matrix (such as the top left ku by ku triangle) are not referenced.

  The following program segment transfers a band matrix from conventional full matrix storage to band storage:
  `do 20, j = 1, n`
  `k = ku + 1 - j`
  `do 10, i = max(1, j-ku), min(m, j+kl)`
  `a(k+i, j) = matrix(i,j)`
  `10 continue`
  `20 continue`

lda

  INTEGER. Specifies the first dimension of a as declared in the calling (sub)program. The value of lda must be at least `(kl + ku + 1)`.

x

  REAL for sgbmv

  DOUBLE PRECISION for dgbmv

  COMPLEX for cgbmv

  DOUBLE COMPLEX for zgbmv

  Array, DIMENSION at least `(1 + (n - 1)*abs(incx))` when `trans = 'N'` or `'n'`, and at least `(1 + (m - 1)*abs(incx))` otherwise. Before entry, the array x must contain the vector x.

incx

  INTEGER. Specifies the increment for the elements of x. incx must not be zero.

beta

  REAL for sgbmv

  DOUBLE PRECISION for dgbmv

  COMPLEX for cgbmv

  DOUBLE COMPLEX for zgbmv

  Specifies the scalar beta. When beta is equal to zero, then y need not be set on input.

y

  REAL for sgbmv

  DOUBLE PRECISION for dgbmv

  COMPLEX for cgbmv

  DOUBLE COMPLEX for zgbmv

  Array, DIMENSION at least `(1 +(m - 1)*abs(incy))` when `trans = 'N'` or 'n' and at least `(1 +(n - 1)*abs(incy))` otherwise. Before entry, the incremented array y must contain the vector y.

incy

  INTEGER. Specifies the increment for the elements of y.

  The value of incy must not be zero.

## Output Parameters

y

  Updated vector y.

## Fortran 95 Interface Notes

Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95 Interface Conventions.

Specific details for the routine gbmv interface are the following:

a

  Holds the array a of size (kl+ku+1, n). Contains a banded matrix m*n with kl lower diagonal and ku upper diagonal.

x

  Holds the vector of length (rx), where `rx = n` if `trans = 'N',rx = m` otherwise.

y

  Holds the vector of length (ry), where `ry = m` if `trans = 'N',ry = n` otherwise.

trans

  Must be 'N', 'C', or 'T'.

  The default value is 'N'.

kl

  If omitted, assumed kl = ku, that is, the number of lower diagonals equals the number of the upper diagonals.

ku

  Restored as ku = lda-kl-1, where lda is the first dimension of matrix A.

m

  If omitted, assumed m = n, that is, a square matrix.

alpha

  The default value is 1.

beta

  The default value is 1.

Parent topic: BLAS Level 2 Routines