cblas_?hbmv

Computes a matrix-vector product using a Hermitian band matrix.

Syntax

void cblas_chbmv (const CBLAS_LAYOUT Layout, const CBLAS_UPLO uplo, const MKL_INT n, const MKL_INT k, const void *alpha, const void *a, const MKL_INT lda, const void *x, const MKL_INT incx, const void *beta, void *y, const MKL_INT incy);

void cblas_zhbmv (const CBLAS_LAYOUT Layout, const CBLAS_UPLO uplo, const MKL_INT n, const MKL_INT k, const void *alpha, const void *a, const MKL_INT lda, const void *x, const MKL_INT incx, const void *beta, void *y, const MKL_INT incy);

Include Files

  • mkl.h

Description

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

where:

alpha and beta are scalars,

x and y are n-element vectors,

A is an n-by-n Hermitian band matrix, with k super-diagonals.

Input Parameters

Layout

Specifies whether two-dimensional array storage is row-major (CblasRowMajor) or column-major (CblasColMajor).

uplo

Specifies whether the upper or lower triangular part of the Hermitian band matrix A is used:

If uplo = CblasUpper, then the upper triangular part of the matrix A is used.

If uplo = CblasLower, then the low triangular part of the matrix A is used.

n

Specifies the order of the matrix A. The value of n must be at least zero.

k

For uplo = CblasUpper: Specifies the number of super-diagonals of the matrix A.

For uplo = CblasLower: Specifies the number of sub-diagonals of the matrix A.

The value of k must satisfy 0k.

alpha

Specifies the scalar alpha.

a

Array, size lda*n.

Layout = CblasColMajor:

Before entry with uplo = CblasUpper, the leading (k + 1) by n part of the array a must contain the upper triangular band part of the Hermitian matrix. The matrix must be supplied column-by-column, with the leading diagonal of the matrix in row k of the array, the first super-diagonal starting at position 1 in row (k - 1), and so on. The top left k by k triangle of the array a is not referenced.

The following program segment transfers the upper triangular part of a Hermitian band matrix from conventional full matrix storage (matrix, with leading dimension ldm) to band storage (a, with leading dimension lda):

for (j = 0; j < n; j++) {
    m = k - j;
    for (i = max( 0, j - k); i <= j; i++) {
        a[(m+i) + j*lda] = matrix[i + j*ldm];
    }
}

Before entry with uplo = CblasLower, the leading (k + 1) by n part of the array a must contain the lower triangular band part of the Hermitian matrix, supplied column-by-column, with the leading diagonal of the matrix in row 0 of the array, the first sub-diagonal starting at position 0 in row 1, and so on. The bottom right k by k triangle of the array a is not referenced.

The following program segment transfers the lower triangular part of a Hermitian band matrix from conventional full matrix storage (matrix, with leading dimension ldm) to band storage (a, with leading dimension lda):

for (j = 0; j < n; j++) {
    m = -j;
    for (i = j; i < min(n, j + k + 1); i++) {
        a[(m+i) + j*lda] = matrix[i + j*ldm];
    }
}

Layout = CblasRowMajor:

Before entry with uplo = CblasUpper, the leading (k + 1)-by-n part of array a must contain the upper triangular band part of the Hermitian matrix. The matrix must be supplied row-by-row, with the leading diagonal of the matrix in column 0 of the array, the first super-diagonal starting at position 0 in column 1, and so on. The bottom right k-by-k triangle of array a is not referenced.

The following program segment transfers the upper triangular part of a Hermitian band matrix from row-major full matrix storage (matrix with leading dimension ldm) to row-major band storage (a, with leading dimension lda):

for (i = 0; i < n; i++) {
    m = -i;
    for (j = i; j < MIN(n, i+k+1); j++) {
        a[(m+j) + i*lda] = matrix[j + i*ldm];
    }
}

Before entry with uplo = CblasLower, the leading (k + 1)-by-n part of array a must contain the lower triangular band part of the Hermitian matrix, supplied row-by-row, with the leading diagonal of the matrix in column k of the array, the first sub-diagonal starting at position 1 in column k-1, and so on. The top left k-by-k triangle of array a is not referenced.

The following program segment transfers the lower triangular part of a Hermitian row-major band matrix from row-major full matrix storage (matrix, with leading dimension ldm) to row-major band storage (a, with leading dimension lda):

for (i = 0; i < n; i++) {
    m = k - i;
    for (j = max(0, i-k); j <= i; j++) {
         a[(m+j) + i*lda] = matrix[j + i*ldm];
    }
}

The imaginary parts of the diagonal elements need not be set and are assumed to be zero.

lda

Specifies the leading dimension of a as declared in the calling (sub)program. The value of lda must be at least (k + 1).

x

Array, size at least (1 + (n - 1)*abs(incx)). Before entry, the incremented array x must contain the vector x.

incx

Specifies the increment for the elements of x.

The value of incx must not be zero.

beta

Specifies the scalar beta.

y

Array, size at least (1 + (n - 1)*abs(incy)). Before entry, the incremented array y must contain the vector y.

incy

Specifies the increment for the elements of y.

The value of incy must not be zero.

Output Parameters

y

Overwritten by the updated vector y.

Select sticky button color: 
Orange (only for download buttons)
For more complete information about compiler optimizations, see our Optimization Notice.