@@ -240,7 +240,7 @@ function splice_times(ops)
240
240
newops
241
241
end
242
242
243
- struct TimesOperator{T,BW,SZ,O<: Operator{T} ,BBW,SBBW} <: Operator{T}
243
+ struct TimesOperator{T,BW,SZ,O<: Operator{T} ,BBW,SBBW,D } <: Operator{T}
244
244
ops:: Vector{O}
245
245
bandwidths:: BW
246
246
sz:: SZ
@@ -249,19 +249,21 @@ struct TimesOperator{T,BW,SZ,O<:Operator{T},BBW,SBBW} <: Operator{T}
249
249
isbandedblockbanded:: Bool
250
250
israggedbelow:: Bool
251
251
isafunctional:: Bool
252
+ domainspace:: D
252
253
253
254
Base. @constprop :aggressive function TimesOperator {T,BW,SZ,O,BBW,SBBW} (ops:: Vector{O} , bw:: BW ,
254
255
sz:: SZ , bbw:: BBW , sbbw:: SBBW ,
255
- ibbb:: Bool , irb:: Bool , isaf:: Bool ;
256
- anytimesop = any (x -> x isa TimesOperator, ops)) where {T,O<: Operator{T} ,BW,SZ,BBW,SBBW}
256
+ ibbb:: Bool , irb:: Bool , isaf:: Bool , dsp :: D ;
257
+ anytimesop = any (x -> x isa TimesOperator, ops)) where {T,O<: Operator{T} ,BW,SZ,BBW,SBBW,D }
257
258
259
+ dsp == domainspace (ops[end ]) || throw (ArgumentError (" incompatible domainspace" ))
258
260
# check compatible
259
261
check_times (ops)
260
262
261
263
# remove TimesOperators buried inside ops
262
264
newops = anytimesop ? splice_times (ops) : ops
263
265
264
- new {T,BW,SZ,O,BBW,SBBW} (newops, bw, sz, bbw, sbbw, ibbb, irb, isaf)
266
+ new {T,BW,SZ,O,BBW,SBBW,D } (newops, bw, sz, bbw, sbbw, ibbb, irb, isaf, dsp )
265
267
end
266
268
end
267
269
@@ -280,11 +282,12 @@ function TimesOperator(ops::AbstractVector{O},
280
282
sbbw:: Tuple{Any,Any} = bandwidthssum (subblockbandwidths, ops),
281
283
ibbb:: Bool = all (isbandedblockbanded, ops),
282
284
irb:: Bool = all (israggedbelow, ops),
283
- isaf:: Bool = sz[1 ] == 1 && isconstspace (rangespace (first (ops)));
285
+ isaf:: Bool = sz[1 ] == 1 && isconstspace (rangespace (first (ops))),
286
+ dsp = domainspace (last (ops));
284
287
anytimesop = any (x -> x isa TimesOperator, ops),
285
288
) where {O<: Operator }
286
289
TimesOperator {eltype(O),typeof(bw),typeof(sz),O,typeof(bbw),typeof(sbbw)} (
287
- convert_vector (ops), bw, sz, bbw, sbbw, ibbb, irb, isaf; anytimesop)
290
+ convert_vector (ops), bw, sz, bbw, sbbw, ibbb, irb, isaf, dsp ; anytimesop)
288
291
end
289
292
290
293
_extractops (A:: TimesOperator , :: typeof (* )) = A. ops
@@ -300,8 +303,9 @@ function TimesOperator(A::Operator, Bs::Operator...)
300
303
bwsum = bandwidthssum (bandwidths, ops)
301
304
bbwsum = bandwidthssum (blockbandwidths, ops)
302
305
subbbwsum = bandwidthssum (subblockbandwidths, ops)
306
+ dsp = domainspace (last (ops))
303
307
TimesOperator (convert_vector (v), bwsum, sz,
304
- bbwsum, subbbwsum, ibbb, irb, isaf;
308
+ bbwsum, subbbwsum, ibbb, irb, isaf, dsp ;
305
309
anytimesop)
306
310
end
307
311
@@ -317,7 +321,8 @@ function convert(::Type{Operator{T}}, P::TimesOperator) where {T}
317
321
_convertops (Operator{T}, ops),
318
322
bandwidths (P), size (P), blockbandwidths (P),
319
323
subblockbandwidths (P), isbandedblockbanded (P),
320
- israggedbelow (P), P. isafunctional, anytimesop = false ):: Operator{T}
324
+ israggedbelow (P), P. isafunctional, domainspace (P),
325
+ anytimesop = false ):: Operator{T}
321
326
end
322
327
end
323
328
@@ -330,7 +335,7 @@ Base.@constprop :aggressive function promotetimes(opsin,
330
335
sz = _timessize (ops)
331
336
isaf = sz[1 ] == 1 && isconstspace (rangespace (first (ops)))
332
337
anytimesop = any (x -> x isa TimesOperator, ops)
333
- TimesOperator (convert_vector (ops), bw, sz, bbw, sbbw, ibbb, irb, isaf; anytimesop)
338
+ TimesOperator (convert_vector (ops), bw, sz, bbw, sbbw, ibbb, irb, isaf, dsp ; anytimesop)
334
339
end
335
340
maybenarroweltype (:: AbstractVector{Operator{T}} ) where {T} = Operator{T}
336
341
maybenarroweltype (opsin) = mapreduce (operatortype, promote_type, opsin)
384
389
end
385
390
end
386
391
387
- domainspace (P:: PlusOrTimesOp ) = domainspace (last (P. ops))
392
+ domainspace (P:: PlusOperator ) = domainspace (last (P. ops))
393
+ domainspace (T:: TimesOperator ) = T. domainspace
388
394
rangespace (P:: PlusOrTimesOp ) = rangespace (first (P. ops))
389
395
390
396
domain (P:: TimesOperator ) = commondomain (P. ops)
0 commit comments