@@ -142,15 +142,46 @@ WeightedJacobi(a,b) = JacobiWeight(a,b) .* Jacobi(a,b)
142142WeightedJacobi {T} (a,b) where T = JacobiWeight {T} (a,b) .* Jacobi {T} (a,b)
143143
144144
145+ """
146+ HalfWeighted{lr}(Jacobi(a,b))
147+
148+ is equivalent to `JacobiWeight(a,0) .* Jacobi(a,b)` (`lr = :a`) or
149+ `JacobiWeight(0,b) .* Jacobi(a,b)` (`lr = :b`)
150+ """
151+ struct HalfWeighted{lr, T, PP<: AbstractQuasiMatrix{T} } <: Basis{T}
152+ P:: PP
153+ end
154+
155+ HalfWeighted {lr} (P) where lr = HalfWeighted {lr,eltype(P),typeof(P)} (P)
156+
157+ axes (Q:: HalfWeighted ) = axes (Q. P)
158+ copy (Q:: HalfWeighted ) = Q
159+
160+ == (A:: HalfWeighted , B:: HalfWeighted ) = A. P == B. P
161+
162+ convert (:: Type{WeightedJacobi} , Q:: HalfWeighted{:a,T} ) where T = JacobiWeight (Q. P. a,zero (T)) .* Q. P
163+ convert (:: Type{WeightedJacobi} , Q:: HalfWeighted{:b,T} ) where T = JacobiWeight (zero (T),Q. P. b) .* Q. P
164+
165+ getindex (Q:: HalfWeighted , x:: Union{Number,AbstractVector} , jr:: Union{Number,AbstractVector} ) = convert (WeightedJacobi, Q)[x,jr]
166+
167+ broadcasted (:: LazyQuasiArrayStyle{2} , :: typeof (* ), x:: Inclusion , Q:: HalfWeighted ) = Q * (Q. P \ (x .* Q. P))
168+
169+ \ (w_A:: HalfWeighted , w_B:: HalfWeighted ) = convert (WeightedJacobi, w_A) \ convert (WeightedJacobi, w_B)
170+ \ (w_A:: HalfWeighted , B:: AbstractQuasiArray ) = convert (WeightedJacobi, w_A) \ B
171+ \ (A:: AbstractQuasiArray , w_B:: HalfWeighted ) = A \ convert (WeightedJacobi, w_B)
172+
145173axes (:: AbstractJacobi{T} ) where T = (Inclusion {T} (ChebyshevInterval {real(T)} ()), oneto (∞))
146174== (P:: Jacobi , Q:: Jacobi ) = P. a == Q. a && P. b == Q. b
147175== (P:: Legendre , Q:: Jacobi ) = Jacobi (P) == Q
148176== (P:: Jacobi , Q:: Legendre ) = P == Jacobi (Q)
149177== (A:: WeightedJacobi , B:: WeightedJacobi ) = A. args == B. args
150178== (A:: WeightedJacobi , B:: Jacobi{T} ) where T = A == JacobiWeight (zero (T),zero (T)).* B
151179== (A:: WeightedJacobi , B:: Legendre ) = A == Jacobi (B)
152- == (A:: Jacobi{T} , B:: WeightedJacobi ) where T = JacobiWeight (zero (T),zero (T)).* A == B
153180== (A:: Legendre , B:: WeightedJacobi ) = Jacobi (A) == B
181+ == (A:: Jacobi{T} , B:: WeightedJacobi ) where T = JacobiWeight (zero (T),zero (T)).* A == B
182+ == (A:: Legendre , B:: Weighted{<:Any,<:AbstractJacobi} ) = A == B. P
183+ == (A:: Weighted{<:Any,<:AbstractJacobi} , B:: Legendre ) = A. P == B
184+
154185
155186summary (io:: IO , P:: Jacobi ) = print (io, " Jacobi($(P. a) , $(P. b) )" )
156187
@@ -290,6 +321,16 @@ function \(w_A::WeightedJacobi, B::Jacobi)
290321 w_A \ (JacobiWeight (zero (a),zero (b)) .* B)
291322end
292323
324+ function \ (A:: AbstractJacobi , w_B:: WeightedJacobi )
325+ Ã = Jacobi (A)
326+ (A \ Ã) * (Ã \ w_B)
327+ end
328+ function \ (w_A:: WeightedJacobi , B:: AbstractJacobi )
329+ B̃ = Jacobi (B)
330+ (w_A \ B̃) * (B̃ \ B)
331+ end
332+
333+
293334function broadcastbasis (:: typeof (+ ), w_A:: WeightedJacobi , w_B:: WeightedJacobi )
294335 wA,A = w_A. args
295336 wB,B = w_B. args
@@ -327,26 +368,46 @@ end
327368# #########
328369
329370# Jacobi(a+1,b+1)\(D*Jacobi(a,b))
330- @simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , S:: Jacobi )
331- A = _BandedMatrix ((((1 : ∞) .+ (S. a + S. b))/ 2 )' , ℵ₀, - 1 ,1 )
332- ApplyQuasiMatrix (* , Jacobi (S. a+ 1 ,S. b+ 1 ), A)
371+ @simplify * (D:: Derivative{<:Any,<:AbstractInterval} , S:: Jacobi ) = Jacobi (S. a+ 1 ,S. b+ 1 ) * _BandedMatrix ((((1 : ∞) .+ (S. a + S. b))/ 2 )' , ℵ₀, - 1 ,1 )
372+
373+ @simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: Weighted{<:Any,<:Jacobi} )
374+ # L_1^t
375+ S = WS. P
376+ a,b = S. a, S. b
377+ if a == b == 0
378+ D* S
379+ else
380+ Weighted (Jacobi (a- 1 , b- 1 )) * _BandedMatrix ((- 2 * (1 : ∞))' , ℵ₀, 1 ,- 1 )
381+ end
333382end
334383
384+ # L_6^t
385+ @simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: HalfWeighted{:a,<:Any,<:Jacobi} )
386+ S = WS. P
387+ a,b = S. a, S. b
388+ HalfWeighted {:a} (Jacobi (a- 1 ,b+ 1 )) * Diagonal (- (a: ∞))
389+ end
390+
391+ # L_6
392+ @simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: HalfWeighted{:b,<:Any,<:Jacobi} )
393+ S = WS. P
394+ a,b = S. a, S. b
395+ HalfWeighted {:b} (Jacobi (a+ 1 ,b- 1 )) * Diagonal (b: ∞)
396+ end
397+
398+
335399# Jacobi(a-1,b-1)\ (D*w*Jacobi(a,b))
336400@simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: WeightedJacobi )
337401 w,S = WS. args
338402 a,b = S. a, S. b
339- if w. a == 0 && w. b == 0
403+ if isorthogonalityweighted (WS) # L_1^t
404+ D * Weighted (S)
405+ elseif w. a == w. b == 0
340406 D* S
341407 elseif iszero (w. a) && w. b == b # L_6
342- A = Diagonal (b: ∞)
343- ApplyQuasiMatrix (* , JacobiWeight (w. a,b- 1 ) .* Jacobi (a+ 1 ,b- 1 ), A)
408+ D * HalfWeighted {:b} (S)
344409 elseif iszero (w. b) && w. a == a # L_6^t
345- A = Diagonal (- (a: ∞))
346- ApplyQuasiMatrix (* , JacobiWeight (a- 1 ,w. b) .* Jacobi (a- 1 ,b+ 1 ), A)
347- elseif w. a == a && w. b == b # L_1^t
348- A = _BandedMatrix ((- 2 * (1 : ∞))' , ℵ₀, 1 ,- 1 )
349- ApplyQuasiMatrix (* , JacobiWeight (a- 1 ,b- 1 ) .* Jacobi (a- 1 , b- 1 ), A)
410+ D * HalfWeighted {:a} (S)
350411 elseif iszero (w. a)
351412 W = (JacobiWeight (w. a, b- 1 ) .* Jacobi (a+ 1 , b- 1 )) \ (D * (JacobiWeight (w. a,b) .* S))
352413 J = Jacobi (a+ 1 ,b) # range Jacobi
0 commit comments