Skip to content

Commit 71f1349

Browse files
committed
Import polynomialtype
1 parent e6d4d9d commit 71f1349

File tree

9 files changed

+13
-12
lines changed

9 files changed

+13
-12
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ClassicalOrthogonalPolynomials"
22
uuid = "b30e2e7b-c4ee-47da-9d5f-2c5c27239acd"
33
authors = ["Sheehan Olver <[email protected]>"]
4-
version = "0.14"
4+
version = "0.14.0"
55

66
[deps]
77
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
@@ -10,6 +10,7 @@ BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
1010
BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0"
1111
ContinuumArrays = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
1212
DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
13+
DynamicPolynomials = "7c1d4256-1411-5781-91ec-d7bc3513ac07"
1314
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
1415
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
1516
FastTransforms = "057dd010-8810-581a-b7be-e3fc3b93f78c"

src/ClassicalOrthogonalPolynomials.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import ContinuumArrays: Basis, Weight, basis_axes, @simplify, Identity, Abstract
4141
plan_grid_transform, plan_transform, MAX_PLOT_POINTS, MulPlan, grammatrix, AdjointBasisLayout, grammatrix_layout, plan_transform_layout, _cumsum
4242
import FastTransforms: Λ, ChebyshevGrid, chebyshevpoints, Plan, ScaledPlan, th_cheb2leg, pochhammer
4343
import RecurrenceRelationships: forwardrecurrence, forwardrecurrence!, clenshaw, clenshaw!,
44-
check_clenshaw_recurrences
44+
check_clenshaw_recurrences, polynomialtype
4545
import RecurrenceRelationshipArrays: initiateforwardrecurrence, Clenshaw
4646
import FastGaussQuadrature: jacobimoment
4747

