Skip to content

Commit a754c49

Browse files
authored
tests for half odd int in Jacobi (#251)
1 parent 79f670d commit a754c49

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

test/JacobiTest.jl

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ using ApproxFunBaseTest: testbandedbelowoperator, testbandedoperator, testspace,
1010
using ApproxFunOrthogonalPolynomials: jacobip
1111
using StaticArrays: SVector
1212
using Static
13+
using HalfIntegers
14+
using OddEvenIntegers
1315

1416
@verbose @testset "Jacobi" begin
1517
@testset "Basic" begin
@@ -531,24 +533,25 @@ using Static
531533
testspace(Ultraspherical(1); haslineintegral=false)
532534
testspace(Ultraspherical(2); haslineintegral=false)
533535
# minpoints is a tempory fix a bug
534-
@time testspace(Ultraspherical(1//2); haslineintegral=false, minpoints=2)
535-
@test norm(Fun(exp,Ultraspherical(1//2))-Fun(exp,Jacobi(0,0))) < 100eps()
536+
for m in (1//2, half(Odd(1)))
537+
@time testspace(Ultraspherical(m); haslineintegral=false, minpoints=2)
538+
@test norm(Fun(exp,Ultraspherical(m))-Fun(exp,Jacobi(0,0))) < 100eps()
539+
end
536540

537541
C=Conversion(Jacobi(0,0),Chebyshev())
538542
@time testbandedbelowoperator(C)
539543
@test norm(C*Fun(exp,Jacobi(0,0)) - Fun(exp)) < 100eps()
540544

541545

542-
C=Conversion(Ultraspherical(1//2),Chebyshev())
543-
@time testbandedbelowoperator(C)
544-
@test norm(C*Fun(exp,Ultraspherical(1//2)) - Fun(exp)) < 100eps()
545-
546-
547-
548-
C=Conversion(Chebyshev(),Ultraspherical(1//2))
549-
@time testbandedbelowoperator(C)
550-
@test norm(C*Fun(exp)-Fun(exp,Legendre())) < 100eps()
546+
for m in (1//2, half(Odd(1)))
547+
C=Conversion(Ultraspherical(m),Chebyshev())
548+
@time testbandedbelowoperator(C)
549+
@test norm(C*Fun(exp,Ultraspherical(m)) - Fun(exp)) < 100eps()
551550

551+
C=Conversion(Chebyshev(),Ultraspherical(m))
552+
@time testbandedbelowoperator(C)
553+
@test norm(C*Fun(exp)-Fun(exp,Legendre())) < 100eps()
554+
end
552555

553556
C=Conversion(Chebyshev(),Jacobi(0,0))
554557
@time testbandedbelowoperator(C)
@@ -560,8 +563,10 @@ using Static
560563
@test norm(C*Fun(exp) - Fun(exp,Jacobi(1,1))) < 100eps()
561564

562565

563-
C=Conversion(Ultraspherical(1//2),Ultraspherical(1))
564-
@time testbandedbelowoperator(C)
566+
for m in (1//2, half(Odd(1)))
567+
C=Conversion(Ultraspherical(m),Ultraspherical(1))
568+
@time testbandedbelowoperator(C)
569+
end
565570

566571
λ1 = ApproxFunOrthogonalPolynomials.order(domainspace(C))
567572
λ2 = ApproxFunOrthogonalPolynomials.order(rangespace(C))
@@ -577,7 +582,9 @@ using Static
577582

578583
@test norm(Cex - C[1:20,1:20]) < 100eps()
579584

580-
@test norm(C*Fun(exp,Ultraspherical(1//2))-Fun(exp,Ultraspherical(1))) < 100eps()
585+
for m in (1//2, half(Odd(1)))
586+
@test norm(C*Fun(exp,Ultraspherical(m))-Fun(exp,Ultraspherical(1))) < 100eps()
587+
end
581588

582589
C=Conversion(Jacobi(0,0),Ultraspherical(1))
583590
testbandedbelowoperator(C)

0 commit comments

Comments
 (0)