Skip to content

Commit d0027eb

Browse files
committed
Tests pass, addresses #22
1 parent 4cf9005 commit d0027eb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/plan.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ function AbstractFFTs.plan_fft(x::AbstractArray{T}, region; kwargs...)::FFTAPlan
2626
end
2727
end
2828

29+
function AbstractFFTs.plan_bfft(x::AbstractArray{T}, region; kwargs...)::FFTAPlan{T} where {T <: Complex}
30+
N = length(region)
31+
@assert N <= 2 "Only supports vectors and matrices"
32+
if N == 1
33+
g = CallGraph{T}(size(x,region[]))
34+
pinv = FFTAInvPlan{T}()
35+
return FFTAPlan{T,N}((g,), region, FFT_BACKWARD, pinv)
36+
else
37+
sort!(region)
38+
g1 = CallGraph{T}(size(x,region[1]))
39+
g2 = CallGraph{T}(size(x,region[2]))
40+
pinv = FFTAInvPlan{T}()
41+
return FFTAPlan{T,N}((g1,g2), region, FFT_BACKWARD, pinv)
42+
end
43+
end
44+
2945
function AbstractFFTs.plan_bfft(p::FFTAPlan{T,N}) where {T,N}
3046
return FFTAPlan{T,N}(p.callgraph, p.region, -p.dir, p.pinv)
3147
end

0 commit comments

Comments
 (0)