Evaluate the given polynomials at `query_set`.
(
polys: impl IntoIterator<Item = &'a LabeledPolynomial<F, P>>,
query_set: &QuerySet<T>,
)
| 581 | |
| 582 | /// Evaluate the given polynomials at `query_set`. |
| 583 | pub 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> |
| 587 | where |
| 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. |
no test coverage detected