Skip to content

improve type inference in DCTPlan #259

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

Merged
merged 1 commit into from
Mar 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/dct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ function idct! end
# Unlike Matlab we compute the multidimensional transform by default,
# similar to the Julia fft functions.

mutable struct DCTPlan{T<:fftwNumber,K,inplace} <: Plan{T}
plan::r2rFFTWPlan{T}
r::Array{UnitRange{Int}} # array of indices for rescaling
mutable struct DCTPlan{T<:fftwNumber,K,inplace,G,R<:r2rFFTWPlan{T}} <: Plan{T}
plan::R
r::Vector{UnitRange{Int}} # array of indices for rescaling
nrm::Float64 # normalization factor
region::Dims # dimensions being transformed
region::G # dimensions being transformed
pinv::DCTPlan{T}
DCTPlan{T,K,inplace}(plan,r,nrm,region) where {T<:fftwNumber,K,inplace} = new(plan,r,nrm,region)
DCTPlan{T,K,inplace}(plan::R,r,nrm,region::G) where {T<:fftwNumber,K,inplace,G,R<:r2rFFTWPlan{T}} =
new{T,K,inplace,G,R}(plan,r,nrm,region)
end

size(p::DCTPlan) = size(p.plan)
Expand Down