Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add normalized OP functions #231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ClassicalOrthogonalPolynomials"
uuid = "b30e2e7b-c4ee-47da-9d5f-2c5c27239acd"
authors = ["Sheehan Olver <[email protected]>"]
version = "0.15"
version = "0.15.1"


[deps]
Expand Down
3 changes: 2 additions & 1 deletion src/ClassicalOrthogonalPolynomials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export OrthogonalPolynomial, Normalized, LanczosPolynomial,
WeightedUltraspherical, WeightedChebyshev, WeightedChebyshevT, WeightedChebyshevU, WeightedJacobi,
∞, Derivative, .., Inclusion,
chebyshevt, chebyshevu, legendre, jacobi, ultraspherical,
legendrep, jacobip, ultrasphericalc, laguerrel,hermiteh, normalizedjacobip,
legendrep, jacobip, ultrasphericalc, laguerrel,hermiteh,
normalizedlegendrep, normalizedjacobip, normalizedultrasphericalc, normalizedlaguerrel, normalizedhermiteh,
jacobimatrix, jacobiweight, legendreweight, chebyshevtweight, chebyshevuweight, Weighted, PiecewiseInterlace, plan_transform,
expand, transform

Expand Down
8 changes: 8 additions & 0 deletions src/classical/hermite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
"""
hermiteh(n::Integer, z) = Base.unsafe_getindex(Hermite{polynomialtype(typeof(z))}(), z, n+1)

"""
normalizedhermiteh(n, z)

computes the normalized `n`-th Hermite polynomial, orthogonal with
respec to `exp(-x^2)`, at `z`.
"""
normalizedhermiteh(n::Integer, z) = Base.unsafe_getindex(Normalized(Hermite{polynomialtype(typeof(z))}()), z, n+1)

Check warning on line 57 in src/classical/hermite.jl

View check run for this annotation

Codecov / codecov/patch

src/classical/hermite.jl#L57

Added line #L57 was not covered by tests

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

# H_{n+1} = 2x H_n - 2n H_{n-1}
Expand Down
16 changes: 16 additions & 0 deletions src/classical/laguerre.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@
"""
laguerrel(n::Integer, z::Number) = laguerrel(n, 0, z)

"""
normalizedlaguerrel(n, α, z)

computes the normalized `n`-th generalized Laguerre polynomial, orthogonal with
respec to `x^α * exp(-x)`, at `z`.
"""
normalizedlaguerrel(n::Integer, α, z::Number) = Base.unsafe_getindex(Normalized(Laguerre{polynomialtype(typeof(α), typeof(z))}(α)), z, n+1)

Check warning on line 64 in src/classical/laguerre.jl

View check run for this annotation

Codecov / codecov/patch

src/classical/laguerre.jl#L64

Added line #L64 was not covered by tests

"""
normalizedlaguerrel(n, z)

computes the normalized `n`-th Laguerre polynomial, orthogonal with
respec to `exp(-x)`, at `z`.
"""
normalizedlaguerrel(n::Integer, z::Number) = normalizedlaguerrel(n, 0, z)

Check warning on line 72 in src/classical/laguerre.jl

View check run for this annotation

Codecov / codecov/patch

src/classical/laguerre.jl#L72

Added line #L72 was not covered by tests


# L_{n+1} = (-1/(n+1) x + (2n+α+1)/(n+1)) L_n - (n+α)/(n+1) L_{n-1}
# - (n+α) L_{n-1} + (2n+α+1)* L_n -(n+1) L_{n+1} = x L_n
Expand Down
9 changes: 9 additions & 0 deletions src/classical/legendre.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@
"""
legendrep(n::Integer, z) = Base.unsafe_getindex(Legendre{typeof(z)}(), z, n+1)

"""
normalizedlegendrep(n, z)

computes the normalized `n`-th Legendre polynomial at `z`.
"""
normalizedlegendrep(n::Integer, z) = Base.unsafe_getindex(Normalized(Legendre{typeof(z)}()), z, n+1)

Check warning on line 175 in src/classical/legendre.jl

View check run for this annotation

Codecov / codecov/patch

src/classical/legendre.jl#L175

Added line #L175 was not covered by tests




show(io::IO, w::Legendre{Float64}) = summary(io, w)
summary(io::IO, ::Legendre{Float64}) = print(io, "Legendre()")
Expand Down
1 change: 1 addition & 0 deletions src/classical/ultraspherical.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

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

normalizedultrasphericalc(n::Integer, λ, z) = Base.unsafe_getindex(Normalized(Ultraspherical{polynomialtype(typeof(λ),typeof(z))}(λ)), z, n+1)

Check warning on line 57 in src/classical/ultraspherical.jl

View check run for this annotation

Codecov / codecov/patch

src/classical/ultraspherical.jl#L57

Added line #L57 was not covered by tests
ultrasphericalc(n::Integer, λ, z) = Base.unsafe_getindex(Ultraspherical{polynomialtype(typeof(λ),typeof(z))}(λ), z, n+1)
ultraspherical(λ, d::AbstractInterval{T}) where T = Ultraspherical{float(promote_type(eltype(λ),T))}(λ)[affine(d,ChebyshevInterval{T}()), :]

Expand Down
Loading