@@ -63,7 +63,6 @@ const Hilbert{T,D1,D2} = BroadcastQuasiMatrix{T,typeof(inv),Tuple{ConvKernel{T,I
63
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
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
-
67
66
@simplify function * (H:: Hilbert{<:Any,<:ChebyshevInterval,<:ChebyshevInterval} , w:: ChebyshevTWeight )
68
67
T = promote_type (eltype (H), eltype (w))
69
68
zeros (T, axes (w,1 ))
137
136
end
138
137
end
139
138
139
+ @simplify function * (H:: Hilbert , S:: PiecewiseInterlace )
140
+ axes (H,2 ) == axes (S,1 ) || throw (DimensionMismatch ())
141
+ @assert length (S. args) == 2
142
+ a,b = S. args
143
+ xa,xb = axes (a,1 ),axes (b,1 )
144
+ Ha_a = inv .(xa .- xa' ) * a
145
+ Ha_b = inv .(xb .- xa' ) * a
146
+ Hb_a = inv .(xa .- xb' ) * b
147
+ Hb_b = inv .(xb .- xb' ) * b
148
+ c,d = Hb_a. args[1 ], Ha_b. args[1 ]
149
+ A,B,C,D = unitblocks (c \ Ha_a), unitblocks (c \ Hb_a), unitblocks (d \ Ha_b), unitblocks (d \ Hb_b)
150
+ PiecewiseInterlace (c,d) * BlockBroadcastArray {promote_type(eltype(H),eltype(S))} (hvcat, 2 , A, B, C, D)
151
+ end
140
152
141
153
# ##
142
154
# LogKernel
@@ -216,18 +228,28 @@ mutable struct HilbertVandermonde{T,MM} <: AbstractCachedMatrix{T}
216
228
M:: MM
217
229
data:: Matrix{T}
218
230
datasize:: NTuple{2,Int}
231
+ colsupport:: Vector{Int}
219
232
end
220
233
221
- HilbertVandermonde (M, data:: Matrix ) = HilbertVandermonde (M, data, size (data))
234
+ HilbertVandermonde (M, data:: Matrix ) = HilbertVandermonde (M, data, size (data), Int[] )
222
235
size (H:: HilbertVandermonde ) = (ℵ₀,ℵ₀)
236
+ function colsupport (H:: HilbertVandermonde , j)
237
+ resizedata! (H, H. datasize[1 ], maximum (j))
238
+ 1 : maximum (H. colsupport[j])
239
+ end
240
+
241
+ copy (H:: HilbertVandermonde ) = HilbertVandermonde (H. M, copy (H. data), H. datasize, H. colsupport)
223
242
224
243
function cache_filldata! (H:: HilbertVandermonde{T} , kr, jr) where T
225
244
n,m = H. datasize
226
- isempty (kr) && return
227
245
isempty (jr) && return
228
- H. data[(n+ 1 ): maximum (kr),1 : m] .= zero (T)
246
+ resize! (H. colsupport, max (length (H. colsupport), maximum (jr)))
247
+
248
+ isempty (kr) || (H. data[(n+ 1 ): maximum (kr),1 : m] .= zero (T))
229
249
for j in (m+ 1 ): maximum (jr)
230
- H. data[kr,j] .= (H. M * [H. data[:,j- 1 ]; Zeros {T} (∞)])[kr]
250
+ u = H. M * [H. data[:,j- 1 ]; Zeros {T} (∞)]
251
+ H. colsupport[j] = maximum (colsupport (u,1 ))
252
+ isempty (kr) || (H. data[kr,j] .= u[kr])
231
253
end
232
254
end
233
255
0 commit comments