pub fn evaluate_folding<F, S>(polynomials: &FoldedPolynomialTree<F, S>, x: F) -> Vec<F>
where
    F: Field,
    S: Iterable,
    S::Item: Borrow<F>,
{
    let mut result = vec![F::zero(); polynomials.depth()];
    for (i, c) in polynomials.iter() {
        // foldings are in the interval [[1, n-1]].
        // Align the level with the index in result.
        let i = i - 1;
        result[i] = result[i] * x + c.borrow();
    }

    result
}
/// Evaluate a folded polynomial tree at the point `x`.
///
/// Make a single pass over the [`FoldedPolynomialTree`](crate::subprotocols::sumcheck::streams::FoldedPolynomialTree)
/// and return a vector storing $f^{(j)}(x)$ at the $j-1$-th position.
/// Foldings are in the interval $1, \dots, n-1$.
Evaluate a folded polynomial tree at the point `x`.
Evaluate a folded polynomial tree at the point ` x ` .
pub fn evaluate_folding<F, S>(polynomials: &FoldedPolynomialTree<F, S>, x: F) -> Vec<F>
where
    F: Field,
    S: Iterable,
    S::Item: Borrow<F>,
{
    let mut result = vec![F::zero(); polynomials.depth()];
    for (i, c) in polynomials.iter() {
        // foldings are in the interval [[1, n-1]].
        // Align the level with the index in result.
        let i = i - 1;
        result[i] = result[i] * x + c.borrow();
    }
    result
}
pub fn evaluate_folding < F , S > ( polynomials : & FoldedPolynomialTree < F , S > , x : F ) -> Vec < F > where F : Field , S : Iterable , S :: Item : Borrow < F > , { let mut result = vec ! [ F zero ( ) polynomials depth ( ) ] ; for ( i , c ) in polynomials . iter ( ) { // foldings are in the interval [[1, n-1]]. // Align the level with the index in result. let i = i - 1 ; result [ i ] = result [ i ] * x + c . borrow ( ) ; } result }
Evaluate a folded polynomial tree at the point `x`.
Evaluate a folded polynomial tree at the point ` x ` .
polynomials
&FoldedPolynomialTree<F, S>
x
F