Skip to main content

csr_matvec

Function csr_matvec 

Source
pub fn csr_matvec<T>(
    mat: &CompressedSparseData2<T>,
    vec: &[T],
) -> Result<Vec<T>, SparseErrors>
where T: BixverseNumeric, <T as Add>::Output: PartialEq<T>,
Expand description

Sparse matrix @ dense vector: M @ v.

Computes result[i] = sum_j M[i, j] * v[j] by iterating CSR rows.

§Params

  • mat - CSR matrix of shape (m, n).
  • vec - Dense vector of length n.

§Returns

Dense vector of length m. Errors if mat is not CSR.