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

Method row_mul

poly-commit/src/utils.rs:127–146  ·  view source on GitHub ↗

Returns the product v * self, where v is interpreted as a row vector. In other words, it returns a linear combination of the rows of self with coefficients given by v. Panics if the length of v is different from the number of rows of self.

(&self, v: &[F])

Source from the content-addressed store, hash-verified

125 ///
126 /// Panics if the length of v is different from the number of rows of self.
127 pub(crate) fn row_mul(&self, v: &[F]) -> Vec<F> {
128 assert_eq!(
129 v.len(),
130 self.n,
131 "Invalid row multiplication: vector has {} elements whereas each matrix column has {}",
132 v.len(),
133 self.n
134 );
135
136 cfg_into_iter!(0..self.m)
137 .map(|col| {
138 inner_product(
139 v,
140 &cfg_into_iter!(0..self.n)
141 .map(|row| self.entries[row][col])
142 .collect::<Vec<F>>(),
143 )
144 })
145 .collect()
146 }
147}
148
149#[inline]

Callers

nothing calls this directly

Calls 1

inner_productFunction · 0.85

Tested by

no test coverage detected