Skip to content

Commit

Permalink
add constructor AbstractJacobi{T}
Browse files Browse the repository at this point in the history
  • Loading branch information
putianyi889 committed Nov 22, 2023
1 parent c3e52bb commit 2e5bfdd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ CircularArrays = "7a955b69-7140-5f4e-a0ed-f168c5e2e749"
ContinuumArrays = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
QuasiArrays = "c4ea9172-b204-11e9-377d-29865faadc5c"
ClassicalOrthogonalPolynomials = "b30e2e7b-c4ee-47da-9d5f-2c5c27239acd"

[extensions]
PTYQoLLinearAlgebraExt = "LinearAlgebra"
PTYQoLCircularArraysExt = "CircularArrays"
PTYQoLContinuumArraysExt = "ContinuumArrays"
PTYQoLIntervalSetsExt = "IntervalSets"
PTYQoLQuasiArraysExt = "QuasiArrays"
PTYQoLClassicalOrthogonalPolynomialsExt = "ClassicalOrthogonalPolynomials"

[compat]
julia = "1"
Expand All @@ -26,6 +28,7 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
ClassicalOrthogonalPolynomials = "b30e2e7b-c4ee-47da-9d5f-2c5c27239acd"

[targets]
test = ["Test", "LinearAlgebra", "Documenter", "DomainSets", "ContinuumArrays"]
test = ["Test", "LinearAlgebra", "Documenter", "DomainSets", "ContinuumArrays", "ClassicalOrthogonalPolynomials"]
12 changes: 12 additions & 0 deletions ext/PTYQoLClassicalOrthogonalPolynomialsExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module PTYQoLClassicalOrthogonalPolynomialsExt

import ClassicalOrthogonalPolynomials: AbstractJacobi, Jacobi, Chebyshev, Legendre, Ultraspherical

AbstractJacobi{T}(a::Jacobi) where T = Jacobi{T}(a)
AbstractJacobi{T}(a::Chebyshev{kind}) where T where kind = Chebyshev{kind,T}(a)
AbstractJacobi{T}(a::Legendre) where T = Legendre{T}(a)
AbstractJacobi{T}(a::Ultraspherical) where T = Ultraspherical{T}(a)

Jacobi{T}(a::Jacobi) where T = Jacobi(T(a.a), T(a.b))

end
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ end
@test union(Inclusion(0..1).^2) == Inclusion(0..1) == union(Inclusion(-1..1).^1.0) == union(Inclusion(1..Inf).^(-0.5))
@test isempty(union(Inclusion(-1..0).^1.5))
end
@testset "ClassicalOrthogonalPolynomials" begin
using ClassicalOrthogonalPolynomials
using ClassicalOrthogonalPolynomials: AbstractJacobi
@test AbstractJacobi{Float32}(Jacobi(1,1)) isa Jacobi{Float32}
end
end

DocMeta.setdocmeta!(PTYQoL, :DocTestSetup, :(using PTYQoL); recursive=true)
Expand Down

0 comments on commit 2e5bfdd

Please sign in to comment.