JuliaApproximation / JuliaApproximation/GenericFFT.jl

inverse of bfft plan not supported

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
16
Forks
6
PR merge metrics
No merged PRs in 30d

Description

julia> using GenericFFT

julia> P = plan_bfft(zeros(BigFloat, 16))
GenericFFT.DummybFFTPlan{Complex{BigFloat}, false, UnitRange{Int64}}(1:1, #undef)

julia> inv(P)
ERROR: MethodError: no method matching plan_inv(::GenericFFT.DummybFFTPlan{Complex{BigFloat}, false, UnitRange{Int64}})

The likely reason is that the inverse of a bFFTPlan should be a ScaledPlan, which needs the dimension of the plan in order to compute the scale factor. However, our dummy plans do not currently store the size. Like this:

julia> P = plan_bfft(zeros(16))
FFTW backward plan for 16-element array of ComplexF64
(dft-direct-16 "n2bv_16_avx2_128")

julia> inv(P)
0.0625 * FFTW forward plan for 16-element array of ComplexF64
(dft-direct-16 "n2fv_16_avx2_128")

julia> typeof(inv(P))
AbstractFFTs.ScaledPlan{ComplexF64, FFTW.cFFTWPlan{ComplexF64, -1, false, 1, UnitRange{Int64}}, Float64}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the dummy bFFT plan implementation and the plan_inv methods used by inv(P). Compare the expected ScaledPlan behavior shown for FFTW, then add coverage for inv(plan_bfft(...)) and verify that the inverse plan uses the correct scale factor.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.