Skip to content

Commit

Permalink
Include irrft_dim in RealInverseProjectionStyle
Browse files Browse the repository at this point in the history
Co-authored-by: David Widmann <[email protected]>
  • Loading branch information
gaurav-arya and devmotion committed Jun 9, 2022
1 parent cf63bdd commit af74c54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/definitions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -582,15 +582,17 @@ plan_brfft

struct NoProjectionStyle end
struct RealProjectionStyle end
struct RealInverseProjectionStyle end
struct RealInverseProjectionStyle
dim::Int
end
const ProjectionStyle = Union{NoProjectionStyle, RealProjectionStyle, RealInverseProjectionStyle}

function irfft_dim end

output_size(p::Plan) = _output_size(p, ProjectionStyle(p))
_output_size(p::Plan, ::NoProjectionStyle) = size(p)
_output_size(p::Plan, ::RealProjectionStyle) = rfft_output_size(size(p), region(p))
_output_size(p::Plan, ::RealInverseProjectionStyle) = brfft_output_size(size(p), irfft_dim(p), region(p))
_output_size(p::Plan, s::RealInverseProjectionStyle) = brfft_output_size(size(p), s.dim, region(p))

mutable struct AdjointPlan{T,P<:Plan} <: Plan{T}
p::P
Expand Down
3 changes: 1 addition & 2 deletions test/testplans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ mutable struct InverseTestRPlan{T,N,G} <: Plan{T}
end

AbstractFFTs.ProjectionStyle(::TestRPlan) = AbstractFFTs.RealProjectionStyle()
AbstractFFTs.ProjectionStyle(::InverseTestRPlan) = AbstractFFTs.RealInverseProjectionStyle()
AbstractFFTs.irfft_dim(p::InverseTestRPlan) = p.d
AbstractFFTs.ProjectionStyle(p::InverseTestRPlan) = AbstractFFTs.RealInverseProjectionStyle(p.d)

function AbstractFFTs.plan_rfft(x::AbstractArray{T}, region; kwargs...) where {T}
return TestRPlan{T}(region, size(x))
Expand Down

0 comments on commit af74c54

Please sign in to comment.