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

Function evaluate_query_set

poly-commit/src/lib.rs:583–602  ·  view source on GitHub ↗

Evaluate the given polynomials at `query_set`.

(
    polys: impl IntoIterator<Item = &'a LabeledPolynomial<F, P>>,
    query_set: &QuerySet<T>,
)

Source from the content-addressed store, hash-verified

581
582/// Evaluate the given polynomials at `query_set`.
583pub fn evaluate_query_set<'a, F, P, T>(
584 polys: impl IntoIterator<Item = &'a LabeledPolynomial<F, P>>,
585 query_set: &QuerySet<T>,
586) -> Evaluations<T, F>
587where
588 F: Field,
589 P: 'a + Polynomial<F, Point = T>,
590 T: Clone + Debug + Hash + Ord + Sync,
591{
592 let polys = BTreeMap::from_iter(polys.into_iter().map(|p| (p.label(), p)));
593 let mut evaluations = Evaluations::new();
594 for (label, (_, point)) in query_set {
595 let poly = polys
596 .get(label)
597 .expect("polynomial in evaluated lc is not found");
598 let eval = poly.evaluate(&point);
599 evaluations.insert((label.clone(), point.clone()), eval);
600 }
601 evaluations
602}
603
604// Separate the information about queries on linear combinations into
605// information about queries on individual polynomials.

Callers 1

open_combinationsMethod · 0.85

Calls 3

labelMethod · 0.80
insertMethod · 0.80
evaluateMethod · 0.45

Tested by

no test coverage detected