@@ -28,47 +28,47 @@ prior to calling this function.
2828function test_fft_backend (ArrayType= Array; test_real= true , test_inplace= true )
2929 @testset " fft correctness" begin
3030 # DFT along last dimension, results computed using FFTW
31- for (_x, dims, _fftw_fft) in (
32- (collect (1 : 7 ), 1 ,
33- [28.0 + 0.0im ,
34- - 3.5 + 7.267824888003178im ,
35- - 3.5 + 2.7911568610884143im ,
36- - 3.5 + 0.7988521603655248im ,
37- - 3.5 - 0.7988521603655248im ,
38- - 3.5 - 2.7911568610884143im ,
39- - 3.5 - 7.267824888003178im ]),
40- (collect (1 : 8 ), 1 ,
41- [36.0 + 0.0im ,
42- - 4.0 + 9.65685424949238im ,
43- - 4.0 + 4.0im ,
44- - 4.0 + 1.6568542494923806im ,
45- - 4.0 + 0.0im ,
46- - 4.0 - 1.6568542494923806im ,
47- - 4.0 - 4.0im ,
48- - 4.0 - 9.65685424949238im ]),
49- (collect (reshape (1 : 8 , 2 , 4 )), 2 ,
50- [16.0 + 0.0im - 4.0 + 4.0im - 4.0 + 0.0im - 4.0 - 4.0im ;
51- 20.0 + 0.0im - 4.0 + 4.0im - 4.0 + 0.0im - 4.0 - 4.0im ]),
52- (collect (reshape (1 : 9 , 3 , 3 )), 2 ,
53- [12.0 + 0.0im - 4.5 + 2.598076211353316im - 4.5 - 2.598076211353316im ;
54- 15.0 + 0.0im - 4.5 + 2.598076211353316im - 4.5 - 2.598076211353316im ;
55- 18.0 + 0.0im - 4.5 + 2.598076211353316im - 4.5 - 2.598076211353316im ]),
56- (collect (reshape (1 : 8 , 2 , 2 , 2 )), 1 : 2 ,
57- cat ([10.0 + 0.0im - 4.0 + 0.0im ; - 2.0 + 0.0im 0.0 + 0.0im ],
58- [26.0 + 0.0im - 4.0 + 0.0im ; - 2.0 + 0.0im 0.0 + 0.0im ],
59- dims= 3 )),
60- (collect (1 : 7 ) + im * collect (8 : 14 ), 1 ,
61- [28.0 + 77.0im ,
62- - 10.76782488800318 + 3.767824888003175im ,
63- - 6.291156861088416 - 0.7088431389115883im ,
64- - 4.298852160365525 - 2.7011478396344746im ,
65- - 2.7011478396344764 - 4.298852160365524im ,
66- - 0.7088431389115866 - 6.291156861088417im ,
67- 3.767824888003177 - 10.76782488800318im ]),
68- (collect (reshape (1 : 8 , 2 , 2 , 2 )) + im * reshape (9 : 16 , 2 , 2 , 2 ), 1 : 2 ,
69- cat ([10.0 + 42.0im - 4.0 - 4.0im ; - 2.0 - 2.0im 0.0 + 0.0im ],
70- [26.0 + 58.0im - 4.0 - 4.0im ; - 2.0 - 2.0im 0.0 + 0.0im ],
71- dims= 3 )),
31+ for (; _x, dims, _fftw_fft) in (
32+ (; _x = collect (1 : 7 ), dims = 1 ,
33+ _fftw_fft = [28.0 + 0.0im ,
34+ - 3.5 + 7.267824888003178im ,
35+ - 3.5 + 2.7911568610884143im ,
36+ - 3.5 + 0.7988521603655248im ,
37+ - 3.5 - 0.7988521603655248im ,
38+ - 3.5 - 2.7911568610884143im ,
39+ - 3.5 - 7.267824888003178im ]),
40+ (; _x = collect (1 : 8 ), dims = 1 ,
41+ _fftw_fft = [36.0 + 0.0im ,
42+ - 4.0 + 9.65685424949238im ,
43+ - 4.0 + 4.0im ,
44+ - 4.0 + 1.6568542494923806im ,
45+ - 4.0 + 0.0im ,
46+ - 4.0 - 1.6568542494923806im ,
47+ - 4.0 - 4.0im ,
48+ - 4.0 - 9.65685424949238im ]),
49+ (; _x = collect (reshape (1 : 8 , 2 , 4 )), dims = 2 ,
50+ _fftw_fft = [16.0 + 0.0im - 4.0 + 4.0im - 4.0 + 0.0im - 4.0 - 4.0im ;
51+ 20.0 + 0.0im - 4.0 + 4.0im - 4.0 + 0.0im - 4.0 - 4.0im ]),
52+ (; _x = collect (reshape (1 : 9 , 3 , 3 )), dims = 2 ,
53+ _fftw_fft = [12.0 + 0.0im - 4.5 + 2.598076211353316im - 4.5 - 2.598076211353316im ;
54+ 15.0 + 0.0im - 4.5 + 2.598076211353316im - 4.5 - 2.598076211353316im ;
55+ 18.0 + 0.0im - 4.5 + 2.598076211353316im - 4.5 - 2.598076211353316im ]),
56+ (; _x = collect (reshape (1 : 8 , 2 , 2 , 2 )), dims = 1 : 2 ,
57+ _fftw_fft = cat ([10.0 + 0.0im - 4.0 + 0.0im ; - 2.0 + 0.0im 0.0 + 0.0im ],
58+ [26.0 + 0.0im - 4.0 + 0.0im ; - 2.0 + 0.0im 0.0 + 0.0im ],
59+ dims= 3 )),
60+ (; _x = collect (1 : 7 ) + im * collect (8 : 14 ), dims = 1 ,
61+ _fftw_fft = [28.0 + 77.0im ,
62+ - 10.76782488800318 + 3.767824888003175im ,
63+ - 6.291156861088416 - 0.7088431389115883im ,
64+ - 4.298852160365525 - 2.7011478396344746im ,
65+ - 2.7011478396344764 - 4.298852160365524im ,
66+ - 0.7088431389115866 - 6.291156861088417im ,
67+ 3.767824888003177 - 10.76782488800318im ]),
68+ (; _x = collect (reshape (1 : 8 , 2 , 2 , 2 )) + im * reshape (9 : 16 , 2 , 2 , 2 ), dims = 1 : 2 ,
69+ _fftw_fft = cat ([10.0 + 42.0im - 4.0 - 4.0im ; - 2.0 - 2.0im 0.0 + 0.0im ],
70+ [26.0 + 58.0im - 4.0 - 4.0im ; - 2.0 - 2.0im 0.0 + 0.0im ],
71+ dims= 3 )),
7272 )
7373 x = convert (ArrayType, _x) # dummy array that will be passed to plans
7474 x_complex = convert (ArrayType, complex .(x)) # for testing complex FFTs
0 commit comments