Skip to content

Commit 72299f2

Browse files
authored
Pass eltype to PlusOperator (#270)
1 parent 67978db commit 72299f2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Operators/general/algebra.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ function PlusOperator(opsin::Vector{O},
2525
) where {O<:Operator}
2626
PlusOperator{eltype(O),typeof(bi),typeof(sz),O}(opsin,bi,sz)
2727
end
28+
function PlusOperator{ET}(opsin::Vector{O},
29+
bi::Tuple{Any,Any} = bandwidthsmax(opsin),
30+
sz::Tuple{Any,Any} = size(first(opsin)),
31+
) where {ET,O<:Operator{ET}}
32+
PlusOperator{ET,typeof(bi),typeof(sz),O}(opsin,bi,sz)
33+
end
2834

2935
bandwidths(P::PlusOperator) = P.bandwidths
3036

@@ -54,8 +60,9 @@ end
5460

5561
function promoteplus(opsin, sz = size(first(opsin)))
5662
ops = filter(!iszeroop, opsin)
63+
ET = _promote_eltypeof(opsin)
5764
v = promotespaces(ops)
58-
PlusOperator(convert_vector(v), bandwidthsmax(v), sz)
65+
PlusOperator{ET}(convert_vector(v), bandwidthsmax(v), sz)
5966
end
6067

6168
for OP in (:domainspace,:rangespace)

0 commit comments

Comments
 (0)