XLPack 7.0
Python API Reference Manual
Loading...
Searching...
No Matches

◆ csr_dusmv()

def csr_dusmv ( trans  ,
,
,
alpha  ,
val  ,
rowptr  ,
colind  ,
base  ,
,
incx  ,
beta  ,
,
incy   
)

y <- αAx + βy or y <- αATx + βy (CSR)

Purpose
This function performs one of the following matrix-vector operations for a sparse matrix in CSR format.
y <- αAx + βy or y <- αA^Tx + βy
where alpha and beta are scalars, x and y are vectors and A is an m x n sparse matrix.
Returns
info (int)
= 0: Successful exit.
= i < 0: The (-i)-th argument is invalid.
Parameters
[in]transSpecifies the operation to be performed.
= 'N': y <- y <- αAx + βy.
= 'T' or 'C': y <- αA^Tx + βy.
[in]mNumber of rows of matrix A. (m >= 0) (If m = 0, returns without computation)
[in]nNumber of columns of matrix A. (n >= 0) (If n = 0, returns without computation)
[in]alphaScalar α
[in]valNumpy ndarray (1-dimensional, float, nnz)
Values of nonzero elements of matrix A (where nnz is the number of nonzero elements).
[in]rowptrNumpy ndarray (1-dimensional, int32, m + 1)
Row pointers of matrix A.
[in]colindNumpy ndarray (1-dimensional, int32, nnz)
Column indices of matrix A (where nnz is the number of nonzero elements).
[in]baseIndexing of rowptr and colind.
= 0: Zero-based (C style) indexing: Starting index is 0.
= 1: One-based (Fortran style) indexing: Starting index is 1.
[in]xNumpy ndarray (1-dimensional, float, 1 + (n - 1)*incx (if trans = 'N'), 1 + (m - 1)*incx (if trans = 'T' or 'C'))
Vector x.
[in]incxStorage spacing between elements of x.
[in]betaScalar β.
[in,out]yNumpy ndarray (1-dimensional, float, 1 + (m - 1)*incy (if trans = 'N'), 1 + (n - 1)*incy (if trans = 'T' or 'C'))
[in] Input vector y (If beta is supplied as zero, y needs not be set on input).
[out] Output vector. (= αAx + βy)
[in]incyStorage spacing between elements of y.