-
float aoclsparse_sdoti(const aoclsparse_int nnz, const float *x, const aoclsparse_int *indx, const float *y)#
-
double aoclsparse_ddoti(const aoclsparse_int nnz, const double *x, const aoclsparse_int *indx, const double *y)#
Sparse dot product for single and double data precision real types.
aoclsparse_sdoti() and aoclsparse_ddoti() compute the dot product of a real vector stored in a compressed format and a real dense vector. Let \(x\) and \(y\) be respectively a sparse and dense vectors in \(R^m\) with
indx( \(I_x\)) an indices array of length at leastnnzthat is used to index into the entries of dense vector \(y\), then these functions return\[ {\bf\mathsf{dot}} = \sum_{i=0}^{{\bf\mathsf{nnz}}-1} x_{i} \cdot y_{I_{x_i}}. \]Note
The contents of the vectors are not checked for NaNs.
- Parameters:
nnz – [in] The number of elements to access in vectors
xandindx.x – [in] Array of at least
nnzelements.indx – [in] Nonzero indices set, \(I_x\), of
xdescribed by this array of length at leastnnz. Each entry must contain a valid index intoyand be unique. The entries ofindxare not checked for validity.y – [in] Array of at least \(\max(I_{x_i}, i \in \{ 1,\ldots,{\bf\mathsf{nnz}}\})\) elements.
- Return values:
dot – Value of the dot product if
nnzis positive, otherwise returns 0.