Skip to content

Commit acaf4a1

Browse files
authored
Set FFTW lower compat bound to v1.7 (#221)
* Compatibility with FFTW v1.7 * remove explicit CI test on v1.9 * bump version to v0.15.5 * Add inplace chebyshevtransform tests for small vec * tests for ChebyshevU
1 parent 0e5214f commit acaf4a1

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "FastTransforms"
22
uuid = "057dd010-8810-581a-b7be-e3fc3b93f78c"
3-
version = "0.15.4"
3+
version = "0.15.5"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
@@ -18,7 +18,7 @@ ToeplitzMatrices = "c751599d-da0a-543b-9d20-d0a503d91d24"
1818

1919
[compat]
2020
AbstractFFTs = "1.0"
21-
FFTW = "~1.6"
21+
FFTW = "1.7"
2222
FastGaussQuadrature = "0.4, 0.5"
2323
FastTransforms_jll = "0.6.2"
2424
FillArrays = "0.9, 0.10, 0.11, 0.12, 0.13, 1"

src/chebyshevtransform.jl

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ ChebyshevTransformPlan{T,kind}(plan::FFTW.r2rFFTWPlan{T,K,inplace,N,R}) where {T
1919
ChebyshevTransformPlan{T,kind,K,inplace,N,R}(plan)
2020

2121
# jump through some hoops to make inferrable
22-
@inline kindtuple(N) = NTuple{N,Int32}
23-
@inline kindtuple(N,region...) = Vector{Int32}
2422
function plan_chebyshevtransform!(x::AbstractArray{T,N}, ::Val{1}, dims...; kws...) where {T<:fftwNumber,N}
2523
if isempty(x)
26-
ChebyshevTransformPlan{T,1,kindtuple(N,dims...),true,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
24+
ChebyshevTransformPlan{T,1,Vector{Int32},true,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
2725
else
2826
ChebyshevTransformPlan{T,1}(FFTW.plan_r2r!(x, FIRSTKIND, dims...; kws...))
2927
end
@@ -36,7 +34,7 @@ end
3634

3735
function plan_chebyshevtransform(x::AbstractArray{T,N}, ::Val{1}, dims...; kws...) where {T<:fftwNumber,N}
3836
if isempty(x)
39-
ChebyshevTransformPlan{T,1,kindtuple(N,dims...),false,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
37+
ChebyshevTransformPlan{T,1,Vector{Int32},false,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
4038
else
4139
ChebyshevTransformPlan{T,1}(FFTW.plan_r2r(x, FIRSTKIND, dims...; kws...))
4240
end
@@ -250,7 +248,7 @@ inv(P::IChebyshevTransformPlan{T,1}) where {T} = ChebyshevTransformPlan{T,1}(inv
250248

251249
function plan_ichebyshevtransform!(x::AbstractArray{T,N}, ::Val{1}, dims...; kws...) where {T<:fftwNumber,N}
252250
if isempty(x)
253-
IChebyshevTransformPlan{T,1,kindtuple(N,dims...),true,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
251+
IChebyshevTransformPlan{T,1,Vector{Int32},true,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
254252
else
255253
IChebyshevTransformPlan{T,1}(FFTW.plan_r2r!(x, IFIRSTKIND, dims...; kws...))
256254
end
@@ -262,7 +260,7 @@ end
262260

263261
function plan_ichebyshevtransform(x::AbstractArray{T,N}, ::Val{1}, dims...; kws...) where {T<:fftwNumber,N}
264262
if isempty(x)
265-
IChebyshevTransformPlan{T,1,kindtuple(N,dims...),false,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
263+
IChebyshevTransformPlan{T,1,Vector{Int32},false,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
266264
else
267265
IChebyshevTransformPlan{T,1}(FFTW.plan_r2r(x, IFIRSTKIND, dims...; kws...))
268266
end
@@ -390,7 +388,7 @@ ChebyshevUTransformPlan{T,kind}(plan::FFTW.r2rFFTWPlan{T,K,inplace,N,R}) where {
390388

391389
function plan_chebyshevutransform!(x::AbstractArray{T,N}, ::Val{1}, dims...; kws...) where {T<:fftwNumber,N}
392390
if isempty(x)
393-
ChebyshevUTransformPlan{T,1,kindtuple(N,dims...),true,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
391+
ChebyshevUTransformPlan{T,1,Vector{Int32},true,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
394392
else
395393
ChebyshevUTransformPlan{T,1}(FFTW.plan_r2r!(x, UFIRSTKIND, dims...; kws...))
396394
end
@@ -402,7 +400,7 @@ end
402400

403401
function plan_chebyshevutransform(x::AbstractArray{T,N}, ::Val{1}, dims...; kws...) where {T<:fftwNumber,N}
404402
if isempty(x)
405-
ChebyshevUTransformPlan{T,1,kindtuple(N,dims...),false,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
403+
ChebyshevUTransformPlan{T,1,Vector{Int32},false,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
406404
else
407405
ChebyshevUTransformPlan{T,1}(FFTW.plan_r2r(x, UFIRSTKIND, dims...; kws...))
408406
end
@@ -511,7 +509,7 @@ IChebyshevUTransformPlan{T,kind}(F::FFTW.r2rFFTWPlan{T,K,inplace,N,R}) where {T,
511509

512510
function plan_ichebyshevutransform!(x::AbstractArray{T,N}, ::Val{1}, dims...; kws...) where {T<:fftwNumber,N}
513511
if isempty(x)
514-
IChebyshevUTransformPlan{T,1,kindtuple(N,dims...),true,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
512+
IChebyshevUTransformPlan{T,1,Vector{Int32},true,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
515513
else
516514
IChebyshevUTransformPlan{T,1}(FFTW.plan_r2r!(x, IUFIRSTKIND, dims...; kws...))
517515
end
@@ -523,7 +521,7 @@ end
523521

524522
function plan_ichebyshevutransform(x::AbstractArray{T,N}, ::Val{1}, dims...; kws...) where {T<:fftwNumber,N}
525523
if isempty(x)
526-
IChebyshevUTransformPlan{T,1,kindtuple(N,dims...),false,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
524+
IChebyshevUTransformPlan{T,1,Vector{Int32},false,N,isempty(dims) ? NTuple{N,Int} : typeof(dims[1])}()
527525
else
528526
IChebyshevUTransformPlan{T,1}(FFTW.plan_r2r(x, IUFIRSTKIND, dims...; kws...))
529527
end

test/chebyshevtests.jl

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,17 @@ using FastTransforms, Test
6969
@test g fcopy
7070
@test_throws ArgumentError Pi * T[1,2]
7171

72-
@test chebyshevtransform(T[1]) == T[1]
73-
@test ichebyshevtransform(T[1]) == T[1]
74-
@test chebyshevtransform(T[]) == T[]
75-
@test ichebyshevtransform(T[]) == T[]
72+
v = T[1]
73+
@test chebyshevtransform(v) == v
74+
@test ichebyshevtransform(v) == v
75+
@test chebyshevtransform!(v) === v
76+
@test ichebyshevtransform!(v) === v
77+
78+
v = T[]
79+
@test chebyshevtransform(v) == v
80+
@test ichebyshevtransform(v) == v
81+
@test chebyshevtransform!(v) === v
82+
@test ichebyshevtransform!(v) === v
7683
end
7784
end
7885
@testset "Chebyshev second kind points <-> first kind coefficients" begin
@@ -192,10 +199,17 @@ using FastTransforms, Test
192199
@test g fcopy
193200
@test_throws ArgumentError Pi * T[1,2]
194201

195-
@test chebyshevutransform(T[1]) == T[1]
196-
@test ichebyshevutransform(T[1]) == T[1]
197-
@test chebyshevutransform(T[]) == T[]
198-
@test ichebyshevutransform(T[]) == T[]
202+
v = T[1]
203+
@test chebyshevutransform(v) == v
204+
@test ichebyshevutransform(v) == v
205+
@test chebyshevutransform!(v) === v
206+
@test ichebyshevutransform!(v) === v
207+
208+
v = T[]
209+
@test chebyshevutransform(v) == v
210+
@test ichebyshevutransform(v) == v
211+
@test chebyshevutransform!(v) === v
212+
@test ichebyshevutransform!(v) === v
199213
end
200214
end
201215
@testset "Chebyshev second kind points <-> second kind coefficients" begin

0 commit comments

Comments
 (0)