@@ -254,7 +254,6 @@ function layout_broadcasted(::Tuple{PolynomialLayout,AbstractOPLayout}, ::typeof
254254
end
255255

256256

257-
258257
# function broadcasted(::LazyQuasiArrayStyle{2}, ::typeof(*), a::BroadcastQuasiVector, C::OrthogonalPolynomial)
259258
# axes(a,1) == axes(C,1) || throw(DimensionMismatch())
260259
# # re-expand in OP basis

src/classical/chebyshev.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ chebyshevu(S::AbstractQuasiMatrix) = chebyshevu(axes(S,1))
6161
6262
computes the `n`-th Chebyshev polynomial of the first kind at `z`.
6363
"""
64-
chebyshevt(n::Integer, z) = Base.unsafe_getindex(ChebyshevT{typeof(z)}(), z, n+1)
64+
chebyshevt(n::Integer, z) = Base.unsafe_getindex(ChebyshevT{polynomialtype(typeof(z))}(), z, n+1)
6565
"""
6666
chebyshevt(n, z)
6767
6868
computes the `n`-th Chebyshev polynomial of the second kind at `z`.
6969
"""
70-
chebyshevu(n::Integer, z) = Base.unsafe_getindex(ChebyshevU{typeof(z)}(), z, n+1)
70+
chebyshevu(n::Integer, z) = Base.unsafe_getindex(ChebyshevU{polynomialtype(typeof(z))}(), z, n+1)
7171

7272
chebysevtweight(d::AbstractInterval{T}) where T = ChebyshevTWeight{float(T)}[affine(d,ChebyshevInterval{T}())]
7373
chebysevuweight(d::AbstractInterval{T}) where T = ChebyshevUWeight{float(T)}[affine(d,ChebyshevInterval{T}())]

src/classical/hermite.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ axes(::Hermite{T}) where T = (Inclusion{T}(ℝ), oneto(∞))
4646
computes the `n`-th Hermite polynomial, orthogonal with
4747
respec to `exp(-x^2)`, at `z`.
4848
"""
49-
hermiteh(n::Integer, z) = Base.unsafe_getindex(Hermite{typeof(z)}(), z, n+1)
49+
hermiteh(n::Integer, z) = Base.unsafe_getindex(Hermite{polynomialtype(typeof(z))}(), z, n+1)
5050

5151
broadcasted(::LazyQuasiArrayStyle{2}, ::typeof(*), ::HermiteWeight{T}, ::Hermite{V}) where {T,V} = Weighted(Hermite{promote_type(T,V)}())
5252

src/classical/jacobi.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ basis_singularities(w::JacobiWeight) = Weighted(Jacobi(w.a, w.b))
217217
computes the `n`-th Jacobi polynomial, orthogonal with
218218
respec to `(1-x)^a*(1+x)^b`, at `z`.
219219
"""
220-
jacobip(n::Integer, a, b, z) = Base.unsafe_getindex(Jacobi{promote_type(typeof(a), typeof(b), typeof(z))}(a,b), z, n+1)
221-
normalizedjacobip(n::Integer, a, b, z) = Base.unsafe_getindex(Normalized(Jacobi{promote_type(typeof(a), typeof(b), typeof(z))}(a,b)), z, n+1)
220+
jacobip(n::Integer, a, b, z) = Base.unsafe_getindex(Jacobi{polynomialtype(typeof(a), typeof(b), typeof(z))}(a,b), z, n+1)
221+
normalizedjacobip(n::Integer, a, b, z) = Base.unsafe_getindex(Normalized(Jacobi{polynomialtype(typeof(a), typeof(b), typeof(z))}(a,b)), z, n+1)
222222

223223
OrthogonalPolynomial(w::JacobiWeight) = Jacobi(w.a, w.b)
224224
orthogonalityweight(P::Jacobi) = JacobiWeight(P.a, P.b)

src/classical/laguerre.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ axes(::Laguerre{T}) where T = (Inclusion(HalfLine{T}()), oneto(∞))
4545
computes the `n`-th generalized Laguerre polynomial, orthogonal with
4646
respec to `x^α * exp(-x)`, at `z`.
4747
"""
48-
laguerrel(n::Integer, α, z::Number) = Base.unsafe_getindex(Laguerre{promote_type(typeof(α), typeof(z))}(α), z, n+1)
48+
laguerrel(n::Integer, α, z::Number) = Base.unsafe_getindex(Laguerre{polynomialtype(typeof(α), typeof(z))}(α), z, n+1)
4949

5050
"""
5151
laguerrel(n, z)

src/classical/ultraspherical.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const WeightedUltraspherical{T} = WeightedBasis{T,<:UltrasphericalWeight,<:Ultra
5454

5555
orthogonalityweight(C::Ultraspherical) = UltrasphericalWeight(C.λ)
5656

57-
ultrasphericalc(n::Integer, λ, z) = Base.unsafe_getindex(Ultraspherical{promote_type(typeof(λ),typeof(z))}(λ), z, n+1)
57+
ultrasphericalc(n::Integer, λ, z) = Base.unsafe_getindex(Ultraspherical{polynomialtype(typeof(λ),typeof(z))}(λ), z, n+1)
5858
ultraspherical(λ, d::AbstractInterval{T}) where T = Ultraspherical{float(promote_type(eltype(λ),T))}(λ)[affine(d,ChebyshevInterval{T}()), :]
5959

6060
==(a::Ultraspherical, b::Ultraspherical) = a.λ == b.λ

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ end
8484

8585
@testset "Issue #179" begin
8686
@test startswith(sprint(show, MIME"text/plain"(), Chebyshev()[0.3, :]; context=(:compact=>true, :limit=>true)), "ℵ₀-element view(::ChebyshevT{Float64}, 0.3, :)")
87-
@test startswith(sprint(show, MIME"text/plain"(), Jacobi(0.2, 0.5)[-0.7, :]; context=(:compact=>true, :limit=>true)), "ℵ₀-element view(::Jacobi{Float64}, -0.7, :)")
87+
@test startswith(sprint(show, MIME"text/plain"(), Jacobi(0.2, 0.5)[-0.7, :]; context=(:compact=>true, :limit=>true)), "ℵ₀-element view(::Jacobi{Float64, Float64}, -0.7, :)")
8888
end
8989

9090
include("test_dynamicpolynomials.jl")

test/test_dynamicpolynomials.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ using DynamicPolynomials, ClassicalOrthogonalPolynomials, Test
99
@test chebyshevu(5,x) == ultrasphericalc(5,1,x) == 6x - 32x^3 + 32x^5
1010
@test legendrep(5,x) (15x - 70x^3 + 63x^5)/8
1111
@test hermiteh(5,x) == 120x - 160x^3 + 32x^5
12-
jacobip(5,1,0,x)
12+
@test jacobip(5,1,0,x) (5 + 35x - 70x^2 - 210x^3 + 105x^4 + 231x^5)/16
13+
@test jacobip(5,0.1,-0.2,x) 3*(3306827 + 75392855x - 37466770x^2 - 350553810x^3 + 47705335x^4 + 314855211x^5)/128000000
1314
end

0 commit comments

Comments
 (0)