@@ -109,20 +109,37 @@ end
109109 @test @inferred (AbstractFFTs. fftshift ([1 2 3 ])) == [3 1 2 ]
110110 @test @inferred (AbstractFFTs. fftshift ([1 , 2 , 3 ])) == [3 , 1 , 2 ]
111111 @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 ])
112118
113119 @test @inferred (AbstractFFTs. fftshift ([1 2 3 ; 4 5 6 ], 1 )) == [4 5 6 ; 1 2 3 ]
114120 @test @inferred (AbstractFFTs. fftshift ([1 2 3 ; 4 5 6 ], ())) == [1 2 3 ; 4 5 6 ]
115121 @test @inferred (AbstractFFTs. fftshift ([1 2 3 ; 4 5 6 ], (1 ,2 ))) == [6 4 5 ; 3 1 2 ]
116122 @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 ])
117127
118128 @test @inferred (AbstractFFTs. ifftshift ([1 2 3 ])) == [2 3 1 ]
119129 @test @inferred (AbstractFFTs. ifftshift ([1 , 2 , 3 ])) == [2 , 3 , 1 ]
120130 @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 ])
121134
122135 @test @inferred (AbstractFFTs. ifftshift ([1 2 3 ; 4 5 6 ], 1 )) == [4 5 6 ; 1 2 3 ]
123136 @test @inferred (AbstractFFTs. ifftshift ([1 2 3 ; 4 5 6 ], ())) == [1 2 3 ; 4 5 6 ]
124137 @test @inferred (AbstractFFTs. ifftshift ([1 2 3 ; 4 5 6 ], (1 ,2 ))) == [5 6 4 ; 2 3 1 ]
125138 @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 ])
126143end
127144
128145@testset " FFT Frequencies" begin
0 commit comments