Skip to content

Commit deae5c7

Browse files
authored
union rule for Chebyshev and Jacobi (#83)
* union rule for Chebyshev and Jacobi * incompatible domain cheby-legendre union * version bump to v0.4.13
1 parent 81e2851 commit deae5c7

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunOrthogonalPolynomials"
22
uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211"
3-
version = "0.4.12"
3+
version = "0.4.13"
44

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

src/Spaces/Jacobi/JacobiOperators.jl

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -487,20 +487,28 @@ end
487487

488488

489489
function union_rule(A::Chebyshev,B::Jacobi)
490-
if isapprox(B.a,-0.5) && isapprox(B.b,-0.5)
491-
# the spaces are the same
492-
A
490+
if domainscompatible(A, B)
491+
if isapprox(B.a,-0.5) && isapprox(B.b,-0.5)
492+
# the spaces are the same
493+
A
494+
else
495+
union(Jacobi(A),B)
496+
end
493497
else
494-
union(Jacobi(A),B)
498+
NoSpace()
495499
end
496500
end
497501
function union_rule(A::Ultraspherical,B::Jacobi)
498502
m=order(A)
499-
if isapprox(B.a,m-0.5) && isapprox(B.b,m-0.5)
500-
# the spaces are the same
501-
A
503+
if domainscompatible(A, B)
504+
if isapprox(B.a,m-0.5) && isapprox(B.b,m-0.5)
505+
# the spaces are the same
506+
A
507+
else
508+
union(Jacobi(A),B)
509+
end
502510
else
503-
union(Jacobi(A),B)
511+
NoSpace()
504512
end
505513
end
506514

test/JacobiTest.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,22 @@ import ApproxFunOrthogonalPolynomials: jacobip
169169
@test maxspace(a,b) == NoSpace()
170170
@test union(a,b) == Jacobi(-0.5,-0.5)
171171
@test !hasconversion(a,b)
172+
173+
@testset for a in Any[Chebyshev(0..1), Ultraspherical(1, 0..1)]
174+
b = ApproxFunBase.setdomain(Jacobi(a), 1..2)
175+
c = union(a, b)
176+
d = domain(c)
177+
@test 0 in d
178+
@test 1 in d
179+
@test 2 in d
180+
181+
b = Legendre(1..2)
182+
c = union(a, b)
183+
d = domain(c)
184+
@test 0 in d
185+
@test 1 in d
186+
@test 2 in d
187+
end
172188
end
173189

174190
@testset "Reverse orientation" begin

0 commit comments

Comments
 (0)