@@ -98,7 +98,7 @@ for (Func,Len,Sum) in ((:DefiniteIntegral,:complexlength,:sum),(:DefiniteLineInt
9898 @eval begin
9999 $ Func (S:: Jacobi{<:IntervalOrSegment} ) = $ ConcFunc (S)
100100
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}
102102 dsp = domainspace (Σ)
103103
104104 if dsp. b == dsp. a == 0
@@ -109,7 +109,7 @@ for (Func,Len,Sum) in ((:DefiniteIntegral,:complexlength,:sum),(:DefiniteLineInt
109109 end
110110 end
111111
112- function bandwidths (Σ:: $ConcFunc{Jacobi{D,R}} ) where {D <: IntervalOrSegment ,R}
112+ function bandwidths (Σ:: $ConcFunc{<: Jacobi{<:IntervalOrSegment}} )
113113 if domainspace (Σ). b == domainspace (Σ). a == 0
114114 0 ,0 # first entry
115115 else
@@ -187,10 +187,10 @@ end
187187
188188# return the space that has banded Conversion to the other
189189function 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)
193191 Jacobi (min (A. b,B. b),min (A. a,B. a),domain (A))
192+ else
193+ NoSpace ()
194194 end
195195end
196196
@@ -212,8 +212,11 @@ function Conversion(A::Jacobi,B::PolynomialSpace)
212212 ConversionWrapper (TimesOperator (Conversion (J,B),Conversion (A,J)))
213213end
214214
215+ isequalminhalf (x) = x == - 0.5
216+ isequalminhalf (:: Integer ) = false
217+
215218function Conversion (A:: Jacobi ,B:: Chebyshev )
216- if A. a == A. b == - 0.5
219+ if isequalminhalf ( A. a) && isequalminhalf ( A. b)
217220 ConcreteConversion (A,B)
218221 elseif A. a == A. b == 0
219222 ConversionWrapper (
@@ -230,7 +233,7 @@ function Conversion(A::Jacobi,B::Chebyshev)
230233end
231234
232235function Conversion (A:: Chebyshev ,B:: Jacobi )
233- if B. a == B. b == - 0.5
236+ if isequalminhalf ( B. a) && isequalminhalf ( B. b)
234237 ConcreteConversion (A,B)
235238 elseif B. a == B. b == 0
236239 ConversionWrapper (
@@ -248,10 +251,10 @@ end
248251
249252
250253function Conversion (A:: Jacobi ,B:: Ultraspherical )
251- if A. a == A. b == - 0.5
254+ if isequalminhalf ( A. a) && isequalminhalf ( A. b)
252255 ConversionWrapper (Conversion (Chebyshev (domain (A)),B)*
253256 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))
255258 ConcreteConversion (A,B)
256259 elseif A. a == A. b == 0
257260 ConversionWrapper (
@@ -268,10 +271,10 @@ function Conversion(A::Jacobi,B::Ultraspherical)
268271end
269272
270273function Conversion (A:: Ultraspherical ,B:: Jacobi )
271- if B. a == B. b == - 0.5
274+ if isequalminhalf ( B. a) && isequalminhalf ( B. b)
272275 ConversionWrapper (ConcreteConversion (Chebyshev (domain (A)),B)*
273276 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))
275278 ConcreteConversion (A,B)
276279 elseif B. a == B. b == 0
277280 ConversionWrapper (
@@ -391,9 +394,8 @@ function BandedMatrix(S::SubOperator{T,ConcreteConversion{J,US,T},Tuple{UnitRang
391394end
392395
393396
394-
395-
396-
397+ isapproxminhalf (a) = a ≈ - 0.5
398+ isapproxminhalf (:: Integer ) = false
397399
398400function union_rule (A:: Jacobi ,B:: Jacobi )
399401 if domainscompatible (A,B)
@@ -414,14 +416,14 @@ end
414416
415417function union_rule (A:: Chebyshev ,B:: Jacobi )
416418 if domainscompatible (A, B)
417- if isapprox (B. a, - 0.5 ) && isapprox (B. b, - 0.5 )
419+ if isapproxminhalf (B. a) && isapproxminhalf (B. b)
418420 # the spaces are the same
419421 A
420422 else
421423 union (Jacobi (A),B)
422424 end
423425 else
424- if isapprox (B. a, - 0.5 ) && isapprox (B. b, - 0.5 )
426+ if isapproxminhalf (B. a) && isapproxminhalf (B. b)
425427 union (A, Chebyshev (domain (B)))
426428 else
427429 NoSpace ()
@@ -431,14 +433,14 @@ end
431433function union_rule (A:: Ultraspherical ,B:: Jacobi )
432434 m= order (A)
433435 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 )
435437 # the spaces are the same
436438 A
437439 else
438440 union (Jacobi (A),B)
439441 end
440442 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 )
442444 union (A, Ultraspherical (m, domain (B)))
443445 else
444446 NoSpace ()
@@ -449,21 +451,21 @@ end
449451for (OPrule,OP) in ((:conversion_rule ,:conversion_type ), (:maxspace_rule ,:maxspace ))
450452 @eval begin
451453 function $OPrule (A:: Chebyshev ,B:: Jacobi )
452- if B. a ≈ - 0.5 && B. b ≈ - 0.5
454+ if isapproxminhalf ( B. a) && isapproxminhalf ( B. b)
453455 # the spaces are the same
454456 A
455- elseif isapproxinteger (B. a+ 0.5 ) && isapproxinteger (B. b+ 0.5 )
457+ elseif isapproxinteger_addhalf (B. a) && isapproxinteger_addhalf (B. b)
456458 $ OP (Jacobi (A),B)
457459 else
458460 NoSpace ()
459461 end
460462 end
461463 function $OPrule (A:: Ultraspherical ,B:: Jacobi )
462464 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)
464466 # the spaces are the same
465467 A
466- elseif isapproxinteger (B. a+ 0.5 ) && isapproxinteger (B. b+ 0.5 )
468+ elseif isapproxinteger_addhalf (B. a) && isapproxinteger_addhalf (B. b)
467469 $ OP (Jacobi (A),B)
468470 else
469471 NoSpace ()
0 commit comments