pub(crate) fn transcribe_foldings<F, S>(
    foldings: FoldedPolynomialTree<F, S>,
    threshold_level: usize,
) -> Vec<Vec<F>>
where
    F: Field,
    S: Iterable,
    S::Item: Borrow<F>,
{
    let mut transcribed_foldings = vec![Vec::new(); foldings.depth() - threshold_level];
    // Filter elements in the stream that have a certain threshold and shift the index to match the vector element.
    foldings
        .iter()
        .filter_map(|(i, item)| {
            (i != 0 && i > threshold_level).then(|| (i - threshold_level - 1, item))
        })
        .for_each(|(i, item)| transcribed_foldings[i].push(item));
    // Reverse each element, as they are in little endian.
    transcribed_foldings
        .iter_mut()
        .for_each(|folding| folding.reverse());
    transcribed_foldings
}
/// Store in memory all polynomial foldings after `threshold_level`
Store in memory all polynomial foldings after `threshold_level`
Store in memory all polynomial foldings after ` threshold_level `
pub(crate) fn transcribe_foldings<F, S>(
    foldings: FoldedPolynomialTree<F, S>,
    threshold_level: usize,
) -> Vec<Vec<F>>
where
    F: Field,
    S: Iterable,
    S::Item: Borrow<F>,
{
    let mut transcribed_foldings = vec![Vec::new(); foldings.depth() - threshold_level];
    // Filter elements in the stream that have a certain threshold and shift the index to match the vector element.
    foldings
        .iter()
        .filter_map(|(i, item)| {
            (i != 0 && i > threshold_level).then(|| (i - threshold_level - 1, item))
        })
        .for_each(|(i, item)| transcribed_foldings[i].push(item));
    // Reverse each element, as they are in little endian.
    transcribed_foldings
        .iter_mut()
        .for_each(|folding| folding.reverse());
    transcribed_foldings
}
pub ( crate ) fn transcribe_foldings < F , S > ( foldings : FoldedPolynomialTree < F , S > , threshold_level : usize , ) -> Vec < Vec < F > > where F : Field , S : Iterable , S :: Item : Borrow < F > , { let mut transcribed_foldings = vec ! [ Vec new ( ) foldings depth ( ) threshold_level ] ; // Filter elements in the stream that have a certain threshold and shift the index to match the vector element. foldings . iter ( ) . filter_map ( | ( i , item ) | { ( i != 0 && i > threshold_level ) . then ( | | ( i - threshold_level - 1 , item ) ) } ) . for_each ( | ( i , item ) | transcribed_foldings [ i ] . push ( item ) ) ; // Reverse each element, as they are in little endian. transcribed_foldings . iter_mut ( ) . for_each ( | folding | folding . reverse ( ) ) ; transcribed_foldings }
Store in memory all polynomial foldings after `threshold_level`
Store in memory all polynomial foldings after ` threshold_level `
foldings
FoldedPolynomialTree<F, S>
threshold_level
usize