Aliasing arrays with Complex{Float64} and Float64 is exactly what rfft! and irfft! are about .
I was mainly using it for pseudo-spectral fluid flow simulation code, where part of the PDE is calculated in real space and part in Fourier space. Then I believe using lazy-reinterpretation would be a deal breaker .
I intend to have the performance fixed by the time 0.7 is released. The
performance was optimal at some point on my branch, but something clearly
regressed. Just busy with semantic changes at the moment.
so hopefully this will go away soon and those tricks will be unnecessary.
I haven’t looked at this implementation yet, but FWIW I’ve often wanted
an rfft! function that took a pre-allocated Complex array to put the
result in, not necessarily re-using the input array. Would that work for
your usecase or does it really need to be the same array with in-place
operation?
This package is to provide “truly” inplace transform. The main advantage is memory saving. I believe it is also faster because of memory locality, but that is just a guess.
A PR to FFTW.jl was made. I tried doing what at-yuyichao said was necessary but I’m not sure I did it correctly. Hopefully at-stevengj will be able to analyze it.