@@ -72,7 +72,7 @@ function test_fft_backend(ArrayType=Array; test_real=true, test_inplace=true)
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
75- x_complexfloat = convert (ArrayType, complex .(float .(x))) # for in-place operations
75+ x_complexfloat = convert (ArrayType, complex .(float .(x))) # for testing in-place complex FFTs
7676 fftw_fft = convert (ArrayType, _fftw_fft)
7777
7878 # FFT
@@ -140,34 +140,34 @@ function test_fft_backend(ArrayType=Array; test_real=true, test_inplace=true)
140140 end
141141
142142 if test_real && (x isa Real)
143- x_real = float .(x) # for testing real FFTs
143+ x_real = float .(x) # for testing in-place real FFTs
144144 # RFFT
145145 fftw_rfft = selectdim (fftw_fft, first (dims), 1 : (size (fftw_fft, first (dims)) ÷ 2 + 1 ))
146- ry = AbstractFFTs. rfft (x_real, dims )
146+ ry = AbstractFFTs. rfft (x )
147147 @test ry ≈ fftw_rfft
148- for P in (plan_rfft (similar (x_real ), dims), inv (plan_irfft (similar (ry), size (x, first (dims)), dims)),
148+ for P in (plan_rfft (similar (x ), dims), inv (plan_irfft (similar (ry), size (x, first (dims)), dims)),
149149 AbstractFFTs. plan_inv (plan_irfft (similar (ry), size (x, first (dims)), dims)))
150150 @test eltype (P) <: Real
151- @test P * x_real ≈ fftw_rfft
151+ @test P * x ≈ fftw_rfft
152152 @test mul! (similar (ry), P, copy (x_real)) ≈ fftw_rfft
153- @test P \ (P * x_real ) ≈ x_real
153+ @test P \ (P * x ) ≈ x
154154 @test fftdims (P) == dims
155155 end
156156
157157 # BRFFT
158- fftw_brfft = prod (size (x_real , d) for d in dims) .* x_real
159- @test AbstractFFTs. brfft (ry, size (x_real , first (dims)), dims) ≈ fftw_brfft
160- P = plan_brfft (similar (ry), size (x_real , first (dims)), dims)
158+ fftw_brfft = prod (size (x , d) for d in dims) .* x
159+ @test AbstractFFTs. brfft (ry, size (x , first (dims)), dims) ≈ fftw_brfft
160+ P = plan_brfft (similar (ry), size (x , first (dims)), dims)
161161 @test P * ry ≈ fftw_brfft
162162 @test mul! (similar (x_real), P, copy (ry)) ≈ fftw_brfft
163163 @test P \ (P * ry) ≈ ry
164164 @test fftdims (P) == dims
165165
166166 # IRFFT
167- fftw_irfft = x_real
167+ fftw_irfft = x
168168 @test AbstractFFTs. irfft (ry, size (x, first (dims)), dims) ≈ fftw_irfft
169- for P in (plan_irfft (similar (ry), size (x, first (dims)), dims), inv (plan_rfft (similar (x_real ), dims)),
170- AbstractFFTs. plan_inv (plan_rfft (similar (x_real ), dims)))
169+ for P in (plan_irfft (similar (ry), size (x, first (dims)), dims), inv (plan_rfft (similar (x ), dims)),
170+ AbstractFFTs. plan_inv (plan_rfft (similar (x ), dims)))
171171 @test P * ry ≈ fftw_irfft
172172 @test mul! (similar (x_real), P, copy (ry)) ≈ fftw_irfft
173173 @test P \ (P * ry) ≈ ry
0 commit comments