?hpmv
Compute the product of a vector and a triangle-expanded Hermitian matrix, that is,
.
alpha and beta are scaling coefficients, x and y are vectors including n elements, and A is a triangularly expanded Hermitian matrix.
Interface Definition
C interface:
void cblas_chpmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const BLASINT N, const void *alpha, const void *Ap, const void *X, const BLASINT incX, const void *beta, void *Y, const BLASINT incY);
void cblas_zhpmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const BLASINT N, const void *alpha, const void *Ap, const void *X, const BLASINT incX, const void *beta, void *Y, const BLASINT incY);
Fortran interface:
CALL CHPMV(UPLO, N, ALPHA, AP, X, INCX, BETA, Y, INCY)
CALL ZHPMV(UPLO, N, ALPHA, AP, 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 |
Storage expansion mode of matrix A (upper triangle or lower triangle)
|
Input |
N |
Integer |
Order of the matrix A. N must be greater than or equal to zero. |
Input |
alpha |
|
Coefficient |
Input |
Ap |
|
The size of a compressed Hermitian matrix is at least (n*(n+1)/2). |
Input |
X |
|
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 |
|
Multiplication coefficient |
Input |
Y |
|
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 |
Dependencies
#include "kblas.h"
Examples
C interface:
int n = 3;
float alpha[2] = {1.0, 0}, beta[2] = {1.0, 0};
int incx = 1, incy = 1;
/* | (1.0, 0) (3.0, 3.0) (3.0, -3.0) |
* A = | (3.0, -3.0) (2.0, 0.0) (3.0, -1.0) |
* | (3.0, 3.0) (3.0, 1.0) (3.0, 0.0) |
*/
float ap[12] = {1.0, 0, 3.0, -3.0, 3.0, 3.0, 2.0, 0, 3.0, 1.0, 3.0, 0};
float x[6] = {3.0, 2.0, 1.0, 2.0, -1.0, 1.0};
float y[6] = {1.0, 2.0, 3.0, 2.0, -1.0, 1.0};
cblas_chpmv(CblasColMajor,CblasLower, n, alpha, ap, x, incx, beta, y, incy);
/*
* Output y = |1.000000, 19.000000, 18.000000, 7.000000, 0.000000, 26.000000|
*/
Fortran interface:
INTEGER :: N=3
COMPLEX(4) :: ALPHA=(1.0, 0)
COMPLEX(4) :: BETA=(1.0, 0)
INTEGER :: INCX=1
INTEGER :: INCY=1
COMPLEX(4) :: AP(6)
DATA AP/(1.0, 0), (3.0, -3.0), (3.0, 3.0), (2.0, 0), (3.0, 1.0), (3.0, 0)/
COMPLEX(4) :: X(3), Y(3)
DATA X/(3.0, 2.0), (1.0, 2.0), (-1.0, 1.0)/
DATA Y/(1.0, 2.0), (3.0, 2.0), (-1.0, 1.0)/
EXTERNAL CHPMV
CALL CHPMV('L', N, ALPHA, AP, X, INCX, BETA, Y, INCY)
* Output Y = |(1.000000, 19.000000), (18.000000, 7.000000), (0.000000, 26.000000)|