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

?tpmv

Compute the product of a vector and a packed, triangular expanded matrix.

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

Interface Definition

C interface:

void cblas_stpmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const float *Ap, float *X, const BLASINT incX);

void cblas_dtpmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const double *Ap, double *X, const BLASINT incX);

void cblas_ctpmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const void *Ap, void *X, const BLASINT incX);

void cblas_ztpmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const void *Ap, void *X, const BLASINT incX);

Fortran interface:

CALL STPMV(UPLO, TRANS, DIAG, N, AP, X, INCX)

CALL DTPMV(UPLO, TRANS, DIAG, N, AP, X, INCX)

CALL CTPMV(UPLO, TRANS, DIAG, N, AP, X, INCX)

CALL ZTPMV(UPLO, TRANS, DIAG, N, AP, X, INCX)

Parameters

Parameter

Type

Description

Input/Output

order

Enumeration type CBLAS_ORDER

Whether the matrix is in row- or column-major order.

Input

Uplo

Enumeration type CBLAS_UPLO

Whether to use the upper triangle or lower triangle of matrix A.

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

Input

TransA

Enumeration type CBLAS_TRANSPOSE

Whether matrix A is non-transposed, transposed, or conjugated.

  • If TransA = CblasNoTrans, .
  • If TransA = CblasTrans, .
  • If TransA = CblasConjTrans, .
  • If TransA = CblasConjTrans, .

Input

Diag

  • Enumeration type CBLAS_DIAG

Whether A is a unit triangular 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

Ap

  • Single-precision floating-point type for stpmv
  • Double-precision floating-point type for dtpmv
  • Single-precision complex type for ctpmv
  • Double-precision complex type for ztpmv

The size of a packed triangular matrix is at least (N*(N+1)/2).

Input

X

  • Single-precision floating-point type for stpmv
  • Double-precision floating-point type for dtpmv
  • Single-precision complex type for ctpmv
  • Double-precision complex type for ztpmv

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 = 4, incx = 1; 
    float x[4] = {4.0, 3.0, 2.0, 1.0}; 
    /** 
     *        |  1.0 1.0  1.0  3.0 | 
     * A   =  |  .   3.0  3.0  2.0 | 
     *        |  .    .   2.0  3.0 | 
     *        |  .    .    .   1.0 | 
     */ 
    float ap[10] = {1.0, 1.0, 3.0, 1.0, 3.0, 2.0, 3.0, 2.0, 3.0, 1.0}; 
 
    cblas_stpmv(CblasColMajor, CblasUpper, CblasTrans, CblasNonUnit, n, ap, x, incx); 
    /** 
     * Output x = |4.0, 13.0, 17.0, 25.0| 
     */

Fortran interface:

      INTEGER :: N=4, INCX=1 
      REAL(4) :: X(4), AP(10) 
      DATA X/4.0, 3.0, 2.0, 1.0/ 
      DATA AP/1.0, 1.0, 3.0, 1.0, 3.0, 2.0, 3.0, 2.0, 3.0, 1.0/ 
      EXTERNAL STPMV 
      CALL STPMV('U', 'T', 'N', N, AP, X, INCX) 
 
*     Output X = |4.0, 13.0, 17.0, 25.0|