Skip to content

Commit 56986e2

Browse files
authored
Assume NoSingularities by default in expand (#208)
* Assume NoSingularities by default * Update ClassicalOrthogonalPolynomials.jl * Remove overloads * Update ci.yml
1 parent 1ed1f7e commit 56986e2

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
version:
23-
- '1.10'
23+
- 'lts'
24+
- '1'
2425
os:
2526
- ubuntu-latest
2627
- macOS-latest

Project.toml

Lines changed: 2 additions & 2 deletions
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.13.5"
4+
version = "0.13.6"
55

66
[deps]
77
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
@@ -33,7 +33,7 @@ ContinuumArrays = "0.18.3"
3333
DomainSets = "0.6, 0.7"
3434
FFTW = "1.1"
3535
FastGaussQuadrature = "1"
36-
FastTransforms = "0.15.15, 0.16"
36+
FastTransforms = "0.16.6"
3737
FillArrays = "1"
3838
HypergeometricFunctions = "0.3.4"
3939
InfiniteArrays = " 0.14"

src/ClassicalOrthogonalPolynomials.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,13 @@ singularitiesview(w, ::Inclusion) = w # for now just assume it doesn't change
211211
singularitiesview(w, ind) = view(w, ind)
212212
singularities(S::SubQuasiArray) = singularitiesview(singularities(parent(S)), parentindices(S)[1])
213213

214-
basis_axes(::Inclusion{<:Any,<:AbstractInterval}, v) = convert(AbstractQuasiMatrix{eltype(v)}, basis_singularities(singularities(v)))
215-
216214
struct NoSingularities end
217215

216+
basis_singularities(ax, ::NoSingularities) = basis(ax)
217+
basis_singularities(ax, sing) = basis_singularities(sing)
218+
basis_axes(ax::Inclusion{<:Any,<:AbstractInterval}, v) = convert(AbstractQuasiMatrix{eltype(v)}, basis_singularities(ax, singularities(v)))
219+
220+
218221
singularities(::Number) = NoSingularities()
219222
singularities(r::Base.RefValue) = r[] # pass through
220223

src/classical/jacobi.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,15 @@ hasboundedendpoints(w::AbstractJacobiWeight) = w.a ≥ 0 && w.b ≥ 0
5454
singularities(a::AbstractAffineQuasiVector) = singularities(a.x)
5555

5656

57+
## default is to just assume no singularities
58+
singularitiesbroadcast(_...) = NoSingularities()
59+
5760
for op in (:+, :*)
5861
@eval singularitiesbroadcast(::typeof($op), A, B, C, D...) = singularitiesbroadcast(*, singularitiesbroadcast(*, A, B), C, D...)
5962
end
6063

64+
singularitiesbroadcast(::typeof(*), V::Union{NoSingularities,SubQuasiArray}...) = singularitiesbroadcast(*, map(_parent,V)...)[_parentindices(V...)...]
65+
6166

6267
_parent(::NoSingularities) = NoSingularities()
6368
_parent(a) = parent(a)
@@ -66,7 +71,6 @@ _parentindices(a, b...) = parentindices(a)
6671
# for singularitiesbroadcast(literal_pow), ^, ...)
6772
singularitiesbroadcast(F::Function, G::Function, V::SubQuasiArray, K) = singularitiesbroadcast(F, G, parent(V), K)[parentindices(V)...]
6873
singularitiesbroadcast(F, V::Union{NoSingularities,SubQuasiArray}...) = singularitiesbroadcast(F, map(_parent,V)...)[_parentindices(V...)...]
69-
singularitiesbroadcast(::typeof(*), V::Union{NoSingularities,SubQuasiArray}...) = singularitiesbroadcast(*, map(_parent,V)...)[_parentindices(V...)...]
7074

7175

7276
abstract type AbstractJacobi{T} <: OrthogonalPolynomial{T} end

src/clenshaw.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11

2-
##
3-
# For Chebyshev T. Note the shift in indexing is fine due to the AbstractFill
4-
##
5-
Base.@propagate_inbounds _forwardrecurrence_next(n, A::Vcat{<:Any,1,<:Tuple{<:Number,<:AbstractFill}}, B::Zeros, C::Ones, x, p0, p1) =
6-
_forwardrecurrence_next(n, A.args[2], B, C, x, p0, p1)
7-
8-
Base.@propagate_inbounds _clenshaw_next(n, A::Vcat{<:Any,1,<:Tuple{<:Number,<:AbstractFill}}, B::Zeros, C::Ones, x, c, bn1, bn2) =
9-
_clenshaw_next(n, A.args[2], B, C, x, c, bn1, bn2)
10-
112
# Assume 1 normalization
123
_p0(A) = one(eltype(A))
134

test/test_ultraspherical.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,12 @@ using ClassicalOrthogonalPolynomials: grammatrix
183183
L = Weighted(Jacobi(1,0)) \ Weighted(Ultraspherical(3/2))
184184
@test L[1:10,1:10] == (Weighted(Jacobi(1,0)) \ Weighted(Jacobi(1,1)))[1:10,1:10] * (Jacobi(1,1) \ Ultraspherical(3/2))[1:10,1:10]
185185
end
186+
187+
@testset "expand w/ no singularities" begin
188+
z = 2
189+
P = Legendre()
190+
C = Ultraspherical(-1/2)
191+
x = axes(P,1)
192+
@test sum(@.(ultrasphericalc(1, -1/2, x)/(z-x))) sum(C[:,2] ./ (z .- x))
193+
end
186194
end

0 commit comments

Comments
 (0)