我要评分
获取效率
正确性
完整性
易理解

?tbmv

That is, , , or . x is a vector including n elements, and A is an n*n unit or non-unit triangular band matrix.

Interface Definition

C interface:

void cblas_stbmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const BLASINT K, const float *A, const BLASINT lda, float *X, const BLASINT incX);

void cblas_dtbmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const BLASINT K, const double *A, const BLASINT lda, double *X, const BLASINT incX);

void cblas_ctbmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const BLASINT K, const void *A, const BLASINT lda, void *X, const BLASINT incX);

void cblas_ztbmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const BLASINT K, const void *A, const BLASINT lda, void *X, const BLASINT incX);

Fortran interface:

CALL STBMV(UPLO, TRANS, DIAG, N, K, A, LDA, X, INCX)

CALL DTBMV(UPLO, TRANS, DIAG, N, K, A, LDA, X, INCX)

CALL CTBMV(UPLO, TRANS, DIAG, N, K, A, LDA, X, INCX)

CALL ZTBMV(UPLO, TRANS, DIAG, N, K, A, LDA, X, INCX)

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 whether matrix A is an upper triangular matrix or a lower triangular matrix.

  • If Uplo = CblasUpper, A is an upper triangular matrix.
  • If Uplo = CblasLower, A is a lower triangular matrix.

Input

TransA

Enumeration type CBLAS_TRANSPOSE

Indicates whether the matrix A is a conventional matrix, a transpose matrix, or a conjugate matrix.

  • If trans = CblasNoTrans, then .
  • If trans = CblasTrans, then .
  • If trans = CblasConjTrans, then .

Input

Diag

Enumeration type CBLAS_DIAG

Indicates whether A is a unit trigonometric matrix.

  • If Diag = CblasUnit, A is a unit triangular matrix.
  • If Diag = CblasNonUnit, A is not a unit triangular matrix.

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

A

  • Single-precision floating-point type for stbmv
  • Double-precision floating-point type for dtbmv
  • Single-precision complex type for ctbmv
  • Double-precision complex type for ztbmv

Triangular band matrix A(lda, n).

Input

lda

Integer

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

Input

X

  • Single-precision floating-point type for stbmv
  • Double-precision floating-point type for dtbmv
  • Single-precision complex type for ctbmv
  • Double-precision complex type for ztbmv

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

Input/Output

incX

Integer

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

Input

Dependency

#include "kblas.h"

Examples

C interface:

    int n = 7, k = 3, lda = 5, incx = 1; 
    /** 
     *        |  .    .    .   2.0  2.0  3.0 1.0 | 
     *        |  .    .   2.0  1.0  2.0  4.0 0.0 | 
     *        |  .   2.0  2.0  3.0  4.0  2.0 1.0 | 
     *  A  =  | 1.0  3.0  3.0  3.0  3.0  3.0 3.0 | 
     *        |  .    .    .    .    .    .   .  | 
     */ 
    float a[35] = {0, 0, 0, 1.0, 0, 
                   0, 0, 2.0, 3.0, 0, 
                   0, 2.0, 2.0, 3.0, 0, 
                   2.0, 1.0, 3.0, 3.0, 0, 
                   2.0, 2.0, 4.0, 3.0, 0, 
                   3.0, 4.0, 2.0, 3.0, 0, 
                   1.0, 0.0, 1.0, 3.0, 0}; 
    float x[7] = {2.0, 2.0, 1.0, 2.0, 1.0, 3.0, 4.0}; 
 
    cblas_stbmv(CblasColMajor,CblasUpper, CblasNoTrans, CblasNonUnit, n, k, a, lda, x, incx); 
    /** 
     * Output x = |12.0, 12.0, 20.0, 26.0, 9.0, 13.0, 12.0| 
     */

Fortran interface:

      INTEGER :: N=7, K=3 
      INTEGER :: LDA=5, INCX=1 
      REAL(4) :: A(35), X(7) 
      DATA A/0, 0, 0, 1.0, 0, 
     $       0, 0, 2.0, 3.0, 0, 
     $       0, 2.0, 2.0, 3.0, 0, 
     $       2.0, 1.0, 3.0, 3.0, 0, 
     $       2.0, 2.0, 4.0, 3.0, 0, 
     $       3.0, 4.0, 2.0, 3.0, 0, 
     $       1.0, 0.0, 1.0, 3.0, 0/ 
      DATA X/2.0, 2.0, 1.0, 2.0, 1.0, 3.0, 4.0/ 
      EXTERNAL STBMV 
      CALL STBMV('U', 'N', 'N', N, K, A, LDA, X, INCX) 
 
*     Output X = |12.0, 12.0, 20.0, 26.0, 9.0, 13.0, 12.0|