Skip to main content Module sparse Copy item path Source SparseCoo Coordinate (COO) sparse matrix representation. SparseCsr Compressed Sparse Row (CSR) matrix representation. sparse_add Element-wise addition of two CSR matrices (same dimensions). sparse_matmul Sparse matrix-matrix multiplication (SpGEMM): C = A * B.
Uses row-wise accumulation with BTreeMap for deterministic column ordering.
All floating-point reductions use binned summation. sparse_mul Element-wise multiplication (Hadamard product) of two CSR matrices.
Only positions where BOTH matrices have non-zeros produce non-zeros. sparse_scalar_mul Scalar multiplication: every non-zero element is multiplied by s. sparse_sub Element-wise subtraction of two CSR matrices (same dimensions). sparse_transpose Transpose a CSR matrix. Returns a new CSR where rows and columns are swapped.