Skip to content

Commit

Permalink
Cheb2LegTH <: Plan (#234)
Browse files Browse the repository at this point in the history
* Cheb2LegTH <: Plan

* avoid stack overflow in different sizes
  • Loading branch information
dlfivefifty authored Nov 13, 2023
1 parent dcaf8f6 commit 90d1dae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/chebyshevtransform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

abstract type ChebyshevPlan{T} <: Plan{T} end

*(P::ChebyshevPlan{T}, x::AbstractArray{T}) where T = error("Plan applied to wrong size array")

size(P::ChebyshevPlan) = isdefined(P, :plan) ? size(P.plan) : (0,)
length(P::ChebyshevPlan) = isdefined(P, :plan) ? length(P.plan) : 0

Expand Down Expand Up @@ -151,6 +153,8 @@ end
ldiv!(_prod_size(size(y), d), y)
end



function *(P::ChebyshevTransformPlan{T,1,K,true,N}, x::AbstractArray{T,N}) where {T,K,N}
isempty(x) && return x

Expand Down
2 changes: 1 addition & 1 deletion src/toeplitzhankel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ end



struct ChebyshevToLegendrePlanTH{TH}
struct ChebyshevToLegendrePlanTH{S,TH<:ToeplitzHankelPlan{S}} <: Plan{S}
toeplitzhankel::TH
end

Expand Down
5 changes: 5 additions & 0 deletions test/chebyshevtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,9 @@ using FastTransforms, Test
@test F \ (F*X) F * (F\X) X
end
end

@testset "incompatible shapes" begin
@test_throws ErrorException plan_chebyshevtransform(randn(5)) * randn(5,5)
@test_throws ErrorException plan_ichebyshevtransform(randn(5)) * randn(5,5)
end
end

2 comments on commit 90d1dae

@dlfivefifty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/95246

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.15.12 -m "<description of version>" 90d1daefccff78ac9f45ee0d1ba487d0f1915569
git push origin v0.15.12

Please sign in to comment.