Skip to content

Commit c79641a

Browse files
committed
Update show
1 parent 3943928 commit c79641a

File tree

6 files changed

+15
-29
lines changed

6 files changed

+15
-29
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ArrayLayouts = "1.0.1"
2929
BandedMatrices = "0.17.17"
3030
BlockArrays = "0.16.9"
3131
BlockBandedMatrices = "0.12"
32-
ContinuumArrays = "0.12.4"
32+
ContinuumArrays = "0.13"
3333
DomainSets = "0.5.6, 0.6"
3434
FFTW = "1.1"
3535
FastGaussQuadrature = "0.4.3, 0.5"
@@ -41,7 +41,7 @@ InfiniteLinearAlgebra = "0.6.16"
4141
IntervalSets = "0.5, 0.6, 0.7"
4242
LazyArrays = "1.0.1"
4343
LazyBandedMatrices = "0.8.5"
44-
QuasiArrays = "0.9.6"
44+
QuasiArrays = "0.10"
4545
SpecialFunctions = "1.0, 2"
4646
julia = "1.7"
4747

src/ClassicalOrthogonalPolynomials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ gives the singularity structure of an expansion, e.g.,
161161
`JacobiWeight`.
162162
"""
163163
singularities(::WeightLayout, w) = w
164-
singularities(lay::BroadcastLayout, a) = singularitiesbroadcast(call(a), map(singularities, arguments(lay, a))...)
164+
singularities(lay::BroadcastLayout, a::AbstractQuasiVector) = singularitiesbroadcast(call(a), map(singularities, arguments(lay, a))...)
165165
singularities(::WeightedBasisLayouts, a) = singularities(BroadcastLayout{typeof(*)}(), a)
166166
singularities(::WeightedOPLayout, a) = singularities(weight(a))
167167
singularities(w) = singularities(MemoryLayout(w), w)

src/classical/jacobi.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ axes(::AbstractJacobi{T}) where T = (Inclusion{T}(ChebyshevInterval{real(T)}()),
156156
==(A::Legendre, B::Weighted{<:Any,<:AbstractJacobi}) = A == B.P
157157
==(A::Weighted{<:Any,<:AbstractJacobi}, B::Legendre) = A.P == B
158158

159-
159+
show(io::IO, w::AbstractJacobiWeight) = summary(io, w)
160+
show(io::IO, P::AbstractJacobi) = summary(io, P)
160161
summary(io::IO, P::Jacobi) = print(io, "Jacobi($(P.a), $(P.b))")
161162

162163
###

src/classical/legendre.jl

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ singularitiesbroadcast(::typeof(^), L::LegendreWeight, ::NoSingularities) = L
3535
singularitiesbroadcast(::typeof(/), ::NoSingularities, L::LegendreWeight) = L # can't find roots
3636

3737
singularities(::AbstractJacobi{T}) where T = LegendreWeight{T}()
38-
singularities(::Inclusion{T,<:AbstractInterval}) where T = LegendreWeight{T}()
39-
singularities(d::Inclusion{T,<:Interval}) where T = LegendreWeight{T}()[affine(d,ChebyshevInterval{T}())]
38+
singularities(::Inclusion{T,<:ChebyshevInterval}) where T = LegendreWeight{T}()
39+
singularities(d::Inclusion{T,<:AbstractInterval}) where T = LegendreWeight{T}()[affine(d,ChebyshevInterval{T}())]
4040
singularities(::AbstractFillLayout, P) = LegendreWeight{eltype(P)}()
4141

4242
_basis(::LegendreWeight{T}) where T = Legendre{T}()
@@ -166,22 +166,3 @@ function _sum(P::Legendre{T}, dims) where T
166166
end
167167

168168
_sum(p::SubQuasiArray{T,1,Legendre{T},<:Tuple{Inclusion,Int}}, ::Colon) where T = parentindices(p)[2] == 1 ? convert(T, 2) : zero(T)
169-
170-
171-
###
172-
# dot
173-
###
174-
175-
_dot(::Inclusion{<:Any,<:AbstractInterval}, a, b) = __dot(MemoryLayout(a), MemoryLayout(b), a, b)
176-
function __dot(::ExpansionLayout, ::ExpansionLayout, a, b)
177-
P,c = basis(a),coefficients(a)
178-
Q,d = basis(b),coefficients(b)
179-
c' * (P'Q) * d
180-
end
181-
__dot(_, _, a, b) = dot(expand(a), expand(b))
182-
__dot(::ZerosLayout, _, a, b) = __dot(ZerosLayout(), ZerosLayout(), a, b)
183-
__dot(_, ::ZerosLayout, a, b) = __dot(ZerosLayout(), ZerosLayout(), a, b)
184-
function __dot(::ZerosLayout, ::ZerosLayout, a, b)
185-
axes(a) == axes(b) || throw(DimensionMismatch("axes must match"))
186-
zero(promote_type(eltype(a), eltype(b)))
187-
end

src/normalized.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ function mul(A::Derivative, B::Weighted{<:Any,<:SubQuasiArray{<:Any,2,<:Abstract
298298
end
299299
mul(Ac::QuasiAdjoint{<:Any, Weighted{<:Any,<:SubQuasiArray{<:Any,2,<:AbstractQuasiMatrix,<:Tuple{<:AbstractAffineQuasiVector,<:Any}}}}, Bc::QuasiAdjoint{<:Any,<:Derivative}) = mul(Bc', Ac')'
300300

301-
summary(io::IO, Q::Weighted) = print(io, "Weighted($(Q.P))")
301+
show(io::IO, Q::Weighted) = print(io, "Weighted($(Q.P))")
302302

303303
__sum(::AbstractNormalizedOPLayout, A, dims) = __sum(ApplyLayout{typeof(*)}(), A, dims)
304304
function __sum(::WeightedOPLayout, A, dims)

test/runtests.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,16 @@ end
6060

6161
@testset "basis" begin
6262
for x in (Inclusion(ChebyshevInterval()), Inclusion(1 .. 2))
63-
@test sum(x) == last(x)-first(x)
64-
# sum(x .^ 2)
65-
# sum(exp.(x))
63+
a,b = first(x),last(x)
64+
@test sum(x) == b-a
65+
@test sum(x .^ 2) (b^3 - a^3)/3
66+
@test sum(exp.(x)) exp(b) - exp(a)
6667
@test dot(x, x) sum(expand(x .^2))
6768
@test dot(x.^2, x.^2) sum(expand(x .^4))
6869
@test dot(exp.(x), x.^2) sum(expand(x .^2 .* exp.(x)))
6970
@test dot(x, exp.(x)) dot(exp.(x), x)
7071
end
72+
73+
# A = x .^ (0:2)'
74+
# sum(A; dims=1)
7175
end

0 commit comments

Comments
 (0)