@@ -65,7 +65,9 @@ function Integral(sp::Ultraspherical{<:Any,<:IntervalOrSegment}, m::Number)
6565 ConcreteIntegral (sp,m)
6666 else # Convert up
6767 nsp = Ultraspherical (m,domain (sp))
68- IntegralWrapper (ConcreteIntegral (nsp,m)* Conversion (sp,nsp),m)
68+ Integralop = ConcreteIntegral (nsp,m)
69+ C = Conversion (sp,nsp)
70+ IntegralWrapper (Integralop * C, m, sp, rangespace (Integralop))
6971 end
7072end
7173
@@ -100,8 +102,10 @@ linesum(f::Fun{<:Ultraspherical{LT,DD}}) where {LT,DD<:IntervalOrSegment} =
100102 sum (setcanonicaldomain (f))* arclength (d)/ 2
101103
102104
103- rangespace (D:: ConcreteIntegral{<:Ultraspherical{LT,DD}} ) where {LT,DD<: IntervalOrSegment } =
104- order (domainspace (D)) == 1 ? Chebyshev (domain (D)) : Ultraspherical (order (domainspace (D))- D. order,domain (D))
105+ function rangespace (D:: ConcreteIntegral{<:Ultraspherical{LT,DD}} ) where {LT,DD<: IntervalOrSegment }
106+ k = order (domainspace (D))- D. order
107+ k == 0 ? Chebyshev (domain (D)) : Ultraspherical (k, domain (D))
108+ end
105109
106110function getindex (Q:: ConcreteIntegral{<:Ultraspherical{LT,DD}} ,k:: Integer ,j:: Integer ) where {LT,DD<: IntervalOrSegment }
107111 T= eltype (Q)
@@ -112,7 +116,12 @@ function getindex(Q::ConcreteIntegral{<:Ultraspherical{LT,DD}},k::Integer,j::Int
112116
113117 if λ == 1 && k== j+ 1
114118 C = complexlength (d)/ 2
115- strictconvert (T,C./ (k- 1 ))
119+ strictconvert (T, C/ (k- 1 ))
120+ elseif λ == m && k == j + m
121+ C = complexlength (d)/ 2
122+ U1toC = C/ (k- 1 )
123+ UmtoU1 = pochhammer (one (T)* λ,- (m- 1 ))* (complexlength (d)/ 4 )^ (m- 1 )
124+ strictconvert (T, U1toC * UmtoU1)
116125 elseif λ > 1 && k== j+ m
117126 strictconvert (T,pochhammer (one (T)* λ,- m)* (complexlength (d)/ 4 )^ m)
118127 else
300309
301310# TODO : include in getindex to speed up
302311function Integral (sp:: Chebyshev{DD} ,m:: Integer ) where {DD<: IntervalOrSegment }
303- IntegralWrapper (TimesOperator ([Integral (Ultraspherical (m,domain (sp)),m),
304- Conversion (sp,Ultraspherical (m,domain (sp)))]),m)
312+ usp = Ultraspherical (m,domain (sp))
313+ I = Integral (usp,m)
314+ C = Conversion (sp,usp)
315+ T = TimesOperator (I, C)
316+ IntegralWrapper (T, m, sp, sp)
305317end
306318
307319
0 commit comments