@@ -72,7 +72,7 @@ function test_fft_backend(ArrayType=Array; test_real=true, test_inplace=true)
72
72
)
73
73
x = convert (ArrayType, _x) # dummy array that will be passed to plans
74
74
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
76
76
fftw_fft = convert (ArrayType, _fftw_fft)
77
77
78
78
# FFT
@@ -140,34 +140,34 @@ function test_fft_backend(ArrayType=Array; test_real=true, test_inplace=true)
140
140
end
141
141
142
142
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
144
144
# RFFT
145
145
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 )
147
147
@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)),
149
149
AbstractFFTs. plan_inv (plan_irfft (similar (ry), size (x, first (dims)), dims)))
150
150
@test eltype (P) <: Real
151
- @test P * x_real ≈ fftw_rfft
151
+ @test P * x ≈ fftw_rfft
152
152
@test mul! (similar (ry), P, copy (x_real)) ≈ fftw_rfft
153
- @test P \ (P * x_real ) ≈ x_real
153
+ @test P \ (P * x ) ≈ x
154
154
@test fftdims (P) == dims
155
155
end
156
156
157
157
# 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)
161
161
@test P * ry ≈ fftw_brfft
162
162
@test mul! (similar (x_real), P, copy (ry)) ≈ fftw_brfft
163
163
@test P \ (P * ry) ≈ ry
164
164
@test fftdims (P) == dims
165
165
166
166
# IRFFT
167
- fftw_irfft = x_real
167
+ fftw_irfft = x
168
168
@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)))
171
171
@test P * ry ≈ fftw_irfft
172
172
@test mul! (similar (x_real), P, copy (ry)) ≈ fftw_irfft
173
173
@test P \ (P * ry) ≈ ry
0 commit comments