From d022e6094dbec88025fe58dae65df86b668916c1 Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sun, 22 Oct 2023 19:09:33 +0100 Subject: [PATCH] tests pass --- src/chebyshevtransform.jl | 6 +++++- test/chebyshevtests.jl | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/chebyshevtransform.jl b/src/chebyshevtransform.jl index 1d237aa9..28d77eb7 100644 --- a/src/chebyshevtransform.jl +++ b/src/chebyshevtransform.jl @@ -651,10 +651,14 @@ function mul!(y::AbstractArray{T}, P::IChebyshevUTransformPlan{T,1,K,false}, x:: isempty(x) && return y _plan_mul!(y, P.plan, x) _ichebu1_postscale!(P.plan.region, y) + for d in P.plan.region + size(y,d) == 1 && lmul!(2, y) # fix doubling + end + y end function _ichebu2_rescale!(d::Number, x::AbstractArray{T}) where T - _chebu2_prescale!(d, x) + _chebu2_postscale!(d, x) ldiv!(2, x) x end diff --git a/test/chebyshevtests.jl b/test/chebyshevtests.jl index 48ecc115..82b8da5c 100644 --- a/test/chebyshevtests.jl +++ b/test/chebyshevtests.jl @@ -222,7 +222,7 @@ using FastTransforms, Test f̃ = x -> [sin((k+1)*acos(x))/sin(acos(x)) for k=0:n-3]' * g @test f̃(0.1) ≈ exp(T(0.1)) - @test @inferred(ichebyshevutransform(g, Val(2))) ≈ exp.(p_2) + @test @inferred(ichebyshevutransform(g, Val(2))) ≈ f ≈ exp.(p_2) fcopy = copy(f) gcopy = copy(g) @@ -418,7 +418,7 @@ using FastTransforms, Test plan_chebyshevutransform(X,Val(1),2), plan_chebyshevutransform(X, Val(2),2), plan_ichebyshevutransform(X,Val(1),1), plan_ichebyshevutransform(X, Val(2),1), plan_ichebyshevutransform(X,Val(1),2), plan_ichebyshevutransform(X, Val(2),2)) - @test_broken F \ (F*X) ≈ F * (F\X) ≈ X + @test F \ (F*X) ≈ F * (F\X) ≈ X end end end