MCPcopy Create free account
hub / github.com/arkworks-rs/poly-commit / row_mul

Method row_mul

poly-commit/src/linear_codes/utils.rs:41–52  ·  view source on GitHub ↗

Calulates v.M

(&self, v: &[F])

Source from the content-addressed store, hash-verified

39impl<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.

Callers 4

openMethod · 0.45
generate_proofFunction · 0.45
encodeMethod · 0.45
openMethod · 0.45

Calls 1

iterMethod · 0.80

Tested by

no test coverage detected