238
238
y = randn (size (x))
239
239
for dims in unique ((1 , 1 : N, N))
240
240
P = plan_fft (x, dims)
241
- @test (P' )' * x == P * x # test adjoint of adjoint
241
+ @test (P' )' === P # test adjoint of adjoint
242
242
@test size (P' ) == AbstractFFTs. output_size (P) # test size of adjoint
243
243
@test dot (y, P * x) ≈ dot (P' * y, x) # test validity of adjoint
244
244
@test dot (y, P \ x) ≈ dot (P' \ y, x)
@@ -259,13 +259,13 @@ end
259
259
y = randn (Complex{Float64}, size (P * x))
260
260
@test (P' )' * x == P * x
261
261
@test size (P' ) == AbstractFFTs. output_size (P)
262
- @test dot (y_real , real .(P * x)) + dot (y_imag , imag .(P * x)) ≈ dot (P' * y, x)
263
- @test dot (y_real , real .(P' \ x)) + dot (y_imag , imag .(P' \ x)) ≈ dot (P \ y, x)
262
+ @test dot (real .(y) , real .(P * x)) + dot (imag .(y) , imag .(P * x)) ≈ dot (P' * y, x)
263
+ @test dot (real .(y) , real .(P' \ x)) + dot (imag .(y) , imag .(P' \ x)) ≈ dot (P \ y, x)
264
264
Pinv = plan_irfft (y, size (x)[first (dims)], dims)
265
265
@test (Pinv' )' * y == Pinv * y
266
266
@test size (Pinv' ) == AbstractFFTs. output_size (Pinv)
267
- @test dot (x, Pinv * y) ≈ dot (y_real , real .(Pinv' * x)) + dot (y_imag , imag .(Pinv' * x))
268
- @test dot (x, Pinv' \ y) ≈ dot (y_real , real .(Pinv \ x)) + dot (y_imag , imag .(Pinv \ x))
267
+ @test dot (x, Pinv * y) ≈ dot (real .(y) , real .(Pinv' * x)) + dot (imag .(y) , imag .(Pinv' * x))
268
+ @test dot (x, Pinv' \ y) ≈ dot (real .(y) , real .(Pinv \ x)) + dot (imag .(y) , imag .(Pinv \ x))
269
269
end
270
270
end
271
271
end
0 commit comments