Skip to content

Commit a08f381

Browse files
authored
improve type inference in DCTPlan (#259)
1 parent 0ac21f0 commit a08f381

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/dct.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,14 @@ function idct! end
8080
# Unlike Matlab we compute the multidimensional transform by default,
8181
# similar to the Julia fft functions.
8282

83-
mutable struct DCTPlan{T<:fftwNumber,K,inplace} <: Plan{T}
84-
plan::r2rFFTWPlan{T}
85-
r::Array{UnitRange{Int}} # array of indices for rescaling
83+
mutable struct DCTPlan{T<:fftwNumber,K,inplace,G,R<:r2rFFTWPlan{T}} <: Plan{T}
84+
plan::R
85+
r::Vector{UnitRange{Int}} # array of indices for rescaling
8686
nrm::Float64 # normalization factor
87-
region::Dims # dimensions being transformed
87+
region::G # dimensions being transformed
8888
pinv::DCTPlan{T}
89-
DCTPlan{T,K,inplace}(plan,r,nrm,region) where {T<:fftwNumber,K,inplace} = new(plan,r,nrm,region)
89+
DCTPlan{T,K,inplace}(plan::R,r,nrm,region::G) where {T<:fftwNumber,K,inplace,G,R<:r2rFFTWPlan{T}} =
90+
new{T,K,inplace,G,R}(plan,r,nrm,region)
9091
end
9192

9293
size(p::DCTPlan) = size(p.plan)

0 commit comments

Comments
 (0)