Developer Reference for Intel® oneAPI Math Kernel Library for C
?gemv
Computes a matrix-vector product using a general matrix.
Syntax
void cblas_sgemv(const CBLAS_LAYOUT Layout, const CBLAS_TRANSPOSE trans, const MKL_INT m,
const MKL_INT n, const float alpha, const float *a, const MKL_INT lda,
const float *x, const MKL_INT incx, const float beta, float *y,
const MKL_INT incy);
void cblas_dgemv(const CBLAS_LAYOUT Layout, const CBLAS_TRANSPOSE trans, const MKL_INT m,
const MKL_INT n, const double alpha, const double *a, const MKL_INT lda,
const double *x, const MKL_INT incx, const double beta, double *y,
const MKL_INT incy);
void cblas_cgemv(const CBLAS_LAYOUT Layout, const CBLAS_TRANSPOSE trans, const MKL_INT m,
const MKL_INT n, 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_zgemv(const CBLAS_LAYOUT Layout, const CBLAS_TRANSPOSE trans, const MKL_INT m,
const MKL_INT n, 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 ?gemv routines perform a matrix-vector operation defined as:
y := alpha*A*x + beta*y ,
or
y := alpha*A'*x + beta*y ,
or
y := alpha*conjg(A')*x + beta*y ,
where:
alpha and beta are scalars,
x and y are vectors,
A is an m -by- n matrix.
Input Parameters
- Layout
-
Specifies whether two-dimensional array storage is row-major ( CblasRowMajor ) or column-major ( CblasColMajor ).
- trans
-
Specifies the operation: if trans = CblasNoTrans , then y := alpha*A*x + beta*y ; if trans = CblasTrans , then y := alpha*A'*x + beta*y ; if trans = CblasConjTrans , then y := alpha *conjg(A')*x + beta*y . CHARACTER*1 Specifies the operation: if trans = 'N' or 'n' , then y := alpha*A*x + beta*y ; if trans= 'T' or 't' , then y := alpha*A'*x + beta*y ; if trans= 'C' or 'c' , then y := alpha *conjg(A')*x + beta*y .
- m
-
Specifies the number of rows of the matrix A . The value of m must be at least zero.
- n
-
Specifies the number of columns of the matrix A . The value of n must be at least zero.
- alpha
-
REAL for sgemv DOUBLE PRECISION for dgemv COMPLEX for cgemv , scgemv DOUBLE COMPLEX for zgemv , dzgemv Specifies the scalar alpha .
- a
-
REAL for sgemv , scgemv DOUBLE PRECISION for dgemv , dzgemv COMPLEX for cgemv DOUBLE COMPLEX for zgemv Array, size (lda, n) . Before entry, the leading m -by- n part of the array a must contain the matrix of coefficients. Array, size lda * k . For Layout = CblasColMajor , k is n . Before entry, the leading m -by- n part of the array a must contain the matrix A . For Layout = CblasRowMajor , k is m . Before entry, the leading n -by- m part of the array a must contain the matrix A .
- lda
-
Specifies the leading dimension of a as declared in the calling (sub)program.
The value of lda must be at least max(1, m) . For Layout = CblasColMajor , the value of lda must be at least max(1, m) . For Layout = CblasRowMajor , the value of lda must be at least max(1, n) .
- x
-
REAL for sgemv DOUBLE PRECISION for dgemv COMPLEX for cgemv , scgemv DOUBLE COMPLEX for zgemv , dzgemv Array, size at least (1+(n-1)*abs(incx)) when trans = CblasNoTrans and at least (1+(m - 1)*abs(incx)) otherwise. Before entry, the incremented array x must contain the vector x . Array, size at least (1+(n-1)*abs(incx)) when trans= 'N' or 'n' and at least (1+(m - 1)*abs(incx)) otherwise. 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
-
REAL for sgemv DOUBLE PRECISION for dgemv COMPLEX for cgemv , scgemv DOUBLE COMPLEX for zgemv , dzgemv Specifies the scalar beta . When beta is set to zero, then y need not be set on input.
- y
-
REAL for sgemv DOUBLE PRECISION for dgemv COMPLEX for cgemv , scgemv DOUBLE COMPLEX for zgemv , dzgemv Array, size at least (1 +(m - 1)*abs(incy)) when trans = CblasNoTrans and at least (1 +(n - 1)*abs(incy)) otherwise. Before entry with non-zero beta , the incremented array y must contain the vector y . Array, size at least (1 +(m - 1)*abs(incy)) when trans= 'N' or 'n' and at least (1 +(n - 1)*abs(incy)) otherwise. Before entry with non-zero beta , 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
-
Updated vector y .
BLAS 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.