@@ -54,13 +54,9 @@ function convert(::Type{Operator{T}},P::PlusOperator) where T
54
54
end
55
55
56
56
function promoteplus (opsin:: Vector{Operator{T}} ) where T
57
- ops= Vector {Operator{T}} ( )
57
+ ops = copy (opsin )
58
58
# prune zero ops
59
- for op in opsin
60
- if ! iszeroop (op)
61
- push! (ops,op)
62
- end
63
- end
59
+ filter! (! iszeroop, ops)
64
60
PlusOperator (promotespaces (ops))
65
61
end
66
62
@@ -72,16 +68,16 @@ domain(P::PlusOperator) = commondomain(P.ops)
72
68
73
69
74
70
+ (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])
76
72
+ (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])
78
74
+ (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])
80
76
+ (A:: PlusOperator ,B:: ZeroOperator ) = A
81
77
+ (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])
83
79
+ (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])
85
81
+ (A:: ZeroOperator ,B:: PlusOperator ) = B
86
82
+ (A:: Operator ,B:: Operator ) =
87
83
promoteplus (Operator{promote_type (eltype (A),eltype (B))}[A,B])
@@ -255,11 +251,11 @@ TimesOperator(ops::Vector{OT}) where {OT<:Operator} =
255
251
TimesOperator (convert (Vector{Operator{eltype (OT)}},ops),bandwidthssum (ops))
256
252
257
253
TimesOperator (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])
259
255
TimesOperator (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])
261
257
TimesOperator (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])
263
259
TimesOperator (A:: Operator ,B:: Operator ) =
264
260
TimesOperator (Operator{promote_type (eltype (A),eltype (B))}[A,B])
265
261
@@ -270,7 +266,7 @@ function convert(::Type{Operator{T}},P::TimesOperator) where T
270
266
if T== eltype (P)
271
267
P
272
268
else
273
- TimesOperator (Operator{T}[P. ops... ])
269
+ TimesOperator (Operator{T}[P. ops; ])
274
270
end
275
271
end
276
272
@@ -490,19 +486,19 @@ for OP in (:(adjoint),:(transpose))
490
486
end
491
487
492
488
* (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])
494
490
function * (A:: TimesOperator ,B:: Operator )
495
491
if isconstop (B)
496
492
promotedomainspace (convert (Number,B)* A,domainspace (B))
497
493
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])
499
495
end
500
496
end
501
497
function * (A:: Operator ,B:: TimesOperator )
502
498
if isconstop (A)
503
499
promoterangespace (convert (Number,A)* B,rangespace (A))
504
500
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])
506
502
end
507
503
end
508
504
function * (A:: Operator ,B:: Operator )
0 commit comments