@@ -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
@@ -157,18 +158,21 @@ HalfWeighted{lr}(P) where lr = HalfWeighted{lr,eltype(P),typeof(P)}(P)
157
158
axes (Q:: HalfWeighted ) = axes (Q. P)
158
159
copy (Q:: HalfWeighted ) = Q
159
160
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
161
163
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
164
168
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]
166
170
167
171
broadcasted (:: LazyQuasiArrayStyle{2} , :: typeof (* ), x:: Inclusion , Q:: HalfWeighted ) = Q * (Q. P \ (x .* Q. P))
168
172
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)
172
176
173
177
axes (:: AbstractJacobi{T} ) where T = (Inclusion {T} (ChebyshevInterval {real(T)} ()), oneto (∞))
174
178
== (P:: Jacobi , Q:: Jacobi ) = P. a == Q. a && P. b == Q. b
370
374
# Jacobi(a+1,b+1)\(D*Jacobi(a,b))
371
375
@simplify * (D:: Derivative{<:Any,<:AbstractInterval} , S:: Jacobi ) = Jacobi (S. a+ 1 ,S. b+ 1 ) * _BandedMatrix ((((1 : ∞) .+ (S. a + S. b))/ 2 )' , ℵ₀, - 1 ,1 )
372
376
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
377
384
378
# L_6^t
385
379
@simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: HalfWeighted{:a,<:Any,<:Jacobi} )
395
389
HalfWeighted {:b} (Jacobi (a+ 1 ,b- 1 )) * Diagonal (b: ∞)
396
390
end
397
391
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
+
398
415
399
416
# Jacobi(a-1,b-1)\ (D*w*Jacobi(a,b))
400
417
@simplify function * (D:: Derivative{<:Any,<:AbstractInterval} , WS:: WeightedJacobi )
0 commit comments