-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
Currently fft fails for Unitful data. It is pretty easy to write a work-around that does not even add any dependency on the Unitful package, by using oneunit in Base:
using Unitful: mm
using FFTW: fft
import FFTW: fft
x = ones(8)*mm
#fft(x) # fails ERROR: LoadError: MethodError: no method matching plan_fft...
function fft(x::AbstractArray{<:Number})
u = oneunit(eltype(x))
return fft(x / u) * u
end
fft(x) # works as desiredEdit: perhaps the support should be added at the plan_fft level or such.
Would there be openness for a PR to add such support to FFTW?
Metadata
Metadata
Assignees
Labels
No labels