order_icfft_input_naive

Function order_icfft_input_naive 

Source
pub fn order_icfft_input_naive(
    input: &mut [FieldElement<Mersenne31Field>],
) -> Vec<FieldElement<Mersenne31Field>>
Expand description

This function permutes a slice of field elements to order the input of the icfft in a specific way. For example, if we want to interpolate 8 points we should input them in the icfft in this order: [(x0, y0), (x2, y2), (x4, y4), (x6, y6), (x7, y7), (x5, y5), (x3, y3), (x1, y1)], where the even indices are found first in ascending order and then the odd indices in descending order. This function permutes the slice [0, 1, 2, 3, 4, 5, 6, 7] into [0, 2, 4, 6, 7, 5, 3, 1]. TODO: This can be optimized by performing in-place value swapping (WIP).