to_slice_of_mles

Function to_slice_of_mles 

Source
pub fn to_slice_of_mles<F: Field, const N: usize>(
    inputs: Vec<[F; N]>,
) -> [MultilinearExtension<F>; N]
Expand description

Helper function that converts a Vec<[F; N]> into a [MultilinearExtension<F>; N], i.e. that changes the order of the enumeration by iterating first over the inner index, then the outer index.

ยงExample:

use shared_types::Fr;
use frontend::digits::to_slice_of_mles;
let inputs = vec![
    [Fr::from(1), Fr::from(2), Fr::from(3)],
    [Fr::from(4), Fr::from(5), Fr::from(6)],
];
let expected_evals = [
    vec![Fr::from(1), Fr::from(4)],
    vec![Fr::from(2), Fr::from(5)],
    vec![Fr::from(3), Fr::from(6)],
];
let actual_evals: Vec<Vec<Fr>> = to_slice_of_mles(inputs).into_iter().map(|mle| mle.to_vec()).collect();
assert_eq!(actual_evals, expected_evals);