|
80 | 80 |
|
81 | 81 | domain(P::PlusOperator) = commondomain(P.ops) |
82 | 82 |
|
83 | | -_extractops(A, ::Any) = SVector{1}(A) |
| 83 | +_extractops(A, ::Any) = [A] |
84 | 84 | _extractops(A::PlusOperator, ::typeof(+)) = A.ops |
85 | 85 |
|
86 | 86 | function +(A::Operator, B::Operator) |
@@ -281,6 +281,9 @@ struct TimesOperator{T,BW,SZ,O<:Operator{T},BBW,SBBW} <: Operator{T} |
281 | 281 | end |
282 | 282 | end |
283 | 283 |
|
| 284 | +operatortype(::T) where {T<:Operator} = T |
| 285 | +operatortype(::TimesOperator{<:Any,<:Any,<:Any,O}) where {O} = O |
| 286 | + |
284 | 287 | const PlusOrTimesOp = Union{PlusOperator,TimesOperator} |
285 | 288 |
|
286 | 289 | bandwidthssum(f, ops) = mapfoldl(f, (t1, t2) -> t1 .+ t2, ops, init=(0, 0)) |
|
351 | 354 | anytimesop = any(x -> x isa TimesOperator, ops) |
352 | 355 | TimesOperator(convert_vector(ops), bw, sz, bbw, sbbw, ibbb, irb, isaf; anytimesop) |
353 | 356 | end |
| 357 | +maybenarroweltype(::AbstractVector{Operator{T}}) where {T} = Operator{T} |
| 358 | +maybenarroweltype(opsin) = mapreduce(operatortype, promote_type, opsin) |
354 | 359 | function __promotetimes(opsin, dsp, anytimesop) |
355 | | - ops = Vector{Operator{promote_eltypeof(opsin)}}(undef, 0) |
| 360 | + ops = Vector{maybenarroweltype(opsin)}(undef, 0) |
356 | 361 | sizehint!(ops, length(opsin)) |
357 | 362 |
|
358 | 363 | for k in reverse(eachindex(opsin)) |
@@ -633,7 +638,7 @@ function A_mul_B(A::Operator, B::Operator; dspB=domainspace(B), rspA=rangespace( |
633 | 638 | elseif isconstop(B) |
634 | 639 | promotedomainspace(strictconvert(Number, B) * A, dspB) |
635 | 640 | else |
636 | | - promotetimes(collateops(*, A, B), dspB, false) |
| 641 | + promotetimes(collateops(*, A : rangespace(B), B), dspB, false) |
637 | 642 | end |
638 | 643 | end |
639 | 644 |
|
|
0 commit comments