@@ -109,20 +109,37 @@ end
109
109
@test @inferred (AbstractFFTs. fftshift ([1 2 3 ])) == [3 1 2 ]
110
110
@test @inferred (AbstractFFTs. fftshift ([1 , 2 , 3 ])) == [3 , 1 , 2 ]
111
111
@test @inferred (AbstractFFTs. fftshift ([1 2 3 ; 4 5 6 ])) == [6 4 5 ; 3 1 2 ]
112
+ a = [0 0 0 ]
113
+ b = [0 , 0 , 0 ]
114
+ c = [0 0 0 ; 0 0 0 ]
115
+ @test (AbstractFFTs. fftshift! (a, [1 2 3 ]); a == [3 1 2 ])
116
+ @test (AbstractFFTs. fftshift! (b, [1 , 2 , 3 ]); b == [3 , 1 , 2 ])
117
+ @test (AbstractFFTs. fftshift! (c, [1 2 3 ; 4 5 6 ]); c == [6 4 5 ; 3 1 2 ])
112
118
113
119
@test @inferred (AbstractFFTs. fftshift ([1 2 3 ; 4 5 6 ], 1 )) == [4 5 6 ; 1 2 3 ]
114
120
@test @inferred (AbstractFFTs. fftshift ([1 2 3 ; 4 5 6 ], ())) == [1 2 3 ; 4 5 6 ]
115
121
@test @inferred (AbstractFFTs. fftshift ([1 2 3 ; 4 5 6 ], (1 ,2 ))) == [6 4 5 ; 3 1 2 ]
116
122
@test @inferred (AbstractFFTs. fftshift ([1 2 3 ; 4 5 6 ], 1 : 2 )) == [6 4 5 ; 3 1 2 ]
123
+ @test (AbstractFFTs. fftshift! (c, [1 2 3 ; 4 5 6 ], 1 ); c == [4 5 6 ; 1 2 3 ])
124
+ @test (AbstractFFTs. fftshift! (c, [1 2 3 ; 4 5 6 ], ()); c == [1 2 3 ; 4 5 6 ])
125
+ @test (AbstractFFTs. fftshift! (c, [1 2 3 ; 4 5 6 ], (1 ,2 )); c == [6 4 5 ; 3 1 2 ])
126
+ @test (AbstractFFTs. fftshift! (c, [1 2 3 ; 4 5 6 ], 1 : 2 ); c == [6 4 5 ; 3 1 2 ])
117
127
118
128
@test @inferred (AbstractFFTs. ifftshift ([1 2 3 ])) == [2 3 1 ]
119
129
@test @inferred (AbstractFFTs. ifftshift ([1 , 2 , 3 ])) == [2 , 3 , 1 ]
120
130
@test @inferred (AbstractFFTs. ifftshift ([1 2 3 ; 4 5 6 ])) == [5 6 4 ; 2 3 1 ]
131
+ @test (AbstractFFTs. ifftshift! (a, [1 2 3 ]); a == [2 3 1 ])
132
+ @test (AbstractFFTs. ifftshift! (b, [1 , 2 , 3 ]); b == [2 , 3 , 1 ])
133
+ @test (AbstractFFTs. ifftshift! (c, [1 2 3 ; 4 5 6 ]); c == [5 6 4 ; 2 3 1 ])
121
134
122
135
@test @inferred (AbstractFFTs. ifftshift ([1 2 3 ; 4 5 6 ], 1 )) == [4 5 6 ; 1 2 3 ]
123
136
@test @inferred (AbstractFFTs. ifftshift ([1 2 3 ; 4 5 6 ], ())) == [1 2 3 ; 4 5 6 ]
124
137
@test @inferred (AbstractFFTs. ifftshift ([1 2 3 ; 4 5 6 ], (1 ,2 ))) == [5 6 4 ; 2 3 1 ]
125
138
@test @inferred (AbstractFFTs. ifftshift ([1 2 3 ; 4 5 6 ], 1 : 2 )) == [5 6 4 ; 2 3 1 ]
139
+ @test (AbstractFFTs. ifftshift! (c, [1 2 3 ; 4 5 6 ], 1 ); c == [4 5 6 ; 1 2 3 ])
140
+ @test (AbstractFFTs. ifftshift! (c, [1 2 3 ; 4 5 6 ], ()); c == [1 2 3 ; 4 5 6 ])
141
+ @test (AbstractFFTs. ifftshift! (c, [1 2 3 ; 4 5 6 ], (1 ,2 )); c == [5 6 4 ; 2 3 1 ])
142
+ @test (AbstractFFTs. ifftshift! (c, [1 2 3 ; 4 5 6 ], 1 : 2 ); c == [5 6 4 ; 2 3 1 ])
126
143
end
127
144
128
145
@testset " FFT Frequencies" begin
0 commit comments