Calulates v.M
(&self, v: &[F])
| 39 | impl<F: Field> SprsMat<F> { |
| 40 | /// Calulates v.M |
| 41 | pub(crate) fn row_mul(&self, v: &[F]) -> Vec<F> { |
| 42 | (0..self.m) |
| 43 | .map(|j| { |
| 44 | let ij = self.ind_ptr[j]..self.ind_ptr[j + 1]; |
| 45 | self.col_ind[ij.clone()] |
| 46 | .iter() |
| 47 | .zip(&self.val[ij]) |
| 48 | .map(|(&idx, x)| v[idx] * x) |
| 49 | .sum::<F>() |
| 50 | }) |
| 51 | .collect::<Vec<_>>() |
| 52 | } |
| 53 | /// Create a new `SprsMat` from list of elements that represents the |
| 54 | /// matrix in column major order. `n` is the number of rows, `m` is |
| 55 | /// the number of columns, and `d` is NNZ in each row. |
no test coverage detected