Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Oppen committed Dec 19, 2023
1 parent f7144f5 commit 149e448
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion math/benches/utils/fft_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use criterion::black_box;
use lambdaworks_math::fft::cpu::{
bit_reversing::in_place_bit_reverse_permute,
fft::{in_place_nr_2radix_fft, in_place_rn_2radix_fft, in_place_nr_4radix_fft},
fft::{in_place_nr_2radix_fft, in_place_nr_4radix_fft, in_place_rn_2radix_fft},
roots_of_unity::get_twiddles,
};
use lambdaworks_math::{field::traits::RootsConfig, polynomial::Polynomial};
Expand Down
14 changes: 11 additions & 3 deletions math/src/fft/cpu/fft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ where
{
debug_assert!(input.len().is_power_of_two());
//debug_assert!(input.len().ilog2() % 2 == 0); // let k = log2(x), k.is_even() => 2^k == 2^2*k'
// with k' = k / 2 => x is power of 4
// with k' = k / 2 => x is power of 4
// divide input in groups, starting with 1, duplicating the number of groups in each stage.
let mut group_count = 1;
let mut group_size = input.len();
Expand All @@ -139,10 +139,18 @@ where
let first_in_group = group * group_size;
let first_in_next_group = first_in_group + group_size / 4;

let (w1, w2, w3) = (&twiddles[group], &twiddles[2 * group], &twiddles[2 * group + 1]);
let (w1, w2, w3) = (
&twiddles[group],
&twiddles[2 * group],
&twiddles[2 * group + 1],
);

for i in first_in_group..first_in_next_group {
let (j, k, l) = (i + group_size / 4, i + group_size / 2, i + 3 * group_size / 4);
let (j, k, l) = (
i + group_size / 4,
i + group_size / 2,
i + 3 * group_size / 4,
);

let zw1 = w1 * &input[k];
let tw1 = w1 * &input[l];
Expand Down

0 comments on commit 149e448

Please sign in to comment.