@@ -58,54 +58,56 @@ associated(::ChebyshevU{T}) where T = ChebyshevU{T}()
58
58
59
59
60
60
const StieltjesPoint{T,V,D} = BroadcastQuasiMatrix{T,typeof (inv),Tuple{BroadcastQuasiMatrix{T,typeof (- ),Tuple{T,QuasiAdjoint{V,Inclusion{V,D}}}}}}
61
- const ConvKernel{T,D } = BroadcastQuasiMatrix{T,typeof (- ),Tuple{D ,QuasiAdjoint{T,D }}}
62
- const Hilbert{T,D } = BroadcastQuasiMatrix{T,typeof (inv),Tuple{ConvKernel{T,Inclusion{T,D }}}}
63
- const LogKernel{T,D } = BroadcastQuasiMatrix{T,typeof (log),Tuple{BroadcastQuasiMatrix{T,typeof (abs),Tuple{ConvKernel{T,Inclusion{T,D }}}}}}
64
- const PowKernel{T,D, F<: Real } = BroadcastQuasiMatrix{T,typeof (^ ),Tuple{BroadcastQuasiMatrix{T,typeof (abs),Tuple{ConvKernel{T,Inclusion{T,D }}}},F}}
61
+ const ConvKernel{T,D1,D2 } = BroadcastQuasiMatrix{T,typeof (- ),Tuple{D1 ,QuasiAdjoint{T,D2 }}}
62
+ const Hilbert{T,D1,D2 } = BroadcastQuasiMatrix{T,typeof (inv),Tuple{ConvKernel{T,Inclusion{T,D1},Inclusion{T,D2 }}}}
63
+ const LogKernel{T,D1,D2 } = BroadcastQuasiMatrix{T,typeof (log),Tuple{BroadcastQuasiMatrix{T,typeof (abs),Tuple{ConvKernel{T,Inclusion{T,D1},Inclusion{T,D2 }}}}}}
64
+ const PowKernel{T,D1,D2, F<: Real } = BroadcastQuasiMatrix{T,typeof (^ ),Tuple{BroadcastQuasiMatrix{T,typeof (abs),Tuple{ConvKernel{T,Inclusion{T,D1},Inclusion{T,D2 }}}},F}}
65
65
66
66
67
- @simplify function * (H:: Hilbert , w:: ChebyshevTWeight )
67
+ @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , w:: ChebyshevTWeight )
68
68
T = promote_type (eltype (H), eltype (w))
69
69
zeros (T, axes (w,1 ))
70
70
end
71
71
72
- @simplify function * (H:: Hilbert , w:: ChebyshevUWeight )
72
+ @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , w:: ChebyshevUWeight )
73
73
T = promote_type (eltype (H), eltype (w))
74
74
convert (T,π) * axes (w,1 )
75
75
end
76
76
77
- @simplify function * (H:: Hilbert , w:: LegendreWeight )
77
+ @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , w:: LegendreWeight )
78
78
T = promote_type (eltype (H), eltype (w))
79
79
x = axes (w,1 )
80
80
log .(x .+ one (T)) .- log .(one (T) .- x)
81
81
end
82
82
83
- @simplify function * (H:: Hilbert , wT:: Weighted{<:Any,<:ChebyshevT} )
83
+ @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wT:: Weighted{<:Any,<:ChebyshevT} )
84
84
T = promote_type (eltype (H), eltype (wT))
85
85
ChebyshevU {T} () * _BandedMatrix (Fill (- convert (T,π),1 ,∞), ℵ₀, - 1 , 1 )
86
86
end
87
87
88
- @simplify function * (H:: Hilbert , wU:: Weighted{<:Any,<:ChebyshevU} )
88
+ @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wU:: Weighted{<:Any,<:ChebyshevU} )
89
89
T = promote_type (eltype (H), eltype (wU))
90
90
ChebyshevT {T} () * _BandedMatrix (Fill (convert (T,π),1 ,∞), ℵ₀, 1 , - 1 )
91
91
end
92
92
93
93
94
- @simplify function * (H:: Hilbert , wP:: Weighted{<:Any,<:OrthogonalPolynomial} )
94
+ @simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wP:: Weighted{<:Any,<:OrthogonalPolynomial} )
95
95
P = wP. P
96
96
w = orthogonalityweight (P)
97
97
A = recurrencecoefficients (P)[1 ]
98
98
Q = associated (P)
99
99
(- A[1 ]* sum (w))* [zero (axes (P,1 )) Q] + (H* w) .* P
100
100
end
101
101
102
- @simplify * (H:: Hilbert , P:: Legendre ) = H * Weighted (P)
102
+ @simplify * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , P:: Legendre ) = H * Weighted (P)
103
103
104
104
105
105
106
106
@simplify function * (H:: Hilbert , w:: SubQuasiArray{<:Any,1} )
107
107
T = promote_type (eltype (H), eltype (w))
108
108
m = parentindices (w)[1 ]
109
+ # TODO : mapping other geometries
110
+ @assert axes (H,1 ) == axes (H,2 ) == axes (w,1 )
109
111
P = parent (w)
110
112
x = axes (P,1 )
111
113
(inv .(x .- x' ) * P)[m]
114
116
@simplify function * (H:: Hilbert , wP:: Weighted{<:Any,<:SubQuasiArray{<:Any,2}} )
115
117
T = promote_type (eltype (H), eltype (wP))
116
118
kr,jr = parentindices (wP. P)
119
+ # TODO : mapping other geometries
120
+ @assert axes (H,1 ) == axes (H,2 ) == axes (wP,1 )
117
121
P = parent (wP. P)
118
122
x = axes (P,1 )
119
123
(inv .(x .- x' ) * Weighted (P))[kr,jr]
@@ -124,14 +128,15 @@ end
124
128
# LogKernel
125
129
# ##
126
130
127
- @simplify function * (L:: LogKernel , wT:: Weighted{<:Any,<:ChebyshevT} )
131
+ @simplify function * (L:: LogKernel{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , wT:: Weighted{<:Any,<:ChebyshevT} )
128
132
T = promote_type (eltype (L), eltype (wT))
129
133
ChebyshevT {T} () * Diagonal (Vcat (- convert (T,π)* log (2 * one (T)),- convert (T,π)./ (1 : ∞)))
130
134
end
131
135
132
136
@simplify function * (H:: LogKernel , wT:: Weighted{<:Any,<:SubQuasiArray{<:Any,2,<:ChebyshevT,<:Tuple{AbstractAffineQuasiVector,Slice}}} )
133
137
V = promote_type (eltype (H), eltype (wT))
134
138
kr,jr = parentindices (wT. P)
139
+ @assert axes (H,1 ) == axes (H,2 ) == axes (wT,1 )
135
140
T = parent (wT. P)
136
141
x = axes (T,1 )
137
142
W = Weighted (T)
@@ -181,12 +186,47 @@ sqrtx2(z::Number) = sqrt(z-1)*sqrt(z+1)
181
186
sqrtx2 (x:: Real ) = sign (x)* sqrt (x^ 2 - 1 )
182
187
183
188
@simplify function * (S:: StieltjesPoint , wP:: Weighted{<:Any,<:ChebyshevU} )
189
+ T = promote_type (eltype (S), eltype (wP))
184
190
z, x = parent (S). args[1 ]. args
185
191
z in axes (wP,1 ) && transpose ((inv .(x .- x' ) * wP)[z,:])
186
192
ξ = inv (z + sqrtx2 (z))
187
- transpose (π * ξ.^ oneto (∞))
193
+ transpose (convert (T,π) * ξ.^ oneto (∞))
188
194
end
189
195
196
+ """
197
+ HilbertVandermonde(M, data)
198
+
199
+ represents the matrix with columns M^k * data[:,end].
200
+ """
201
+ mutable struct HilbertVandermonde{T,MM} <: AbstractCachedMatrix{T}
202
+ M:: MM
203
+ data:: Matrix{T}
204
+ datasize:: NTuple{2,Int}
205
+ end
206
+
207
+ HilbertVandermonde (M, data:: Matrix ) = HilbertVandermonde (M, data, size (data))
208
+ size (H:: HilbertVandermonde ) = (ℵ₀,ℵ₀)
209
+
210
+ function cache_filldata! (H:: HilbertVandermonde{T} , kr, jr) where T
211
+ n,m = H. datasize
212
+ isempty (kr) && return
213
+ isempty (jr) && return
214
+ H. data[(n+ 1 ): maximum (kr),1 : m] .= zero (T)
215
+ for j in (m+ 1 ): maximum (jr)
216
+ H. data[kr,j] .= (H. M * [H. data[:,j- 1 ]; Zeros {T} (∞)])[kr]
217
+ end
218
+ end
219
+
220
+ @simplify function * (H:: Hilbert{<:Any,<:Any,<:ChebyshevInterval} , W:: Weighted{<:Any,<:ChebyshevU} )
221
+ x = axes (H,1 )
222
+ T̃ = chebyshevt (x)
223
+ ψ_1 = T̃ \ inv .(x .+ sqrtx2 .(x))
224
+ data = convert (eltype (H),π) * Matrix (reshape (paddeddata (ψ_1),:,1 ))
225
+ T̃ * HilbertVandermonde (Clenshaw (T̃ * ψ_1, T̃), data)
226
+ end
227
+
228
+
229
+
190
230
191
231
@simplify function * (S:: StieltjesPoint , wT:: SubQuasiArray{<:Any,2,<:Any,<:Tuple{<:AbstractAffineQuasiVector,<:Any}} )
192
232
P = parent (wT)
0 commit comments