@@ -58,6 +58,7 @@ associated(::ChebyshevU{T}) where T = ChebyshevU{T}()
58
58
59
59
60
60
const StieltjesPoint{T,W<: Number ,V,D} = BroadcastQuasiMatrix{T,typeof (inv),Tuple{BroadcastQuasiMatrix{T,typeof (- ),Tuple{W,QuasiAdjoint{V,Inclusion{V,D}}}}}}
61
+ const LogKernelPoint{T<: Real ,C,W<: Number ,V,D} = BroadcastQuasiMatrix{T,typeof (log),Tuple{BroadcastQuasiMatrix{T,typeof (abs),Tuple{BroadcastQuasiMatrix{C,typeof (- ),Tuple{W,QuasiAdjoint{V,Inclusion{V,D}}}}}}}}
61
62
const ConvKernel{T,D1,D2} = BroadcastQuasiMatrix{T,typeof (- ),Tuple{D1,QuasiAdjoint{T,D2}}}
62
63
const Hilbert{T,D1,D2} = BroadcastQuasiMatrix{T,typeof (inv),Tuple{ConvKernel{T,Inclusion{T,D1},Inclusion{T,D2}}}}
63
64
const LogKernel{T,D1,D2} = BroadcastQuasiMatrix{T,typeof (log),Tuple{BroadcastQuasiMatrix{T,typeof (abs),Tuple{ConvKernel{T,Inclusion{T,D1},Inclusion{T,D2}}}}}}
79
80
log .(x .+ one (T)) .- log .(one (T) .- x)
80
81
end
81
82
82
- @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wT:: Weighted{<:Any,<:ChebyshevT} )
83
+ @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wT:: Weighted{<:Any,<:ChebyshevT} )
83
84
T = promote_type (eltype (H), eltype (wT))
84
85
ChebyshevU {T} () * _BandedMatrix (Fill (- convert (T,π),1 ,∞), ℵ₀, - 1 , 1 )
85
86
end
86
87
87
- @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wU:: Weighted{<:Any,<:ChebyshevU} )
88
+ @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wU:: Weighted{<:Any,<:ChebyshevU} )
88
89
T = promote_type (eltype (H), eltype (wU))
89
90
ChebyshevT {T} () * _BandedMatrix (Fill (convert (T,π),1 ,∞), ℵ₀, 1 , - 1 )
90
91
end
91
92
92
93
93
- @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wP:: Weighted{<:Any,<:OrthogonalPolynomial} )
94
+ @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wP:: Weighted{<:Any,<:OrthogonalPolynomial} )
94
95
P = wP. P
95
96
w = orthogonalityweight (P)
96
97
A = recurrencecoefficients (P)[1 ]
@@ -150,11 +151,11 @@ end
150
151
PiecewiseInterlace (c,d) * BlockBroadcastArray {promote_type(eltype(H),eltype(S))} (hvcat, 2 , A, B, C, D)
151
152
end
152
153
153
- # ##
154
+ # ##
154
155
# LogKernel
155
156
# ##
156
157
157
- @simplify function * (L:: LogKernel{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wT:: Weighted{<:Any,<:ChebyshevT} )
158
+ @simplify function * (L:: LogKernel{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wT:: Weighted{<:Any,<:ChebyshevT} )
158
159
T = promote_type (eltype (L), eltype (wT))
159
160
ChebyshevT {T} () * Diagonal (Vcat (- convert (T,π)* log (2 * one (T)),- convert (T,π)./ (1 : ∞)))
160
161
end
@@ -172,11 +173,11 @@ end
172
173
173
174
174
175
175
- # ##
176
+ # ##
176
177
# PowKernel
177
178
# ##
178
179
179
- @simplify function * (K:: PowKernel , wT:: Weighted{<:Any,<:Jacobi} )
180
+ @simplify function * (K:: PowKernel , wT:: Weighted{<:Any,<:Jacobi} )
180
181
T = promote_type (eltype (K), eltype (wT))
181
182
cnv,α = K. args
182
183
x,y = K. args[1 ]. args[1 ]. args
@@ -219,6 +220,29 @@ sqrtx2(x::Real) = sign(x)*sqrt(x^2-1)
219
220
transpose (convert (T,π) * ξ.^ oneto (∞))
220
221
end
221
222
223
+ # ###
224
+ # LogKernelPoint
225
+ # ###
226
+
227
+ @simplify function * (L:: LogKernelPoint , wP:: Weighted{<:Any,<:ChebyshevU} )
228
+ T = promote_type (eltype (L), eltype (wP))
229
+ z, xc = parent (L). args[1 ]. args[1 ]. args
230
+ if z in axes (wP,1 )
231
+ Tn = Vcat (convert (T,π)* log (2 * one (T)), convert (T,π)* ChebyshevT ()[z,2 : end ]. / oneto (∞))
232
+ return transpose ((Tn[3 : end ]- Tn[1 : end ])/ 2 )
233
+ else
234
+ # for U_k where k>=1
235
+ ξ = inv (z + sqrtx2 (z))
236
+ ζ = (convert (T,π)* ξ.^ oneto (∞)). / oneto (∞)
237
+ ζ = (ζ[3 : end ]- ζ[1 : end ])/ 2
238
+
239
+ # for U_0
240
+ ζ = Vcat (convert (T,π)* (ξ^ 2 / 4 - (log .(abs .(ξ)) + log (2 * one (T)))/ 2 ), ζ)
241
+ return transpose (ζ)
242
+ end
243
+
244
+ end
245
+
222
246
"""
223
247
HilbertVandermonde(M, data)
224
248
@@ -244,7 +268,7 @@ function cache_filldata!(H::HilbertVandermonde{T}, kr, jr) where T
244
268
n,m = H. datasize
245
269
isempty (jr) && return
246
270
resize! (H. colsupport, max (length (H. colsupport), maximum (jr)))
247
-
271
+
248
272
isempty (kr) || (H. data[(n+ 1 ): maximum (kr),1 : m] .= zero (T))
249
273
for j in (m+ 1 ): maximum (jr)
250
274
u = H. M * [H. data[:,j- 1 ]; Zeros {T} (∞)]
258
282
T̃ = chebyshevt (x)
259
283
ψ_1 = T̃ \ inv .(x .+ sqrtx2 .(x)) # same ψ_1 = x .- sqrt(x^2 - 1) but with relative accuracy as x -> ∞
260
284
data = convert (eltype (H),π) * Matrix (reshape (paddeddata (ψ_1),:,1 ))
261
- # Operator has columns π * ψ_1^k
285
+ # Operator has columns π * ψ_1^k
262
286
T̃ * HilbertVandermonde (Clenshaw (T̃ * ψ_1, T̃), data)
263
287
end
264
288
@@ -273,14 +297,14 @@ end
273
297
(inv .(z̃ .- x̃' ) * P)[:,parentindices (wT)[2 ]]
274
298
end
275
299
276
- @simplify function * (H:: Hilbert , wT:: SubQuasiArray{<:Any,2,<:Any,<:Tuple{<:AbstractAffineQuasiVector,<:Any}} )
300
+ @simplify function * (H:: Hilbert , wT:: SubQuasiArray{<:Any,2,<:Any,<:Tuple{<:AbstractAffineQuasiVector,<:Any}} )
277
301
P = parent (wT)
278
302
x = axes (P,1 )
279
303
apply (* , inv .(x .- x' ), P)[parentindices (wT)... ]
280
304
end
281
305
282
306
283
- @simplify function * (L:: LogKernel , wT:: SubQuasiArray{<:Any,2,<:Any,<:Tuple{<:AbstractAffineQuasiVector,<:Slice}} )
307
+ @simplify function * (L:: LogKernel , wT:: SubQuasiArray{<:Any,2,<:Any,<:Tuple{<:AbstractAffineQuasiVector,<:Slice}} )
284
308
V = promote_type (eltype (L), eltype (wT))
285
309
wP = parent (wT)
286
310
kr, jr = parentindices (wT)
295
319
296
320
# ## generic fallback
297
321
for Op in (:Hilbert , :StieltjesPoint , :LogKernel , :PowKernel )
298
- @eval @simplify function * (H:: $Op , wP:: WeightedBasis{<:Any,<:Weight,<:Any} )
322
+ @eval @simplify function * (H:: $Op , wP:: WeightedBasis{<:Any,<:Weight,<:Any} )
299
323
w,P = wP. args
300
324
Q = OrthogonalPolynomial (w)
301
325
(H * Weighted (Q)) * (Q \ P)
@@ -497,4 +521,4 @@ function dot(v::AbstractVector{T}, W::PowerLawMatrix, q::AbstractVector{T}) wher
497
521
vpad, qpad = paddeddata (v), paddeddata (q)
498
522
vl, ql = length (vpad), length (qpad)
499
523
return dot (vpad,W[1 : vl,1 : ql]* qpad)
500
- end
524
+ end
0 commit comments