MCPcopy Create free account
hub / github.com/docknetwork/crypto / generate

Method generate

vb_accumulator/src/batch_utils.rs:86–93  ·  view source on GitHub ↗

Given a list of elements as `updates`, generates a polynomial `(updates[0]-x) * (updates[1]-x) * (updates[2] - x)...(updates[last] - x)`.

(updates: &[F])

Source from the content-addressed store, hash-verified

84{
85 /// Given a list of elements as `updates`, generates a polynomial `(updates[0]-x) * (updates[1]-x) * (updates[2] - x)...(updates[last] - x)`.
86 pub fn generate(updates: &[F]) -> Self {
87 if updates.is_empty() {
88 // Returning constant polynomial with value one as the evaluation of this polynomial is multiplied by the old witness
89 Self(DensePolynomial::from_coefficients_slice(&[F::one()]))
90 } else {
91 Self(poly_from_given_updates(updates))
92 }
93 }
94
95 /// Evaluate this polynomial at `x`
96 pub fn eval(&self, x: &F) -> F {

Callers

nothing calls this directly

Calls 7

poly_from_given_updatesFunction · 0.85
multiply_polyFunction · 0.85
inner_product_polyFunction · 0.85
mapMethod · 0.80
is_emptyMethod · 0.45
lenMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected