-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type inconsistencies with FFTW? #14
Comments
I believe these lines Lines 305 to 306 in 926042f
could be changed to plan_rfft(x::StridedArray{T}, region) where {T <: RealFloats} = DummyrFFTPlan{T,false,typeof(region)}(length(x), region)
plan_brfft(x::StridedArray{T}, n::Integer, region) where {T <: ComplexFloats} = DummybrFFTPlan{T,false,typeof(region)}(n, region) as |
I don't know about the history here (perhaps @MikaelSlevinsky does) but it seems better to me to mimick what FFTW does. Thanks for catching this. Yes, we'll definitely consider a PR. This would be a breaking change I guess. |
Not sure about the dummy plans. Maybe @dlfivefifty knows? Probably it's best to do as you say. |
If we're going to change the plans in a (slightly) breaking way, I would like to go for including the size of the arrays in the plans also. That makes the plans less dummy, but it would (a) prevent errors and (b) allow progress with multidimensional transforms. But one step at a time is also good. |
By "size" you mean actual size and not just length? Because the length is already included no? julia> import GenericFFT
julia> rfft_plan = GenericFFT.plan_rfft(zeros(Float16,1024))
GenericFFT.DummyrFFTPlan{ComplexF16, false, UnitRange{Int64}}(1024, 1:1, #undef)
julia> rfft_plan.n
1024
julia> brfft_plan = GenericFFT.plan_brfft(zeros(ComplexF16,513),1024)
GenericFFT.DummybrFFTPlan{ComplexF16, false, UnitRange{Int64}}(1024, 1:1, #undef)
julia> brfft_plan.n
1024 |
Good point. It seems the length is included in some plans, but not in all. It is included for these plans here with an Integer field. I had in mind fixing issue #10. With FFTW it is like this: julia> using FFTW
julia> p = FFTW.plan_rfft(zeros(1024));
julia> p.sz
(1024,)
julia> p = FFTW.plan_rfft(zeros(16,16));
julia> p.sz
(16, 16) |
FFTW plans are
<:AbstractFFTs.Plan{T}
with T complex for complex-to-real plans and T real for real-to-complex plans. So the parametric type of the plan is the type of the input. However, the plans here always seem to be<:AbstractFFTs.Plan{Complex}
. Is that on purpose?The text was updated successfully, but these errors were encountered: