arnaucube
arnaucube/shockwave-plusPublic Self-hosted repository
shockwave-plus/tensor_pcs/src/rs_config/smooth.rs
tensor_pcs/src/rs_config/smooth.rsRaw
 1use crate::FieldExt;
 2
 3pub fn gen_config<F: FieldExt>(num_cols: usize) -> Vec<F> {
 4    assert!(num_cols.is_power_of_two());
 5    let expansion_factor = 2;
 6    let codeword_len = num_cols * expansion_factor;
 7
 8    let domain_generator = F::ROOT_OF_UNITY.pow(&[
 9        2u32.pow(32 - ((codeword_len as f64).log2() as u32)) as u64,
10        0,
11        0,
12        0,
13    ]);
14
15    // Compute the FFT domain
16    let mut fft_domain = Vec::with_capacity(codeword_len);
17    fft_domain.push(F::ONE);
18    for i in 0..(codeword_len - 1) {
19        fft_domain.push(fft_domain[i] * domain_generator);
20    }
21
22    fft_domain
23}