Skip to content
Merged
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.6"
version = "0.15.7"


[deps]
Expand Down
13 changes: 9 additions & 4 deletions src/classical/chebyshev.jl
Original file line number Diff line number Diff line change
Expand Up @@ -296,28 +296,33 @@ end
# sum
####

function _sum(::Weighted{T,<:ChebyshevU}, dims) where T
function _sum(::Weighted{T,<:ChebyshevU}, dims::Int) where T
@assert dims == 1
Hcat(convert(T, π)/2, Zeros{T}(1,∞))
end

# Same normalization for T,V,W
function _sum(::Weighted{T,<:Chebyshev}, dims) where T
function _sum(::Weighted{T,<:ChebyshevT}, dims::Int) where T
@assert dims == 1
Hcat(convert(T, π), Zeros{T}(1,∞))
end

function _cumsum(T::ChebyshevT{V}, dims) where V
function _cumsum(T::ChebyshevT{V}, dims::Int) where V
@assert dims == 1
Σ = _BandedMatrix(Vcat(-one(V) ./ (-2:2:∞)', Zeros{V}(1,∞), Hcat(one(V), one(V) ./ (4:2:∞)')), ℵ₀, 0, 2)
ApplyQuasiArray(*, T, Vcat((-1).^(0:∞)'* Σ, Σ))
end

function _cumsum(W::Weighted{V, ChebyshevT{V}}, dims) where V
function _cumsum(W::Weighted{V, ChebyshevT{V}}, dims::Int) where V
@assert dims == 1
[cumsum(ChebyshevTWeight{V}()) Weighted(ChebyshevU{V}())] * Diagonal(Vcat(one(V), -inv.(one(V):∞)))
end

function _sum(::ChebyshevT{T}, dims::Int) where T
@assert dims == 1
permutedims(vec(Hcat(Vcat(2one(T), -(2one(T)) ./ ((3:2:∞) .* (1:2:∞))), Zeros{T}(∞))'))
end

####
# algebra
####
Expand Down
2 changes: 1 addition & 1 deletion src/classical/jacobi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,6 @@ end
# sum
###

_sum(P::AbstractJacobi{T}, dims) where T = 2 * (Legendre{T}() \ P)[1:1,:]
_sum(P::AbstractJacobi{T}, dims::Int) where T = 2 * (Legendre{T}() \ P)[1:1,:]


2 changes: 1 addition & 1 deletion src/classical/legendre.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ end
# sum
###

function _sum(P::Legendre{T}, dims) where T
function _sum(P::Legendre{T}, dims::Int) where T
@assert dims == 1
Hcat(convert(T, 2), Zeros{T}(1,∞))
end
Expand Down
2 changes: 1 addition & 1 deletion src/interlace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ end
# sum
###

_sum(P::PiecewiseInterlace, dims) = BlockBroadcastArray(hcat, unitblocks.(_sum.(P.args, dims))...)
_sum(P::PiecewiseInterlace, dims::Int) = BlockBroadcastArray(hcat, unitblocks.(_sum.(P.args, dims))...)

# blockvector2vectortuple

Expand Down
1 change: 1 addition & 0 deletions test/test_interlace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ClassicalOrthogonalPolynomials: PiecewiseInterlace, SetindexInterlace, pl
@test u[-0.1] ≈ exp(-0.1)
@test u[0.1] ≈ exp(0.1)
@test u[0.] ≈ 2
@test sum(u) ≈ ℯ - ℯ^(-1)
end

@testset "two-interval ODE" begin
Expand Down
Loading