This function computes all evaluations of the MLE EQ(i, values) for i between 0...0 and 1...1 (n-bit strings). This results in essentially the same as the tensor_vec function in the `linear_codes/utils.rs`, the difference being the endianness of the order of the output.
(values: &[F])
| 25 | // the same as the tensor_vec function in the `linear_codes/utils.rs`, |
| 26 | // the difference being the endianness of the order of the output. |
| 27 | pub(crate) fn tensor_prime<F: Field>(values: &[F]) -> Vec<F> { |
| 28 | if values.is_empty() { |
| 29 | return vec![F::one()]; |
| 30 | } |
| 31 | |
| 32 | let tail = tensor_prime(&values[1..]); |
| 33 | let val = values[0]; |
| 34 | |
| 35 | cfg_iter!(tail) |
| 36 | .map(|v| *v * (F::one() - val)) |
| 37 | .chain(cfg_iter!(tail).map(|v| *v * val)) |
| 38 | .collect() |
| 39 | } |