Skip to content

Commit 07e9504

Browse files
authored
coerce compatible jacobi to chebyshev/ultraspherical (#84)
1 parent deae5c7 commit 07e9504

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/Spaces/Jacobi/JacobiOperators.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,11 @@ function union_rule(A::Chebyshev,B::Jacobi)
495495
union(Jacobi(A),B)
496496
end
497497
else
498-
NoSpace()
498+
if isapprox(B.a,-0.5) && isapprox(B.b,-0.5)
499+
union(A, Chebyshev(domain(B)))
500+
else
501+
NoSpace()
502+
end
499503
end
500504
end
501505
function union_rule(A::Ultraspherical,B::Jacobi)
@@ -508,7 +512,11 @@ function union_rule(A::Ultraspherical,B::Jacobi)
508512
union(Jacobi(A),B)
509513
end
510514
else
511-
NoSpace()
515+
if isapprox(B.a,m-0.5) && isapprox(B.b,m-0.5)
516+
union(A, Ultraspherical(m, domain(B)))
517+
else
518+
NoSpace()
519+
end
512520
end
513521
end
514522

test/JacobiTest.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ import ApproxFunOrthogonalPolynomials: jacobip
171171
@test !hasconversion(a,b)
172172

173173
@testset for a in Any[Chebyshev(0..1), Ultraspherical(1, 0..1)]
174+
b = Jacobi(a)
175+
c = union(a, b)
176+
@test c == a
177+
174178
b = ApproxFunBase.setdomain(Jacobi(a), 1..2)
175179
c = union(a, b)
176180
d = domain(c)
@@ -184,6 +188,11 @@ import ApproxFunOrthogonalPolynomials: jacobip
184188
@test 0 in d
185189
@test 1 in d
186190
@test 2 in d
191+
192+
b = Legendre(domain(a))
193+
c = union(a, b)
194+
d = domain(c)
195+
@test d == domain(a)
187196
end
188197
end
189198

0 commit comments

Comments
 (0)