18
18
end
19
19
20
20
21
- rangespace (D:: ConcreteDerivative{J} ) where {J <: Jacobi }= Jacobi (D. space. b+ D. order,D. space. a+ D. order,domain (D))
22
- bandwidths (D:: ConcreteDerivative{J} ) where {J <: Jacobi }= - D. order,D. order
21
+ rangespace (D:: ConcreteDerivative{<:Jacobi} ) = Jacobi (D. space. b+ D. order,D. space. a+ D. order,domain (D))
22
+ bandwidths (D:: ConcreteDerivative{<:Jacobi} ) = - D. order,D. order
23
23
24
- getindex (T:: ConcreteDerivative{J} , k:: Integer ,j:: Integer ) where {J <: Jacobi } =
24
+ getindex (T:: ConcreteDerivative{<:Jacobi} , k:: Integer , j:: Integer ) =
25
25
j== k+ 1 ? eltype (T)((k+ 1 + T. space. a+ T. space. b)/ complexlength (domain (T))) : zero (eltype (T))
26
26
27
27
@@ -57,10 +57,10 @@ function Integral(J::Jacobi,k::Number)
57
57
end
58
58
59
59
60
- rangespace (D:: ConcreteIntegral{J} ) where {J <: Jacobi }= Jacobi (D. space. b- D. order,D. space. a- D. order,domain (D))
61
- bandwidths (D:: ConcreteIntegral{J} ) where {J <: Jacobi }= D. order,0
60
+ rangespace (D:: ConcreteIntegral{<:Jacobi} ) = Jacobi (D. space. b- D. order,D. space. a- D. order,domain (D))
61
+ bandwidths (D:: ConcreteIntegral{<:Jacobi} ) = D. order,0
62
62
63
- function getindex (T:: ConcreteIntegral{J} , k:: Integer ,j:: Integer ) where J <: Jacobi
63
+ function getindex (T:: ConcreteIntegral{<:Jacobi} , k:: Integer , j:: Integer )
64
64
@assert T. order== 1
65
65
if k≥ 2 && j== k- 1
66
66
complexlength (domain (T))./ (k+ T. space. a+ T. space. b- 2 )
@@ -80,7 +80,7 @@ function Volterra(S::Jacobi, order::Integer)
80
80
end
81
81
82
82
rangespace (V:: ConcreteVolterra{J} ) where {J<: Jacobi }= Jacobi (- 1.0 ,0.0 ,domain (V))
83
- bandwidths (V :: ConcreteVolterra{J} ) where {J <: Jacobi }= 1 ,0
83
+ bandwidths (:: ConcreteVolterra{<:Jacobi} ) = 1 ,0
84
84
85
85
function getindex (V:: ConcreteVolterra{J} ,k:: Integer ,j:: Integer ) where J<: Jacobi
86
86
d= domain (V)
@@ -141,32 +141,36 @@ function Conversion(L::Jacobi,M::Jacobi)
141
141
142
142
if isapproxinteger (L. a- M. a) && isapproxinteger (L. b- M. b)
143
143
dm= domain (M)
144
- D= typeof (dm)
145
144
if isapprox (M. a,L. a) && isapprox (M. b,L. b)
146
145
ConversionWrapper (Operator (I,L))
147
- elseif (isapprox (M. b,L. b+ 1 ) && isapprox (M. a,L. a)) || (isapprox (M. b,L. b) && isapprox (M. a,L. a+ 1 ))
146
+ elseif (isapprox (M. b,L. b+ static (1 )) && isapprox (M. a,L. a)) ||
147
+ (isapprox (M. b,L. b) && isapprox (M. a,L. a+ static (1 )))
148
148
ConcreteConversion (L,M)
149
- elseif M. b > L. b+ 1
150
- ConversionWrapper (TimesOperator (Conversion (Jacobi (M. b- 1 ,M. a,dm),M),Conversion (L,Jacobi (M. b- 1 ,M. a,dm))))
149
+ elseif M. b > L. b+ static (1 )
150
+ ConversionWrapper (
151
+ TimesOperator (
152
+ Conversion (Jacobi (M. b- static (1 ),M. a,dm),M),
153
+ Conversion (L,Jacobi (M. b- static (1 ),M. a,dm))))
151
154
else # if M.a >= L.a+1
152
- ConversionWrapper (TimesOperator (Conversion (Jacobi (M. b,M. a- 1 ,dm),M),Conversion (L,Jacobi (M. b,M. a- 1 ,dm))))
155
+ ConversionWrapper (
156
+ TimesOperator (
157
+ Conversion (Jacobi (M. b,M. a- static (1 ),dm),M),
158
+ Conversion (L,Jacobi (M. b,M. a- static (1 ),dm))))
153
159
end
154
- elseif L. a ≈ L. b ≈ 0. && M. a ≈ M. b ≈ 0.5
160
+ elseif L. a ≈ L. b ≈ 0 && M. a ≈ M. b ≈ 0.5
155
161
Conversion (L,Ultraspherical (L),Ultraspherical (M),M)
156
- elseif L. a ≈ L. b ≈ 0. && M. a ≈ M. b ≈ - 0.5
162
+ elseif L. a ≈ L. b ≈ 0 && M. a ≈ M. b ≈ - 0.5
157
163
Conversion (L,Ultraspherical (L),Chebyshev (M),M)
158
- elseif L. a ≈ L. b ≈ - 0.5 && M. a ≈ M. b ≈ 0.5
159
- Conversion (L,Chebyshev (L),Ultraspherical (M),M)
160
164
else # L.a - M.a ≈ L.b - M.b
161
165
error (" Implement for $L → $M " )
162
166
end
163
167
end
164
168
165
- bandwidths (C :: ConcreteConversion{J1,J2} ) where {J1 <: Jacobi ,J2 <: Jacobi }= (0 ,1 )
169
+ bandwidths (:: ConcreteConversion{<:Jacobi,<:Jacobi} ) = (0 ,1 )
166
170
167
171
168
172
169
- function Base. getindex (C:: ConcreteConversion{J1,J2 ,T} ,k:: Integer ,j:: Integer ) where {J1 <: Jacobi ,J2 <: Jacobi , T}
173
+ function Base. getindex (C:: ConcreteConversion{<:Jacobi,<:Jacobi ,T} ,k:: Integer ,j:: Integer ) where {T}
170
174
L= C. domainspace
171
175
if L. b+ 1 == C. rangespace. b
172
176
if j== k
@@ -220,7 +224,8 @@ function Conversion(A::Jacobi,B::PolynomialSpace)
220
224
end
221
225
222
226
isequalminhalf (x) = x == - 0.5
223
- isequalminhalf (:: Integer ) = false
227
+ isequalminhalf (@nospecialize :: Integer ) = false
228
+ isequalminhalf (@nospecialize :: StaticInt ) = false
224
229
225
230
function Conversion (A:: Jacobi ,B:: Chebyshev )
226
231
if isequalminhalf (A. a) && isequalminhalf (A. b)
@@ -300,23 +305,23 @@ end
300
305
301
306
302
307
303
- bandwidths (C :: ConcreteConversion{US,J} ) where {US <: Chebyshev ,J <: Jacobi } = 0 ,0
304
- bandwidths (C :: ConcreteConversion{J,US} ) where {US <: Chebyshev ,J <: Jacobi } = 0 ,0
308
+ bandwidths (:: ConcreteConversion{<:Chebyshev,<:Jacobi} ) = 0 ,0
309
+ bandwidths (:: ConcreteConversion{<:Jacobi,<:Chebyshev} ) = 0 ,0
305
310
306
311
307
- bandwidths (C :: ConcreteConversion{US,J} ) where {US <: Ultraspherical ,J <: Jacobi } = 0 ,0
308
- bandwidths (C :: ConcreteConversion{J,US} ) where {US <: Ultraspherical ,J <: Jacobi } = 0 ,0
312
+ bandwidths (:: ConcreteConversion{<:Ultraspherical,<:Jacobi} ) = 0 ,0
313
+ bandwidths (:: ConcreteConversion{<:Jacobi,<:Ultraspherical} ) = 0 ,0
309
314
310
315
# TODO : Figure out how to unify these definitions
311
- function getindex (C :: ConcreteConversion{CC,J ,T} ,k:: Integer ,j:: Integer ) where {J <: Jacobi ,CC <: Chebyshev , T}
316
+ function getindex (:: ConcreteConversion{<:Chebyshev,<:Jacobi ,T} , k:: Integer , j:: Integer ) where {T}
312
317
if j== k
313
318
one (T)/ jacobip (T,k- 1 ,- one (T)/ 2 ,- one (T)/ 2 ,one (T))
314
319
else
315
320
zero (T)
316
321
end
317
322
end
318
323
319
- function BandedMatrix (S:: SubOperator{T,ConcreteConversion{CC,J,T},Tuple{UnitRange{Int} ,UnitRange{Int}}} ) where {J<: Jacobi ,CC<: Chebyshev ,T}
324
+ function BandedMatrix (S:: SubOperator{T,ConcreteConversion{CC,J,T},NTuple{2 ,UnitRange{Int}}} ) where {J<: Jacobi ,CC<: Chebyshev ,T}
320
325
ret= BandedMatrix (Zeros, S)
321
326
kr,jr = parentindices (S)
322
327
k= (kr ∩ jr)
@@ -328,15 +333,15 @@ function BandedMatrix(S::SubOperator{T,ConcreteConversion{CC,J,T},Tuple{UnitRang
328
333
end
329
334
330
335
331
- function getindex (C :: ConcreteConversion{J,CC ,T} ,k:: Integer ,j:: Integer ) where {J <: Jacobi ,CC <: Chebyshev , T}
336
+ function getindex (:: ConcreteConversion{<:Jacobi,<:Chebyshev ,T} , k:: Integer , j:: Integer ) where {T}
332
337
if j== k
333
338
jacobip (T,k- 1 ,- one (T)/ 2 ,- one (T)/ 2 ,one (T))
334
339
else
335
340
zero (T)
336
341
end
337
342
end
338
343
339
- function BandedMatrix (S:: SubOperator{T,ConcreteConversion{J,CC,T},Tuple{UnitRange{Int} ,UnitRange{Int}}} ) where {J<: Jacobi ,CC<: Chebyshev ,T}
344
+ function BandedMatrix (S:: SubOperator{T,ConcreteConversion{J,CC,T},NTuple{2 ,UnitRange{Int}}} ) where {J<: Jacobi ,CC<: Chebyshev ,T}
340
345
ret= BandedMatrix (Zeros, S)
341
346
kr,jr = parentindices (S)
342
347
k= (kr ∩ jr)
@@ -348,7 +353,7 @@ function BandedMatrix(S::SubOperator{T,ConcreteConversion{J,CC,T},Tuple{UnitRang
348
353
end
349
354
350
355
351
- function getindex (C:: ConcreteConversion{US,J ,T} ,k:: Integer ,j:: Integer ) where {US <: Ultraspherical ,J <: Jacobi , T}
356
+ function getindex (C:: ConcreteConversion{<:Ultraspherical,<:Jacobi ,T} , k:: Integer , j:: Integer ) where {T}
352
357
if j== k
353
358
S= rangespace (C)
354
359
jp= jacobip (T,k- 1 ,S. a,S. b,one (T))
@@ -359,7 +364,7 @@ function getindex(C::ConcreteConversion{US,J,T},k::Integer,j::Integer) where {US
359
364
end
360
365
end
361
366
362
- function BandedMatrix (S:: SubOperator{T,ConcreteConversion{US,J,T},Tuple{UnitRange{Int} ,UnitRange{Int}}} ) where {US<: Ultraspherical ,J<: Jacobi ,T}
367
+ function BandedMatrix (S:: SubOperator{T,ConcreteConversion{US,J,T},NTuple{2 ,UnitRange{Int}}} ) where {US<: Ultraspherical ,J<: Jacobi ,T}
363
368
ret= BandedMatrix (Zeros, S)
364
369
kr,jr = parentindices (S)
365
370
k= (kr ∩ jr)
375
380
376
381
377
382
378
- function getindex (C:: ConcreteConversion{J,US ,T} ,k:: Integer ,j:: Integer ) where {US <: Ultraspherical ,J <: Jacobi , T}
383
+ function getindex (C:: ConcreteConversion{<:Jacobi,<:Ultraspherical ,T} , k:: Integer , j:: Integer ) where {T}
379
384
if j== k
380
385
S= domainspace (C)
381
386
jp= jacobip (T,k- 1 ,S. a,S. b,one (T))
@@ -386,7 +391,7 @@ function getindex(C::ConcreteConversion{J,US,T},k::Integer,j::Integer) where {US
386
391
end
387
392
end
388
393
389
- function BandedMatrix (S:: SubOperator{T,ConcreteConversion{J,US,T},Tuple{UnitRange{Int} ,UnitRange{Int}}} ) where {US<: Ultraspherical ,J<: Jacobi ,T}
394
+ function BandedMatrix (S:: SubOperator{T,ConcreteConversion{J,US,T},NTuple{2 ,UnitRange{Int}}} ) where {US<: Ultraspherical ,J<: Jacobi ,T}
390
395
ret= BandedMatrix (Zeros, S)
391
396
kr,jr = parentindices (S)
392
397
k= (kr ∩ jr)
403
408
404
409
isapproxminhalf (a) = a ≈ - 0.5
405
410
isapproxminhalf (:: Integer ) = false
411
+ isapproxminhalf (@nospecialize :: StaticInt ) = false
406
412
407
413
function union_rule (A:: Jacobi ,B:: Jacobi )
408
414
if domainscompatible (A,B)
0 commit comments