# mkl_dcsrmv

Computes matrix - vector product of a sparse matrix stored in the CSR format.

## Syntax

Fortran:

call mkl_dcsrmv(transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)

C:

mkl_dcsrmv(&transa, &m, &k, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta, y);

## Description

The mkl_dcsrmv routine performs a matrix-vector operation defined as
`y := alpha*A*x + beta*y`

or
`y := alpha*A'*x + beta*y,`

where:

alpha and beta are scalars,

x and y are vectors,

A is an m-by-k sparse matrix in the CSR format, A' is the transpose of A.

### Note

This routine supports CSR format both with one-based indexing and zero-based indexing.

## Input Parameters

Parameter descriptions are common for all implemented interfaces with the exception of data types that refer here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the section “Interfaces” below.

transa

  CHARACTER*1. Specifies the operation.

  If `transa = 'N'` or 'n', then `y := alpha*A*x + beta*y`

  If `transa = 'T'` or 't' or 'C' or 'c', then `y := alpha*A'*x + beta*y`,

m

  INTEGER. Number of rows of the matrix A.

k

  INTEGER. Number of columns of the matrix A.

alpha

  REAL*8. Specifies the scalar alpha.

matdescra

  CHARACTER. Array of six elements, specifies properties of the matrix used for operation. Only first four array elements are used, their possible values are given in the “Possible Values of the Parameter matdescra (descra)”.

val

  REAL*8. Array containing non-zero elements of the matrix A.

  For one-based indexing its length is `pntre(m) - pntrb(1)`.

  For zero-based indexing its length is `pntre(m-1) - pntrb(0)`.

  Refer to values array description in CSR Format for more details.

indx

  INTEGER. Array containing the column indices for each non-zero element of the matrix A.Its length is equal to length of the val array.

  Refer to columns array description in CSR Format for more details.

pntrb

  INTEGER. Array of length m.

  For one-based indexing this array contains row indices, such that `pntrb(i) - pntrb(1)+1` is the first index of row i in the arrays val and indx.

  For zero-based indexing this array contains row indices, such that `pntrb(i) - pntrb(0)` is the first index of row i in the arrays val and indx. Refer to pointerb array description in CSR Format for more details.

pntre

  INTEGER. Array of length m.

  For one-based indexing this array contains row indices, such that `pntre(i) - pntrb(1)` is the last index of row i in the arrays val and indx.

  For zero-based indexing this array contains row indices, such that `pntre(i) - pntrb(0)-1` is the last index of row i in the arrays val and indx.Refer to pointerE array description in CSR Format for more details.

x

  REAL*8.

  Array, DIMENSION at least k if `transa = 'N'` or 'n' and at least m otherwise. On entry, the array x must contain the vector x.

beta

  REAL*8. Specifies the scalar beta.

y

  REAL*8.

  Array, DIMENSION at least m if `transa = 'N'` or 'n' and at least k otherwise. On entry, the array y must contain the vector y.

## Output Parameters

y

  Overwritten by the updated vector y.

## Interfaces

## FORTRAN 77:

SUBROUTINE mkl_dcsrmv(transa, m, k, alpha, matdescra, val, indx,

pntrb, pntre, x, beta, y)

CHARACTER*1 transa

CHARACTER matdescra(*)

INTEGER m, k

INTEGER indx(*), pntrb(m), pntre(m)

REAL*8 alpha, beta

REAL*8 val(*), x(*), y(*)

## C:

void mkl_dcsrmv(char *transa, int *m, int *k, double *alpha, char *matdescra,

double *val, int *indx, int *pntrb, int *pntre, double *x, double *beta, double *y);

Parent topic: Sparse BLAS Level 2 and Level 3 Routines.