@@ -132,6 +132,7 @@ computes the `n`-th Jacobi polynomial, orthogonal with
132132respec to `(1-x)^a*(1+x)^b`, at `z`.
133133"""
134134jacobip (n:: Integer , a, b, z:: Number ) = Base. unsafe_getindex (Jacobi {promote_type(typeof(a), typeof(b), typeof(z))} (a,b), z, n+ 1 )
135+ normalizedjacobip (n:: Integer , a, b, z:: Number ) = Base. unsafe_getindex (Normalized (Jacobi {promote_type(typeof(a), typeof(b), typeof(z))} (a,b)), z, n+ 1 )
135136
136137OrthogonalPolynomial (w:: JacobiWeight ) = Jacobi (w. a, w. b)
137138orthogonalityweight (P:: Jacobi ) = JacobiWeight (P. a, P. b)
@@ -148,7 +149,7 @@ WeightedJacobi{T}(a,b) where T = JacobiWeight{T}(a,b) .* Jacobi{T}(a,b)
148149is equivalent to `JacobiWeight(a,0) .* Jacobi(a,b)` (`lr = :a`) or
149150`JacobiWeight(0,b) .* Jacobi(a,b)` (`lr = :b`)
150151"""
151- struct HalfWeighted{lr, T, PP<: AbstractQuasiMatrix{T} } <: Basis {T}
152+ struct HalfWeighted{lr, T, PP<: AbstractQuasiMatrix{T} } <: AbstractWeighted {T}
152153 P:: PP
153154end
154155
@@ -157,18 +158,21 @@ HalfWeighted{lr}(P) where lr = HalfWeighted{lr,eltype(P),typeof(P)}(P)
157158axes (Q:: HalfWeighted ) = axes (Q. P)
158159copy (Q:: HalfWeighted ) = Q
159160
160- == (A:: HalfWeighted , B:: HalfWeighted ) = A. P == B. P
161+ == (A:: HalfWeighted{lr} , B:: HalfWeighted{lr} ) where lr = A. P == B. P
162+ == (A:: HalfWeighted , B:: HalfWeighted ) = false
161163
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+ convert (:: Type{WeightedOrthogonalPolynomial} , Q:: HalfWeighted{:a,T,<:Jacobi} ) where T = JacobiWeight (Q. P. a,zero (T)) .* Q. P
165+ convert (:: Type{WeightedOrthogonalPolynomial} , Q:: HalfWeighted{:b,T,<:Jacobi} ) where T = JacobiWeight (zero (T),Q. P. b) .* Q. P
166+ convert (:: Type{WeightedOrthogonalPolynomial} , Q:: HalfWeighted{:a,T,<:Normalized} ) where T = JacobiWeight (Q. P. P. a,zero (T)) .* Q. P
167+ convert (:: Type{WeightedOrthogonalPolynomial} , Q:: HalfWeighted{:b,T,<:Normalized} ) where T = JacobiWeight (zero (T),Q. P. P. b) .* Q. P
164168
165- getindex (Q:: HalfWeighted , x:: Union{Number,AbstractVector} , jr:: Union{Number,AbstractVector} ) = convert (WeightedJacobi , Q)[x,jr]
169+ getindex (Q:: HalfWeighted , x:: Union{Number,AbstractVector} , jr:: Union{Number,AbstractVector} ) = convert (WeightedOrthogonalPolynomial , Q)[x,jr]
166170
167171broadcasted (:: LazyQuasiArrayStyle{2} , :: typeof (* ), x:: Inclusion , Q:: HalfWeighted ) = Q * (Q. P \ (x .* Q. P))
168172
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)
173+ \ (w_A:: HalfWeighted , w_B:: HalfWeighted ) = convert (WeightedOrthogonalPolynomial , w_A) \ convert (WeightedOrthogonalPolynomial , w_B)
174+ \ (w_A:: HalfWeighted , B:: AbstractQuasiArray ) = convert (WeightedOrthogonalPolynomial , w_A) \ B
175+ \ (A:: AbstractQuasiArray , w_B:: HalfWeighted ) = A \ convert (WeightedOrthogonalPolynomial , w_B)
172176
173177axes (:: AbstractJacobi{T} ) where T = (Inclusion {T} (ChebyshevInterval {real(T)} ()), oneto (∞))
174178== (P:: Jacobi , Q:: Jacobi ) = P. a == Q. a && P. b == Q. b
370374# Jacobi(a+1,b+1)\(D*Jacobi(a,b))
371375@simplify * (D:: Derivative{<:Any,<:AbstractInterval} , S:: Jacobi ) = Jacobi (S. a+ 1 ,S. b+ 1 ) * _BandedMatrix ((((1 : ∞) .+ (S. a + S. b))/ 2 )' , ℵ₀, - 1 ,1 )
372376
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
382- end
383377
384378# L_6^t
385379@simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: HalfWeighted{:a,<:Any,<:Jacobi} )
395389 HalfWeighted {:b} (Jacobi (a+ 1 ,b- 1 )) * Diagonal (b: ∞)
396390end
397391
392+ for ab in (:(:a ), :(:b ))
393+ @eval @simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: HalfWeighted{$ab,<:Any,<:Normalized} )
394+ P,M = arguments (ApplyLayout {typeof(*)} (), WS. P)
395+ D * HalfWeighted {$ab} (P) * M
396+ end
397+ end
398+
399+
400+ @simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: Weighted{<:Any,<:Jacobi} )
401+ # L_1^t
402+ S = WS. P
403+ a,b = S. a, S. b
404+ if a == b == 0
405+ D* S
406+ elseif iszero (a)
407+ D * HalfWeighted {:b} (S)
408+ elseif iszero (b)
409+ D * HalfWeighted {:a} (S)
410+ else
411+ Weighted (Jacobi (a- 1 , b- 1 )) * _BandedMatrix ((- 2 * (1 : ∞))' , ℵ₀, 1 ,- 1 )
412+ end
413+ end
414+
398415
399416# Jacobi(a-1,b-1)\ (D*w*Jacobi(a,b))
400417@simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: WeightedJacobi )
0 commit comments