Skip to content

Commit 94db178

Browse files
Add inverse chebyshev transform plan for Dual (#904)
* Add inverse chebyshev transform plan for Dual * Test inverse Chebyshev transform for dual numbers * Version bump to v0.13.23
1 parent f4cae23 commit 94db178

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFun"
22
uuid = "28f2ccd6-bb30-5033-b560-165f7b14dc2f"
3-
version = "0.13.22"
3+
version = "0.13.23"
44

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

ext/ApproxFunDualNumbersExt.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ using ApproxFun
55
using ApproxFun: TransformPlan, ITransformPlan
66
import ApproxFunBase: valsdomain_type_promote
77
using DomainSets
8-
import FastTransforms: ChebyshevTransformPlan, plan_chebyshevtransform,
9-
plan_chebyshevtransform!, plan_ichebyshevtransform,
10-
plan_ichebyshevtransform!
8+
import FastTransforms: ChebyshevTransformPlan, IChebyshevTransformPlan,
9+
plan_chebyshevtransform, plan_chebyshevtransform!,
10+
plan_ichebyshevtransform, plan_ichebyshevtransform!
1111

1212
# Dual number support. Should there be realpart and dualpart of Space and Domain?
1313
DualNumbers.realpart(f::Fun{S,T}) where {S,T<:Dual} = Fun(space(f),realpart.(coefficients(f)))
@@ -45,6 +45,7 @@ plan_ichebyshevtransform(v::AbstractVector{D}, ::Val{kind}) where {D<:Dual,kind}
4545

4646

4747
Base.:(*)(P::ChebyshevTransformPlan,v::AbstractVector{<:Dual}) = dual.(P*realpart.(v),P*dualpart.(v))
48+
Base.:(*)(P::IChebyshevTransformPlan,v::AbstractVector{<:Dual}) = dual.(P*realpart.(v),P*dualpart.(v))
4849

4950
#TODO: Hardy{false}
5051
for (OP,TransPlan) in ((:plan_transform,:TransformPlan),(:plan_itransform,:ITransformPlan)),

test/ExtrasTest.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ include(joinpath(@__DIR__, "testutils.jl"))
5656
f=Fun(x->exp(dual(x,1)),-1..1)
5757
@test coefficients(realpart(f)) == realpart.(coefficients(f))
5858
@test coefficients(dualpart(f)) == dualpart.(coefficients(f))
59+
60+
# Test inverse Chebyshev transform for dual numbers
61+
@test all(absdual.(transform(space(f),values(f)) - coefficients(f)) .< 10eps())
5962
end
6063

6164
@testset "Eig test #336" begin

0 commit comments

Comments
 (0)