Skip to content

Commit f3e6f47

Browse files
authored
hasconversion Chebyshev->Ultraspherical, and maxspace domainscomatible (#235)
1 parent 5f1e6d5 commit f3e6f47

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Spaces/Ultraspherical/Ultraspherical.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ spacescompatible(a::Ultraspherical,b::Ultraspherical) =
131131
compare_orders(order(a), order(b)) && domainscompatible(a,b)
132132
hasfasttransform(::Ultraspherical) = true
133133

134-
134+
# these methods help with type-inference
135+
hasconversion(C::Chebyshev, U::Ultraspherical{<:Union{Int,StaticInt}}) = domainscompatible(C,U)
136+
hasconversion(U::Ultraspherical{<:Union{Int,StaticInt}}, C::Chebyshev) = false
135137

136138
include("UltrasphericalOperators.jl")
137139
include("DirichletSpace.jl")

src/Spaces/Ultraspherical/UltrasphericalOperators.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ function Conversion(A::Ultraspherical,B::Ultraspherical)
191191
end
192192

193193
function maxspace_rule(A::Ultraspherical, B::Ultraspherical)
194+
domainscompatible(A, B) || return NoSpace()
194195
isapproxinteger(order(A) - order(B)) || return NoSpace()
195196
order(A) > order(B) ? A : B
196197
end

0 commit comments

Comments
 (0)