@@ -19,14 +19,14 @@ normalization(::Type{T}, sp::Ultraspherical, k::Int) where T = (λ = order(sp);
19
19
# these are special cases
20
20
21
21
22
- Base. stride (M:: ConcreteMultiplication{U,V} ) where {U <: Chebyshev ,V <: Ultraspherical } =
22
+ Base. stride (M:: ConcreteMultiplication{<:Chebyshev,<:Ultraspherical} ) =
23
23
stride (M. f)
24
- Base. stride (M:: ConcreteMultiplication{U,V} ) where {U <: Ultraspherical ,V <: Chebyshev } =
24
+ Base. stride (M:: ConcreteMultiplication{<:Ultraspherical,<:Chebyshev} ) =
25
25
stride (M. f)
26
- Base. stride (M:: ConcreteMultiplication{U,V} ) where {U <: Ultraspherical ,V <: Ultraspherical } =
26
+ Base. stride (M:: ConcreteMultiplication{<:Ultraspherical,<:Ultraspherical} ) =
27
27
stride (M. f)
28
28
29
- @inline function _Multiplication (f:: Fun{<:Chebyshev} , sp:: Ultraspherical{Int } )
29
+ @inline function _Multiplication (f:: Fun{<:Chebyshev} , sp:: Ultraspherical{<:Union{Integer,StaticInt} } )
30
30
if order (sp) == 1
31
31
cfs = f. coefficients
32
32
MultiplicationWrapper (f,
@@ -40,10 +40,10 @@ Base.stride(M::ConcreteMultiplication{U,V}) where {U<:Ultraspherical,V<:Ultrasph
40
40
end
41
41
end
42
42
@static if VERSION >= v " 1.8"
43
- Base. @constprop aggressive Multiplication (f:: Fun{<:Chebyshev} , sp:: Ultraspherical{Int } ) =
43
+ Base. @constprop aggressive Multiplication (f:: Fun{<:Chebyshev} , sp:: Ultraspherical{<:Union{Integer,StaticInt} } ) =
44
44
_Multiplication (f, sp)
45
45
else
46
- Multiplication (f:: Fun{<:Chebyshev} , sp:: Ultraspherical{Int } ) = _Multiplication (f, sp)
46
+ Multiplication (f:: Fun{<:Chebyshev} , sp:: Ultraspherical{<:Union{Integer,StaticInt} } ) = _Multiplication (f, sp)
47
47
end
48
48
49
49
@@ -70,18 +70,18 @@ function Integral(sp::Ultraspherical{<:Any,<:IntervalOrSegment}, m::Number)
70
70
end
71
71
72
72
73
- rangespace (D:: ConcreteDerivative{Ultraspherical{LT,DD,RR }} ) where {LT,DD<: IntervalOrSegment ,RR } =
73
+ rangespace (D:: ConcreteDerivative{<: Ultraspherical{LT,DD}} ) where {LT,DD<: IntervalOrSegment } =
74
74
Ultraspherical (order (domainspace (D))+ D. order,domain (D))
75
75
76
- bandwidths (D:: ConcreteDerivative{Ultraspherical{LT,DD,RR }} ) where {LT,DD<: IntervalOrSegment ,RR } = - D. order,D. order
77
- bandwidths (D:: ConcreteIntegral{Ultraspherical{LT,DD,RR }} ) where {LT,DD<: IntervalOrSegment ,RR } = D. order,- D. order
78
- Base. stride (D:: ConcreteDerivative{Ultraspherical{LT,DD,RR }} ) where {LT,DD<: IntervalOrSegment ,RR } = D. order
76
+ bandwidths (D:: ConcreteDerivative{<: Ultraspherical{LT,DD}} ) where {LT,DD<: IntervalOrSegment } = - D. order,D. order
77
+ bandwidths (D:: ConcreteIntegral{<: Ultraspherical{LT,DD}} ) where {LT,DD<: IntervalOrSegment } = D. order,- D. order
78
+ Base. stride (D:: ConcreteDerivative{<: Ultraspherical{LT,DD}} ) where {LT,DD<: IntervalOrSegment } = D. order
79
79
80
80
isdiag (D:: ConcreteDerivative{<:Ultraspherical{<:Any,<:IntervalOrSegment}} ) = false
81
81
isdiag (D:: ConcreteIntegral{<:Ultraspherical{<:Any,<:IntervalOrSegment}} ) = false
82
82
83
- function getindex (D:: ConcreteDerivative{Ultraspherical{TT,DD,RR },K,T} ,
84
- k:: Integer ,j:: Integer ) where {TT,DD<: IntervalOrSegment ,RR, K,T}
83
+ function getindex (D:: ConcreteDerivative{<: Ultraspherical{TT,DD},K,T} ,
84
+ k:: Integer ,j:: Integer ) where {TT,DD<: IntervalOrSegment ,K,T}
85
85
m= D. order
86
86
d= domain (D)
87
87
λ= order (domainspace (D))
96
96
97
97
# # Integral
98
98
99
- linesum (f:: Fun{Ultraspherical{LT,DD,RR }} ) where {LT,DD<: IntervalOrSegment ,RR } =
99
+ linesum (f:: Fun{<: Ultraspherical{LT,DD}} ) where {LT,DD<: IntervalOrSegment } =
100
100
sum (setcanonicaldomain (f))* arclength (d)/ 2
101
101
102
102
103
- rangespace (D:: ConcreteIntegral{Ultraspherical{LT,DD,RR }} ) where {LT,DD<: IntervalOrSegment ,RR } =
103
+ rangespace (D:: ConcreteIntegral{<: Ultraspherical{LT,DD}} ) where {LT,DD<: IntervalOrSegment } =
104
104
order (domainspace (D)) == 1 ? Chebyshev (domain (D)) : Ultraspherical (order (domainspace (D))- D. order,domain (D))
105
105
106
- function getindex (Q:: ConcreteIntegral{Ultraspherical{LT,DD,RR }} ,k:: Integer ,j:: Integer ) where {LT,DD<: IntervalOrSegment ,RR }
106
+ function getindex (Q:: ConcreteIntegral{<: Ultraspherical{LT,DD}} ,k:: Integer ,j:: Integer ) where {LT,DD<: IntervalOrSegment }
107
107
T= eltype (Q)
108
108
m= Q. order
109
109
d= domain (Q)
@@ -160,7 +160,7 @@ function Conversion(A::Ultraspherical,B::Ultraspherical)
160
160
ConcreteConversion (A,B)
161
161
elseif b- a > 1
162
162
d= domain (A)
163
- US= Ultraspherical (b- 1 ,d)
163
+ US= Ultraspherical (b- static ( 1 ) ,d)
164
164
ConversionWrapper (TimesOperator (
165
165
ConcreteConversion (US,B), Conversion (A,US)))
166
166
else
171
171
maxspace_rule (A:: Ultraspherical ,B:: Ultraspherical ) = order (A) > order (B) ? A : B
172
172
173
173
174
- function getindex (M:: ConcreteConversion{C,Ultraspherical{Int,DD,RR} ,T} ,
175
- k:: Integer ,j:: Integer ) where {DD,RR,C <: Chebyshev ,T }
174
+ function getindex (M:: ConcreteConversion{<:Chebyshev,U ,T} ,
175
+ k:: Integer ,j:: Integer ) where {T, U <: Ultraspherical{<:Union{Integer, StaticInt}} }
176
176
# order must be 1
177
177
if k== j== 1
178
178
one (T)
@@ -186,8 +186,10 @@ function getindex(M::ConcreteConversion{C,Ultraspherical{Int,DD,RR},T},
186
186
end
187
187
188
188
189
- function getindex (M:: ConcreteConversion{Ultraspherical{Int,DD,RR},Ultraspherical{Int,DD,RR},T} ,
190
- k:: Integer ,j:: Integer ) where {DD,RR,T}
189
+ function getindex (M:: ConcreteConversion{U1,U2,T} ,
190
+ k:: Integer ,j:: Integer ) where {DD,RR,
191
+ U1<: Ultraspherical{<:Union{Integer, StaticInt},DD,RR} ,
192
+ U2<: Ultraspherical{<:Union{Integer, StaticInt},DD,RR} ,T}
191
193
# we can assume that λ==m+1
192
194
λ= order (rangespace (M))
193
195
c= λ- one (T) # this supports big types
@@ -200,8 +202,10 @@ function getindex(M::ConcreteConversion{Ultraspherical{Int,DD,RR},Ultraspherical
200
202
end
201
203
end
202
204
203
- function getindex (M:: ConcreteConversion{Ultraspherical{LT,DD,RR},Ultraspherical{LT,DD,RR},T} ,
204
- k:: Integer ,j:: Integer ) where {LT,DD,RR,T}
205
+ function getindex (M:: ConcreteConversion{U1,U2,T} ,
206
+ k:: Integer ,j:: Integer ) where {DD,RR,
207
+ U1<: Ultraspherical{<:Any,DD,RR} ,
208
+ U2<: Ultraspherical{<:Any,DD,RR} ,T}
205
209
λ= order (rangespace (M))
206
210
if order (domainspace (M))+ 1 == λ
207
211
c= λ- one (T) # this supports big types
@@ -218,8 +222,8 @@ function getindex(M::ConcreteConversion{Ultraspherical{LT,DD,RR},Ultraspherical{
218
222
end
219
223
220
224
221
- bandwidths (C:: ConcreteConversion{<:Chebyshev,<:Ultraspherical{Int }} ) = 0 ,2 # order == 1
222
- bandwidths (C:: ConcreteConversion{<:Ultraspherical{Int} ,<:Ultraspherical{Int }} ) = 0 ,2
225
+ bandwidths (C:: ConcreteConversion{<:Chebyshev,<:Ultraspherical{<:Union{Integer,StaticInt} }} ) = 0 ,2 # order == 1
226
+ bandwidths (C:: ConcreteConversion{<:Ultraspherical{<:Union{Integer,StaticInt}} ,<:Ultraspherical{<:Union{Integer,StaticInt} }} ) = 0 ,2
223
227
224
228
bandwidths (C:: ConcreteConversion{<:Chebyshev,<:Ultraspherical} ) =
225
229
0 ,order (rangespace (C))== 1 ? 2 : ℵ₀
@@ -229,7 +233,7 @@ bandwidths(C::ConcreteConversion{<:Ultraspherical,<:Chebyshev}) =
229
233
bandwidths (C:: ConcreteConversion{<:Ultraspherical,<:Ultraspherical} ) =
230
234
0 ,order (domainspace (C))+ 1 == order (rangespace (C)) ? 2 : ℵ₀
231
235
232
- Base. stride (C:: ConcreteConversion{<:Chebyshev,<:Ultraspherical{Int }} ) = 2
236
+ Base. stride (C:: ConcreteConversion{<:Chebyshev,<:Ultraspherical{<:Union{Integer,StaticInt} }} ) = 2
233
237
Base. stride (C:: ConcreteConversion{<:Ultraspherical,<:Ultraspherical} ) = 2
234
238
235
239
isdiag (:: ConcreteConversion{<:Chebyshev,<:Ultraspherical} ) = false
@@ -239,15 +243,20 @@ isdiag(::ConcreteConversion{<:Ultraspherical,<:Ultraspherical}) = false
239
243
# # coefficients
240
244
241
245
# return the space that has banded Conversion to the other
242
- function conversion_rule (a:: Chebyshev ,b:: Ultraspherical{Int } )
246
+ function conversion_rule (a:: Chebyshev ,b:: Ultraspherical{<:Union{Integer,StaticInt} } )
243
247
if domainscompatible (a,b)
244
248
a
245
249
else
246
250
NoSpace ()
247
251
end
248
252
end
249
253
254
+ conversion_rule (a:: Ultraspherical{<:StaticInt} , b:: Ultraspherical{<:StaticInt} ) =
255
+ _conversion_rule (a, b)
250
256
function conversion_rule (a:: Ultraspherical{LT} ,b:: Ultraspherical{LT} ) where {LT}
257
+ _conversion_rule (a, b)
258
+ end
259
+ function _conversion_rule (a:: Ultraspherical , b:: Ultraspherical )
251
260
if domainscompatible (a,b) && isapproxinteger (order (a)- order (b))
252
261
order (a) < order (b) ? a : b
253
262
else
@@ -256,7 +265,7 @@ function conversion_rule(a::Ultraspherical{LT},b::Ultraspherical{LT}) where {LT}
256
265
end
257
266
258
267
259
- function coefficients (g:: AbstractVector ,sp:: Ultraspherical{Int } ,C:: Chebyshev )
268
+ function coefficients (g:: AbstractVector ,sp:: Ultraspherical{<:Union{Integer,StaticInt} } ,C:: Chebyshev )
260
269
domainscompatible (C,sp) || throw (ArgumentError (" domains don't match: $(domain (sp)) and $(domain (C)) " ))
261
270
if order (sp) == 1
262
271
ultraiconversion (g)
286
295
287
296
# # Non-banded conversions
288
297
289
- function getindex (M:: ConcreteConversion{C,Ultraspherical{LT,DD,RR},T} ,
290
- k:: Integer ,j:: Integer ) where {DD,RR,LT,C<: Chebyshev ,T}
298
+ function getindex (M:: ConcreteConversion{<:Chebyshev,<:Ultraspherical,T} , k:: Integer ,j:: Integer ) where {T}
291
299
λ = order (rangespace (M))
292
300
if λ == 1
293
301
if k== j== 1
@@ -317,8 +325,7 @@ function getindex(M::ConcreteConversion{C,Ultraspherical{LT,DD,RR},T},
317
325
end
318
326
319
327
320
- function getindex (M:: ConcreteConversion{Ultraspherical{LT,DD,RR},C,T} ,
321
- k:: Integer ,j:: Integer ) where {DD,RR,LT,C<: Chebyshev ,T}
328
+ function getindex (M:: ConcreteConversion{<:Ultraspherical,<:Chebyshev,T} , k:: Integer ,j:: Integer ) where {T}
322
329
λ = order (domainspace (M))
323
330
if λ == 1
324
331
# order must be 1
0 commit comments