Rate This Document
Findability
Accuracy
Completeness
Readability

?hbmv

Compute the product of a vector and a Hermitian band matrix.

That is, . alpha and beta are multiplication coefficients, x and y are vectors including n elements each, and A is an n-order Hermitian band matrix.

Interface Definition

C interface:

void cblas_chbmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const BLASINT N, const BLASINT K, const void *alpha, const void *A, const BLASINT lda, const void *X, const BLASINT incX, const void *beta, void *Y, const BLASINT incY);

void cblas_zhbmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const BLASINT N, const BLASINT K, const void *alpha, const void *A, const BLASINT lda, const void *X, const BLASINT incX, const void *beta, void *Y, const BLASINT incY);

Fortran interface:

CALL CHBMV(UPLO, N, K, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)

CALL ZHBMV(UPLO, N, K, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)

Parameters

Parameter

Type

Description

Input/Output

order

Enumeration type CBLAS_ORDER

Indicates whether the matrix is in row- or column-major order.

Input

Uplo

Enumeration type CBLAS_UPLO

Indicates the expansion mode of matrix A (upper triangle or lower triangle).

  • If Uplo = CblasUpper, the upper triangle of A is used for expansion.
  • If Uplo = CblasLower, the lower triangle of A is used for expansion.

Input

N

Integer

Order of the matrix A. N must be greater than or equal to 0.

Input

K

Integer

Super diagonal order of the matrix A. K must be greater than or equal to 0.

Input

alpha

  • Single-precision complex type for chbmv
  • Double-precision complex type for zhbmv

Coefficient.

Input

A

  • Single-precision complex type for chbmv
  • Double-precision complex type for zhbmv

Hermitian band matrix A(lda, n).

Input

lda

Integer

Length of the main dimension in matrix A. The value of lda must be greater than or equal to (k + 1).

Input

X

  • Single-precision complex type for chbmv
  • Double-precision complex type for zhbmv

Vector X. The vector scale is at least (1+(N-1)*abs(incX)).

Input

incX

Integer

Increment for elements in X. The value cannot be 0.

Input

beta

  • Single-precision complex type for chbmv
  • Double-precision complex type for zhbmv

Multiplication coefficient.

Input

Y

  • Single-precision complex type for chbmv
  • Double-precision complex type for zhbmv

Vector Y. The vector scale is at least (1+(N-1)*abs(incY)).

Input/Output

incY

Integer

Increment for elements in Y. The value cannot be 0.

Input

Dependency

#include "kblas.h"

Examples

C interface:

    int n = 3, k = 1, lda = 3; 
    float alpha[2] = {1.0, 0}, beta[2] = {1.0, 0}; 
    int incx = 1, incy = 1; 
    /* 
     *            | 1.0, 0.0  7.0, 0.0, 6.0, 0 | 
     *      ap =  | 3.0,-5.0  4.0, 8.0     *   | 
     *            |    *         *         *   | 
     */ 
    float ap[18] = {1.0, 0, 3.0, -5.0, 0, 0, 7.0, 0, 4.0, 8.0, 0.0, 0.0, 6.0, 0, 0, 0, 0, 0}; 
    float x[6] = {3.0, 0.0, 2.0, 0.0, 1.0, 0.0}; 
    float y[6] = {1.0, 0.0, 2.0, 0.0, 3.0, 0.0}; 
 
    cblas_chbmv(CblasColMajor,CblasLower, n, k, alpha, ap, lda, x, incx, beta, y, incy); 
    /* 
     * Output y = | 10.0, 10.0, 29.0, -23.0, 17.0, 16.0| 
     */

Fortran interface:

      INTEGER :: N=3 
      INTEGER :: K=1 
      INTEGER :: LDA=3 
      COMPLEX(4) :: ALPHA=(1.0, 0.0) 
      COMPLEX(4) :: BETA=(1.0, 0.0) 
      INTEGER :: INCX=1 
      INTEGER :: INCY=1 
      COMPLEX(4) :: A(3, 3) 
      DATA A/(1.0, 0), (3.0, -5.0), (0, 0), 
     $       (7.0, 0), (4.0, 8.0), (0.0, 0.0), 
     $       (6.0, 0), (0, 0), (0, 0)/ 
      COMPLEX(4) :: X(3), Y(3) 
      DATA X/(3.0, 0.0), (2.0, 0.0), (1.0, 0.0)/ 
      DATA Y/(1.0, 0.0), (2.0, 0.0), (3.0, 0.0)/ 
      EXTERNAL CHBMV 
      CALL CHBMV('L', N, K, ALPHA, A, LDA, X, INCX, BETA, Y, INCY) 
 
*     Output Y = | (10.0000000, 10.0000000) (29.0000000, -23.0000000) (17.0000000, 16.0000000)|