@@ -132,6 +132,7 @@ computes the `n`-th Jacobi polynomial, orthogonal with
132
132
respec to `(1-x)^a*(1+x)^b`, at `z`.
133
133
"""
134
134
jacobip (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 )
135
136
136
137
OrthogonalPolynomial (w:: JacobiWeight ) = Jacobi (w. a, w. b)
137
138
orthogonalityweight (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)
148
149
is equivalent to `JacobiWeight(a,0) .* Jacobi(a,b)` (`lr = :a`) or
149
150
`JacobiWeight(0,b) .* Jacobi(a,b)` (`lr = :b`)
150
151
"""
151
- struct HalfWeighted{lr, T, PP<: AbstractQuasiMatrix{T} } <: Basis {T}
152
+ struct HalfWeighted{lr, T, PP<: AbstractQuasiMatrix{T} } <: AbstractWeighted {T}
152
153
P:: PP
153
154
end
154
155
@@ -159,16 +160,18 @@ copy(Q::HalfWeighted) = Q
159
160
160
161
== (A:: HalfWeighted , B:: HalfWeighted ) = A. P == B. P
161
162
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
163
+ convert (:: Type{WeightedOrthogonalPolynomial} , Q:: HalfWeighted{:a,T,<:Jacobi} ) where T = JacobiWeight (Q. P. a,zero (T)) .* Q. P
164
+ convert (:: Type{WeightedOrthogonalPolynomial} , Q:: HalfWeighted{:b,T,<:Jacobi} ) where T = JacobiWeight (zero (T),Q. P. b) .* Q. P
165
+ convert (:: Type{WeightedOrthogonalPolynomial} , Q:: HalfWeighted{:a,T,<:Normalized} ) where T = JacobiWeight (Q. P. P. a,zero (T)) .* Q. P
166
+ convert (:: Type{WeightedOrthogonalPolynomial} , Q:: HalfWeighted{:b,T,<:Normalized} ) where T = JacobiWeight (zero (T),Q. P. P. b) .* Q. P
164
167
165
- getindex (Q:: HalfWeighted , x:: Union{Number,AbstractVector} , jr:: Union{Number,AbstractVector} ) = convert (WeightedJacobi , Q)[x,jr]
168
+ getindex (Q:: HalfWeighted , x:: Union{Number,AbstractVector} , jr:: Union{Number,AbstractVector} ) = convert (WeightedOrthogonalPolynomial , Q)[x,jr]
166
169
167
170
broadcasted (:: LazyQuasiArrayStyle{2} , :: typeof (* ), x:: Inclusion , Q:: HalfWeighted ) = Q * (Q. P \ (x .* Q. P))
168
171
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
+ \ (w_A:: HalfWeighted , w_B:: HalfWeighted ) = convert (WeightedOrthogonalPolynomial , w_A) \ convert (WeightedOrthogonalPolynomial , w_B)
173
+ \ (w_A:: HalfWeighted , B:: AbstractQuasiArray ) = convert (WeightedOrthogonalPolynomial , w_A) \ B
174
+ \ (A:: AbstractQuasiArray , w_B:: HalfWeighted ) = A \ convert (WeightedOrthogonalPolynomial , w_B)
172
175
173
176
axes (:: AbstractJacobi{T} ) where T = (Inclusion {T} (ChebyshevInterval {real(T)} ()), oneto (∞))
174
177
== (P:: Jacobi , Q:: Jacobi ) = P. a == Q. a && P. b == Q. b
370
373
# Jacobi(a+1,b+1)\(D*Jacobi(a,b))
371
374
@simplify * (D:: Derivative{<:Any,<:AbstractInterval} , S:: Jacobi ) = Jacobi (S. a+ 1 ,S. b+ 1 ) * _BandedMatrix ((((1 : ∞) .+ (S. a + S. b))/ 2 )' , ℵ₀, - 1 ,1 )
372
375
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
383
376
384
377
# L_6^t
385
378
@simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: HalfWeighted{:a,<:Any,<:Jacobi} )
395
388
HalfWeighted {:b} (Jacobi (a+ 1 ,b- 1 )) * Diagonal (b: ∞)
396
389
end
397
390
391
+ for ab in (:(:a ), :(:b ))
392
+ @eval @simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: HalfWeighted{$ab,<:Any,<:Normalized} )
393
+ P,M = arguments (ApplyLayout {typeof(*)} (), WS. P)
394
+ D * HalfWeighted {$ab} (P) * M
395
+ end
396
+ end
397
+
398
+
399
+ @simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: Weighted{<:Any,<:Jacobi} )
400
+ # L_1^t
401
+ S = WS. P
402
+ a,b = S. a, S. b
403
+ if a == b == 0
404
+ D* S
405
+ elseif iszero (a)
406
+ D * HalfWeighted {:b} (S)
407
+ elseif iszero (b)
408
+ D * HalfWeighted {:a} (S)
409
+ else
410
+ Weighted (Jacobi (a- 1 , b- 1 )) * _BandedMatrix ((- 2 * (1 : ∞))' , ℵ₀, 1 ,- 1 )
411
+ end
412
+ end
413
+
398
414
399
415
# Jacobi(a-1,b-1)\ (D*w*Jacobi(a,b))
400
416
@simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: WeightedJacobi )
0 commit comments