@@ -98,7 +98,7 @@ for (Func,Len,Sum) in ((:DefiniteIntegral,:complexlength,:sum),(:DefiniteLineInt
98
98
@eval begin
99
99
$ Func (S:: Jacobi{<:IntervalOrSegment} ) = $ ConcFunc (S)
100
100
101
- function getindex (Σ:: $ConcFunc{Jacobi{D,R },T} ,k:: Integer ) where {D <: IntervalOrSegment ,R, T}
101
+ function getindex (Σ:: $ConcFunc{<: Jacobi{<:IntervalOrSegment },T} , k:: Integer ) where {T}
102
102
dsp = domainspace (Σ)
103
103
104
104
if dsp. b == dsp. a == 0
@@ -109,7 +109,7 @@ for (Func,Len,Sum) in ((:DefiniteIntegral,:complexlength,:sum),(:DefiniteLineInt
109
109
end
110
110
end
111
111
112
- function bandwidths (Σ:: $ConcFunc{Jacobi{D,R}} ) where {D <: IntervalOrSegment ,R}
112
+ function bandwidths (Σ:: $ConcFunc{<: Jacobi{<:IntervalOrSegment}} )
113
113
if domainspace (Σ). b == domainspace (Σ). a == 0
114
114
0 ,0 # first entry
115
115
else
@@ -187,10 +187,10 @@ end
187
187
188
188
# return the space that has banded Conversion to the other
189
189
function conversion_rule (A:: Jacobi ,B:: Jacobi )
190
- if ! isapproxinteger (A. a- B. a) || ! isapproxinteger (A. b- B. b)
191
- NoSpace ()
192
- else
190
+ if isapproxinteger (A. a- B. a) && isapproxinteger (A. b- B. b)
193
191
Jacobi (min (A. b,B. b),min (A. a,B. a),domain (A))
192
+ else
193
+ NoSpace ()
194
194
end
195
195
end
196
196
@@ -212,8 +212,11 @@ function Conversion(A::Jacobi,B::PolynomialSpace)
212
212
ConversionWrapper (TimesOperator (Conversion (J,B),Conversion (A,J)))
213
213
end
214
214
215
+ isequalminhalf (x) = x == - 0.5
216
+ isequalminhalf (:: Integer ) = false
217
+
215
218
function Conversion (A:: Jacobi ,B:: Chebyshev )
216
- if A. a == A. b == - 0.5
219
+ if isequalminhalf ( A. a) && isequalminhalf ( A. b)
217
220
ConcreteConversion (A,B)
218
221
elseif A. a == A. b == 0
219
222
ConversionWrapper (
@@ -230,7 +233,7 @@ function Conversion(A::Jacobi,B::Chebyshev)
230
233
end
231
234
232
235
function Conversion (A:: Chebyshev ,B:: Jacobi )
233
- if B. a == B. b == - 0.5
236
+ if isequalminhalf ( B. a) && isequalminhalf ( B. b)
234
237
ConcreteConversion (A,B)
235
238
elseif B. a == B. b == 0
236
239
ConversionWrapper (
@@ -248,10 +251,10 @@ end
248
251
249
252
250
253
function Conversion (A:: Jacobi ,B:: Ultraspherical )
251
- if A. a == A. b == - 0.5
254
+ if isequalminhalf ( A. a) && isequalminhalf ( A. b)
252
255
ConversionWrapper (Conversion (Chebyshev (domain (A)),B)*
253
256
ConcreteConversion (A,Chebyshev (domain (A))))
254
- elseif A. a == A. b == order (B)- 0.5
257
+ elseif isequalminhalf ( A. a - order (B)) && isequalminhalf ( A. b - order (B))
255
258
ConcreteConversion (A,B)
256
259
elseif A. a == A. b == 0
257
260
ConversionWrapper (
@@ -268,10 +271,10 @@ function Conversion(A::Jacobi,B::Ultraspherical)
268
271
end
269
272
270
273
function Conversion (A:: Ultraspherical ,B:: Jacobi )
271
- if B. a == B. b == - 0.5
274
+ if isequalminhalf ( B. a) && isequalminhalf ( B. b)
272
275
ConversionWrapper (ConcreteConversion (Chebyshev (domain (A)),B)*
273
276
Conversion (A,Chebyshev (domain (A))))
274
- elseif B. a == B. b == order (A)- 0.5
277
+ elseif isequalminhalf ( B. a - order (A)) && isequalminhalf ( B. b - order (A))
275
278
ConcreteConversion (A,B)
276
279
elseif B. a == B. b == 0
277
280
ConversionWrapper (
@@ -391,9 +394,8 @@ function BandedMatrix(S::SubOperator{T,ConcreteConversion{J,US,T},Tuple{UnitRang
391
394
end
392
395
393
396
394
-
395
-
396
-
397
+ isapproxminhalf (a) = a ≈ - 0.5
398
+ isapproxminhalf (:: Integer ) = false
397
399
398
400
function union_rule (A:: Jacobi ,B:: Jacobi )
399
401
if domainscompatible (A,B)
@@ -414,14 +416,14 @@ end
414
416
415
417
function union_rule (A:: Chebyshev ,B:: Jacobi )
416
418
if domainscompatible (A, B)
417
- if isapprox (B. a, - 0.5 ) && isapprox (B. b, - 0.5 )
419
+ if isapproxminhalf (B. a) && isapproxminhalf (B. b)
418
420
# the spaces are the same
419
421
A
420
422
else
421
423
union (Jacobi (A),B)
422
424
end
423
425
else
424
- if isapprox (B. a, - 0.5 ) && isapprox (B. b, - 0.5 )
426
+ if isapproxminhalf (B. a) && isapproxminhalf (B. b)
425
427
union (A, Chebyshev (domain (B)))
426
428
else
427
429
NoSpace ()
@@ -431,14 +433,14 @@ end
431
433
function union_rule (A:: Ultraspherical ,B:: Jacobi )
432
434
m= order (A)
433
435
if domainscompatible (A, B)
434
- if isapprox (B. a,m - 0.5 ) && isapprox (B. b,m - 0.5 )
436
+ if isapproxminhalf (B. a- m ) && isapproxminhalf (B. b- m )
435
437
# the spaces are the same
436
438
A
437
439
else
438
440
union (Jacobi (A),B)
439
441
end
440
442
else
441
- if isapprox (B. a,m - 0.5 ) && isapprox (B. b,m - 0.5 )
443
+ if isapproxminhalf (B. a- m ) && isapproxminhalf (B. b- m )
442
444
union (A, Ultraspherical (m, domain (B)))
443
445
else
444
446
NoSpace ()
@@ -449,21 +451,21 @@ end
449
451
for (OPrule,OP) in ((:conversion_rule ,:conversion_type ), (:maxspace_rule ,:maxspace ))
450
452
@eval begin
451
453
function $OPrule (A:: Chebyshev ,B:: Jacobi )
452
- if B. a ≈ - 0.5 && B. b ≈ - 0.5
454
+ if isapproxminhalf ( B. a) && isapproxminhalf ( B. b)
453
455
# the spaces are the same
454
456
A
455
- elseif isapproxinteger (B. a+ 0.5 ) && isapproxinteger (B. b+ 0.5 )
457
+ elseif isapproxinteger_addhalf (B. a) && isapproxinteger_addhalf (B. b)
456
458
$ OP (Jacobi (A),B)
457
459
else
458
460
NoSpace ()
459
461
end
460
462
end
461
463
function $OPrule (A:: Ultraspherical ,B:: Jacobi )
462
464
m = order (A)
463
- if B. a ≈ m - 0.5 && B. b ≈ m - 0.5
465
+ if isapproxminhalf ( B. a - m) && isapproxminhalf ( B. b - m)
464
466
# the spaces are the same
465
467
A
466
- elseif isapproxinteger (B. a+ 0.5 ) && isapproxinteger (B. b+ 0.5 )
468
+ elseif isapproxinteger_addhalf (B. a) && isapproxinteger_addhalf (B. b)
467
469
$ OP (Jacobi (A),B)
468
470
else
469
471
NoSpace ()
0 commit comments