6666
6767domain (P:: PlusOperator ) = commondomain (P. ops)
6868
69+ _promote_eltypeof (As... ) = _promote_eltypeof (As)
70+ _promote_eltypeof (As:: Union{Vector, Tuple} ) = mapreduce (eltype, promote_type, As)
6971
7072+ (A:: PlusOperator ,B:: PlusOperator ) =
71- promoteplus (Operator{promote_type ( eltype (A), eltype (B) )}[A. ops; B. ops])
73+ promoteplus (Operator{_promote_eltypeof (A,B )}[A. ops; B. ops])
7274+ (A:: PlusOperator ,B:: PlusOperator ,C:: PlusOperator ) =
73- promoteplus (Operator{promote_type ( eltype (A), eltype (B), eltype (C) )}[A. ops; B. ops; C. ops])
75+ promoteplus (Operator{_promote_eltypeof (A,B,C )}[A. ops; B. ops; C. ops])
7476+ (A:: PlusOperator ,B:: Operator ) =
75- promoteplus (Operator{promote_type ( eltype (A), eltype (B) )}[A. ops; B])
77+ promoteplus (Operator{_promote_eltypeof (A,B )}[A. ops; B])
7678+ (A:: PlusOperator ,B:: ZeroOperator ) = A
7779+ (A:: PlusOperator ,B:: Operator ,C:: Operator ) =
78- promoteplus (Operator{promote_type ( eltype (A), eltype (B), eltype (C) )}[A. ops; B; C])
80+ promoteplus (Operator{_promote_eltypeof (A,B,C )}[A. ops; B; C])
7981+ (A:: Operator ,B:: PlusOperator ) =
80- promoteplus (Operator{promote_type ( eltype (A), eltype (B) )}[A; B. ops])
82+ promoteplus (Operator{_promote_eltypeof (A,B )}[A; B. ops])
8183+ (A:: ZeroOperator ,B:: PlusOperator ) = B
8284+ (A:: Operator ,B:: Operator ) =
83- promoteplus (Operator{promote_type ( eltype (A), eltype (B) )}[A,B])
85+ promoteplus (Operator{_promote_eltypeof (A,B )}[A,B])
8486+ (A:: Operator ,B:: Operator ,C:: Operator ) =
85- promoteplus (Operator{promote_type ( eltype (A), eltype (B), eltype (C) )}[A,B,C])
87+ promoteplus (Operator{_promote_eltypeof (A,B,C )}[A,B,C])
8688
8789
8890
143145for OP in (:+ ,:- )
144146 @eval begin
145147 $ OP (c:: Union{UniformScaling,Number} ,A:: Operator ) =
146- $ OP (convert (Operator{promote_type ( eltype (A), eltype (c) )},c),A)
148+ $ OP (convert (Operator{_promote_eltypeof (A, c )},c),A)
147149 $ OP (A:: Operator ,c:: Union{UniformScaling,Number} ) =
148- $ OP (A,convert (Operator{promote_type ( eltype (A), eltype (c) )},c))
150+ $ OP (A,convert (Operator{_promote_eltypeof (A, c )},c))
149151 end
150152end
151153
@@ -256,13 +258,13 @@ TimesOperator(ops::Vector{OT}) where {OT<:Operator} =
256258 TimesOperator (convert (Vector{Operator{eltype (OT)}},ops),bandwidthssum (ops))
257259
258260TimesOperator (A:: TimesOperator ,B:: TimesOperator ) =
259- TimesOperator (Operator{promote_type ( eltype (A), eltype (B) )}[A. ops; B. ops], _bandwidthssum (A, B))
261+ TimesOperator (Operator{_promote_eltypeof (A,B )}[A. ops; B. ops], _bandwidthssum (A, B))
260262TimesOperator (A:: TimesOperator ,B:: Operator ) =
261- TimesOperator (Operator{promote_type ( eltype (A), eltype (B) )}[A. ops; B], _bandwidthssum (A, B))
263+ TimesOperator (Operator{_promote_eltypeof (A,B )}[A. ops; B], _bandwidthssum (A, B))
262264TimesOperator (A:: Operator ,B:: TimesOperator ) =
263- TimesOperator (Operator{promote_type ( eltype (A), eltype (B) )}[A; B. ops], _bandwidthssum (A, B))
265+ TimesOperator (Operator{_promote_eltypeof (A,B )}[A; B. ops], _bandwidthssum (A, B))
264266TimesOperator (A:: Operator ,B:: Operator ) =
265- TimesOperator (Operator{promote_type ( eltype (A), eltype (B) )}[A,B], _bandwidthssum (A, B))
267+ TimesOperator (Operator{_promote_eltypeof (A,B )}[A,B], _bandwidthssum (A, B))
266268
267269
268270== (A:: TimesOperator ,B:: TimesOperator )= A. ops== B. ops
278280
279281
280282function promotetimes (opsin:: Vector{B} ,dsp) where B<: Operator
281- ops= Vector {Operator{mapreduce(eltype,promote_type, opsin)}} (undef,0 )
283+ ops= Vector {Operator{_promote_eltypeof( opsin)}} (undef,0 )
282284
283285 for k= length (opsin): - 1 : 1
284286 if ! isa (opsin[k],Conversion)
@@ -491,19 +493,19 @@ for OP in (:(adjoint),:(transpose))
491493end
492494
493495* (A:: TimesOperator ,B:: TimesOperator ) =
494- promotetimes (Operator{promote_type ( eltype (A), eltype (B) )}[A. ops; B. ops])
496+ promotetimes (Operator{_promote_eltypeof (A, B )}[A. ops; B. ops])
495497function * (A:: TimesOperator ,B:: Operator )
496498 if isconstop (B)
497499 promotedomainspace (convert (Number,B)* A,domainspace (B))
498500 else
499- promotetimes (Operator{promote_type ( eltype (A), eltype (B) )}[A. ops; B])
501+ promotetimes (Operator{_promote_eltypeof (A, B )}[A. ops; B])
500502 end
501503end
502504function * (A:: Operator ,B:: TimesOperator )
503505 if isconstop (A)
504506 promoterangespace (convert (Number,A)* B,rangespace (A))
505507 else
506- promotetimes (Operator{promote_type ( eltype (A), eltype (B) )}[A; B. ops])
508+ promotetimes (Operator{_promote_eltypeof (A, B )}[A; B. ops])
507509 end
508510end
509511function * (A:: Operator ,B:: Operator )
@@ -512,7 +514,7 @@ function *(A::Operator,B::Operator)
512514 elseif isconstop (B)
513515 promotedomainspace (convert (Number,B)* A,domainspace (B))
514516 else
515- promotetimes (Operator{promote_type ( eltype (A), eltype (B) )}[A,B])
517+ promotetimes (Operator{_promote_eltypeof (A, B )}[A,B])
516518 end
517519end
518520
@@ -612,7 +614,7 @@ function promotedomainspace(P::PlusOperator{T},sp::Space,cursp::Space) where T
612614 P
613615 else
614616 ops = [promotedomainspace (op,sp) for op in P. ops]
615- promoteplus (Vector {Operator{mapreduce(eltype,promote_type, ops)}} (ops))
617+ promoteplus (Vector {Operator{_promote_eltypeof( ops)}} (ops))
616618 end
617619end
618620
0 commit comments