@@ -54,13 +54,9 @@ function convert(::Type{Operator{T}},P::PlusOperator) where T
5454end
5555
5656function promoteplus (opsin:: Vector{Operator{T}} ) where T
57- ops= Vector {Operator{T}} ( )
57+ ops = copy (opsin )
5858 # prune zero ops
59- for op in opsin
60- if ! iszeroop (op)
61- push! (ops,op)
62- end
63- end
59+ filter! (! iszeroop, ops)
6460 PlusOperator (promotespaces (ops))
6561end
6662
@@ -72,16 +68,16 @@ domain(P::PlusOperator) = commondomain(P.ops)
7268
7369
7470+ (A:: PlusOperator ,B:: PlusOperator ) =
75- promoteplus (Operator{promote_type (eltype (A),eltype (B))}[A. ops... , B. ops... ])
71+ promoteplus (Operator{promote_type (eltype (A),eltype (B))}[A. ops; B. ops])
7672+ (A:: PlusOperator ,B:: PlusOperator ,C:: PlusOperator ) =
77- promoteplus (Operator{promote_type (eltype (A),eltype (B),eltype (C))}[A. ops... , B. ops... , C. ops... ])
73+ promoteplus (Operator{promote_type (eltype (A),eltype (B),eltype (C))}[A. ops; B. ops; C. ops])
7874+ (A:: PlusOperator ,B:: Operator ) =
79- promoteplus (Operator{promote_type (eltype (A),eltype (B))}[A. ops... , B])
75+ promoteplus (Operator{promote_type (eltype (A),eltype (B))}[A. ops; B])
8076+ (A:: PlusOperator ,B:: ZeroOperator ) = A
8177+ (A:: PlusOperator ,B:: Operator ,C:: Operator ) =
82- promoteplus (Operator{promote_type (eltype (A),eltype (B),eltype (C))}[A. ops... ,B, C])
78+ promoteplus (Operator{promote_type (eltype (A),eltype (B),eltype (C))}[A. ops; B; C])
8379+ (A:: Operator ,B:: PlusOperator ) =
84- promoteplus (Operator{promote_type (eltype (A),eltype (B))}[A, B. ops... ])
80+ promoteplus (Operator{promote_type (eltype (A),eltype (B))}[A; B. ops])
8581+ (A:: ZeroOperator ,B:: PlusOperator ) = B
8682+ (A:: Operator ,B:: Operator ) =
8783 promoteplus (Operator{promote_type (eltype (A),eltype (B))}[A,B])
@@ -255,11 +251,11 @@ TimesOperator(ops::Vector{OT}) where {OT<:Operator} =
255251 TimesOperator (convert (Vector{Operator{eltype (OT)}},ops),bandwidthssum (ops))
256252
257253TimesOperator (A:: TimesOperator ,B:: TimesOperator ) =
258- TimesOperator (Operator{promote_type (eltype (A),eltype (B))}[A. ops... , B. ops... ])
254+ TimesOperator (Operator{promote_type (eltype (A),eltype (B))}[A. ops; B. ops])
259255TimesOperator (A:: TimesOperator ,B:: Operator ) =
260- TimesOperator (Operator{promote_type (eltype (A),eltype (B))}[A. ops... , B])
256+ TimesOperator (Operator{promote_type (eltype (A),eltype (B))}[A. ops; B])
261257TimesOperator (A:: Operator ,B:: TimesOperator ) =
262- TimesOperator (Operator{promote_type (eltype (A),eltype (B))}[A, B. ops... ])
258+ TimesOperator (Operator{promote_type (eltype (A),eltype (B))}[A; B. ops])
263259TimesOperator (A:: Operator ,B:: Operator ) =
264260 TimesOperator (Operator{promote_type (eltype (A),eltype (B))}[A,B])
265261
@@ -270,7 +266,7 @@ function convert(::Type{Operator{T}},P::TimesOperator) where T
270266 if T== eltype (P)
271267 P
272268 else
273- TimesOperator (Operator{T}[P. ops... ])
269+ TimesOperator (Operator{T}[P. ops; ])
274270 end
275271end
276272
@@ -490,19 +486,19 @@ for OP in (:(adjoint),:(transpose))
490486end
491487
492488* (A:: TimesOperator ,B:: TimesOperator ) =
493- promotetimes (Operator{promote_type (eltype (A),eltype (B))}[A. ops... , B. ops... ])
489+ promotetimes (Operator{promote_type (eltype (A),eltype (B))}[A. ops; B. ops])
494490function * (A:: TimesOperator ,B:: Operator )
495491 if isconstop (B)
496492 promotedomainspace (convert (Number,B)* A,domainspace (B))
497493 else
498- promotetimes (Operator{promote_type (eltype (A),eltype (B))}[A. ops... , B])
494+ promotetimes (Operator{promote_type (eltype (A),eltype (B))}[A. ops; B])
499495 end
500496end
501497function * (A:: Operator ,B:: TimesOperator )
502498 if isconstop (A)
503499 promoterangespace (convert (Number,A)* B,rangespace (A))
504500 else
505- promotetimes (Operator{promote_type (eltype (A),eltype (B))}[A, B. ops... ])
501+ promotetimes (Operator{promote_type (eltype (A),eltype (B))}[A; B. ops])
506502 end
507503end
508504function * (A:: Operator ,B:: Operator )
0 commit comments