()
| 92 | } |
| 93 | |
| 94 | fn main() { |
| 95 | let mut x = Vec::with_capacity(64); |
| 96 | let mut rng = thread_rng(); |
| 97 | for _i in 0..64 { |
| 98 | let real = rng.gen_range(0.0_f64, 1.0_f64); |
| 99 | x.push(Complex::new(real, 0.0_f64)); |
| 100 | } |
| 101 | let v = fft(&x); |
| 102 | let y = cooley_tukey(&x); |
| 103 | let z = iterative_cooley_tukey(&x); |
| 104 | let t = dft(&x); |
| 105 | |
| 106 | println!( |
| 107 | "{}", |
| 108 | v.iter().zip(y.iter()).all(|i| (i.0 - i.1).norm() < 1.0) |
| 109 | ); |
| 110 | println!( |
| 111 | "{}", |
| 112 | v.iter().zip(z.iter()).all(|i| (i.0 - i.1).norm() < 1.0) |
| 113 | ); |
| 114 | println!( |
| 115 | "{}", |
| 116 | v.iter() |
| 117 | .zip(t.into_iter()) |
| 118 | .all(|i| (i.0 - i.1).norm() < 1.0) |
| 119 | ); |
| 120 | } |
nothing calls this directly
no test coverage detected