Skip to content

Commit c000519

Browse files
authored
Don't define Legendre using StaticInt (#174)
1 parent ecedd39 commit c000519

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/Spaces/Jacobi/Jacobi.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct Jacobi{D<:Domain,R,T} <: PolynomialSpace{D,R}
1313
end
1414
Jacobi(b::T,a::T,d::Domain) where {T} =
1515
Jacobi{typeof(d),promote_type(T,real(prectype(d)))}(b, a, d)
16-
Legendre(domain) = Jacobi(static(0),static(0),domain)
16+
Legendre(domain) = Jacobi(0,0,domain)
1717
Legendre() = Legendre(ChebyshevInterval())
1818
Jacobi(b,a,d::Domain) = Jacobi(promote(dynamic(b), dynamic(a))...,d)
1919
Jacobi(b,a,d) = Jacobi(b,a,Domain(d))

test/JacobiTest.jl

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,23 @@ using Static
7070
we don't use the floating point orders directly in tests
7171
See https://github.com/SciML/Static.jl/issues/97
7272
=#
73+
L = Jacobi(static(0), static(0))
7374
@testset "Jacobi" begin
74-
CLL = @inferred Conversion(Legendre(), Legendre())
75+
CLL = @inferred Conversion(L, L)
7576
@test convert(Number, CLL) == 1
76-
CNLNL = @inferred Conversion(NormalizedLegendre(), NormalizedLegendre())
77+
NL = NormalizedPolynomialSpace(L)
78+
CNLNL = @inferred Conversion(NL, NL)
7779
@test convert(Number, CNLNL) == 1
78-
CLNL = @inferred Conversion(Legendre(), NormalizedLegendre())
80+
CLNL = @inferred Conversion(L, NL)
7981
@test CLNL * Fun(Legendre()) Fun(NormalizedLegendre())
80-
CNLL = @inferred Conversion(NormalizedLegendre(), Legendre())
82+
CNLL = @inferred Conversion(NL, L)
8183
@test CNLL * Fun(NormalizedLegendre()) Fun(Legendre())
8284
end
8385

8486
@testset "Chebyshev" begin
85-
CCL = @inferred Conversion(Chebyshev(), Legendre())
87+
CCL = @inferred Conversion(Chebyshev(), L)
8688
@test CCL * Fun(Chebyshev()) Fun(Legendre())
87-
CLC = @inferred Conversion(Legendre(), Chebyshev())
89+
CLC = @inferred Conversion(L, Chebyshev())
8890
@test CLC * Fun(Legendre()) Fun(Chebyshev())
8991

9092
@inferred Conversion(Chebyshev(), Jacobi(static(-0.5), static(-0.5)))
@@ -106,9 +108,9 @@ using Static
106108
end
107109

108110
@testset "Ultraspherical" begin
109-
CUL = @inferred Conversion(Ultraspherical(static(0.5)), Legendre())
111+
CUL = @inferred Conversion(Ultraspherical(static(0.5)), L)
110112
@test CUL * Fun(Ultraspherical(0.5)) Fun(Legendre())
111-
CLU = @inferred Conversion(Legendre(), Ultraspherical(static(0.5)))
113+
CLU = @inferred Conversion(L, Ultraspherical(static(0.5)))
112114
@test CLU * Fun(Legendre()) Fun(Ultraspherical(0.5))
113115

114116
@inferred Conversion(Ultraspherical(static(0.5)), Jacobi(static(1),static(1)))
@@ -242,7 +244,8 @@ using Static
242244
@test (g*f)(.1) cos(.1)*exp(.1)
243245

244246
@testset "Mutliplication in a normalized space" begin
245-
M = @inferred Multiplication(Fun(Legendre()), NormalizedLegendre())
247+
L = Jacobi(static(0), static(0))
248+
M = @inferred Multiplication(Fun(L), NormalizedPolynomialSpace(L))
246249
@test M * Fun(NormalizedLegendre()) Fun(x->x^2, NormalizedLegendre())
247250
end
248251
end

0 commit comments

Comments
 (0)