Skip to content

Commit 709fe03

Browse files
committed
Tests pass
1 parent a7a10d2 commit 709fe03

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
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.13"
3+
version = "0.13.0"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/chebyshevtransform.jl

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -539,22 +539,20 @@ chebyshevpoints(n::Integer, kind=Val(1)) = chebyshevpoints(Float64, n, kind)
539539
# Use `Nothing` and fall back to FFT
540540
###
541541

542-
for (kind,KIND,IKIND) in ((1,FIRSTKIND,IFIRSTKIND),(2,SECONDKIND,SECONDKIND))
543-
@eval begin
544-
plan_chebyshevtransform(x::AbstractArray{T,N}, ::Val{$kind}, dims...; kws...) where {T,N} =
545-
ChebyshevTransformPlan{T,$KIND,false,N,Nothing}()
546-
plan_ichebyshevtransform(x::AbstractArray{T,N}, ::Val{$kind}, dims...; kws...) where {T,N} =
547-
IChebyshevTransformPlan{T,$IKIND,false,N,Nothing}()
548-
549-
plan_chebyshevtransform!(x::AbstractArray{T,N}, ::Val{$kind}, dims...; kws...) where {T,N} =
550-
ChebyshevTransformPlan{T,$KIND,true,N,Nothing}()
551-
plan_ichebyshevtransform!(x::AbstractArray{T,N}, ::Val{$kind}, dims...; kws...) where {T,N} =
552-
IChebyshevTransformPlan{T,$IKIND,true,N,Nothing}()
553-
end
554-
end
542+
543+
plan_chebyshevtransform(x::AbstractArray{T,N}, ::Val{kind}, dims...; kws...) where {T,N,kind} =
544+
ChebyshevTransformPlan{T,kind,Nothing,false,N,UnitRange{Int}}()
545+
plan_ichebyshevtransform(x::AbstractArray{T,N}, ::Val{kind}, dims...; kws...) where {T,N,kind} =
546+
IChebyshevTransformPlan{T,kind,Nothing,false,N,UnitRange{Int}}()
547+
548+
plan_chebyshevtransform!(x::AbstractArray{T,N}, ::Val{kind}, dims...; kws...) where {T,N,kind} =
549+
ChebyshevTransformPlan{T,kind,Nothing,true,N,UnitRange{Int}}()
550+
plan_ichebyshevtransform!(x::AbstractArray{T,N}, ::Val{kind}, dims...; kws...) where {T,N,kind} =
551+
IChebyshevTransformPlan{T,kind,Nothing,true,N,UnitRange{Int}}()
552+
555553

556554
#following Chebfun's @Chebtech1/vals2coeffs.m and @Chebtech2/vals2coeffs.m
557-
function *(P::ChebyshevTransformPlan{T,FIRSTKIND,false,1,Nothing}, x::AbstractVector{T}) where T
555+
function *(P::ChebyshevTransformPlan{T,1,Nothing,false}, x::AbstractVector{T}) where T
558556
n = length(x)
559557
if n == 1
560558
x
@@ -568,7 +566,7 @@ function *(P::ChebyshevTransformPlan{T,FIRSTKIND,false,1,Nothing}, x::AbstractVe
568566
end
569567

570568

571-
# function *(P::ChebyshevTransformPlan{T,SECONDKIND,false,Nothing}, x::AbstractVector{T}) where T
569+
# function *(P::ChebyshevTransformPlan{T,1,K,Nothing,false}, x::AbstractVector{T}) where {T,K}
572570
# n = length(x)
573571
# if n == 1
574572
# x
@@ -581,14 +579,14 @@ end
581579
# end
582580

583581

584-
*(P::ChebyshevTransformPlan{T,FIRSTKIND,true,Nothing}, x::AbstractVector{T}) where T =
585-
copyto!(x, ChebyshevTransformPlan{T,FIRSTKIND,false,Nothing}() * x)
582+
*(P::ChebyshevTransformPlan{T,1,Nothing,true,N,R}, x::AbstractVector{T}) where {T,N,R} =
583+
copyto!(x, ChebyshevTransformPlan{T,1,Nothing,false,N,R}() * x)
586584
# *(P::ChebyshevTransformPlan{T,2,true,Nothing}, x::AbstractVector{T}) where T =
587585
# copyto!(x, ChebyshevTransformPlan{T,2,false,Nothing}() * x)
588586

589587

590588
#following Chebfun's @Chebtech1/vals2coeffs.m and @Chebtech2/vals2coeffs.m
591-
function *(P::IChebyshevTransformPlan{T,IFIRSTKIND,false,Nothing}, x::AbstractVector{T}) where T
589+
function *(P::IChebyshevTransformPlan{T,1,Nothing,false}, x::AbstractVector{T}) where T
592590
n = length(x)
593591
if n == 1
594592
x
@@ -601,7 +599,7 @@ function *(P::IChebyshevTransformPlan{T,IFIRSTKIND,false,Nothing}, x::AbstractVe
601599
end
602600
end
603601

604-
# function *(P::IChebyshevTransformPlan{T,SECONDKIND,true,Nothing}, x::AbstractVector{T}) where T
602+
# function *(P::IChebyshevTransformPlan{T,2,K,Nothing,true}, x::AbstractVector{T}) where {T,K}
605603
# n = length(x)
606604
# if n == 1
607605
# x
@@ -614,7 +612,7 @@ end
614612
# end
615613
# end
616614

617-
*(P::IChebyshevTransformPlan{T,IFIRSTKIND,true,Nothing}, x::AbstractVector{T}) where T =
618-
copyto!(x, IChebyshevTransformPlan{T,IFIRSTKIND,false,Nothing}() * x)
615+
*(P::IChebyshevTransformPlan{T,1,Nothing,true,N,R}, x::AbstractVector{T}) where {T,N,R} =
616+
copyto!(x, IChebyshevTransformPlan{T,1,Nothing,false,N,R}() * x)
619617
# *(P::IChebyshevTransformPlan{T,SECONDKIND,false,Nothing}, x::AbstractVector{T}) where T =
620618
# IChebyshevTransformPlan{T,SECONDKIND,true,Nothing}() * copy(x)

0 commit comments

Comments
 (0)