1+ module JacobiTest
2+
13using ApproxFunOrthogonalPolynomials
24using ApproxFunBase
35using Test
@@ -13,6 +15,8 @@ using Static
1315using HalfIntegers
1416using OddEvenIntegers
1517
18+ include (" testutils.jl" )
19+
1620@verbose @testset " Jacobi" begin
1721 @testset " Basic" begin
1822 @test jacobip (0 : 5 ,2 ,0.5 ,0.1 ) ≈ [1. ,0.975 ,- 0.28031249999999996 ,- 0.8636328125 ,- 0.0022111816406250743 ,0.7397117980957031 ]
@@ -694,16 +698,21 @@ using OddEvenIntegers
694698 @inferred (() -> Integral (Legendre ()))()
695699 @inferred (() -> Integral (Jacobi (1 ,1 )))()
696700 @inferred (() -> Integral (Jacobi (Ultraspherical (1 ))))()
697- @testset for sp in (Legendre (), Jacobi (1 ,1 ), Jacobi (Ultraspherical (1 )))
698- Ij = Integral (sp, 1 )
699- @test ! isdiag (Ij)
700- f = Fun (sp)
701- g = Ij * f
702- g = Fun (g, sp)
703- g = g - coefficients (g)[1 ]
704- gexp = Fun (x-> x^ 2 / 2 , sp)
705- gexp = gexp - coefficients (gexp)[1 ]
706- @test g ≈ gexp
701+ @inferred (() -> Integral (NormalizedLegendre ()))()
702+ @inferred (() -> Integral (NormalizedJacobi (1 ,1 )))()
703+ @inferred (() -> Integral (NormalizedJacobi (NormalizedUltraspherical (1 ))))()
704+ for sp in (Legendre (), Jacobi (1 ,1 ), Jacobi (Ultraspherical (1 )))
705+ @testset for _sp in (sp, NormalizedPolynomialSpace (sp))
706+ Ij = Integral (_sp, 1 )
707+ @test ! isdiag (Ij)
708+ f = Fun (sp)
709+ g = Ij * f
710+ g = Fun (g, sp)
711+ g = g - coefficients (g)[1 ]
712+ gexp = Fun (x-> x^ 2 / 2 , sp)
713+ gexp = gexp - coefficients (gexp)[1 ]
714+ @test g ≈ gexp
715+ end
707716 end
708717
709718 @testset for n in 3 : 6 , d in ((), (0 .. 1 ,)),
@@ -740,3 +749,5 @@ using OddEvenIntegers
740749 @test ApproxFunBase. hasconversion (Chebyshev ()* Legendre (), NormalizedChebyshev ()* NormalizedLegendre ())
741750 end
742751end
752+
753+ end # module
0 commit comments