Skip to content

Commit 83ab36d

Browse files
committed
fix addedoperator constructor to play nice with setbang
1 parent 6a4974e commit 83ab36d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/basic.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,17 +363,20 @@ struct AddedOperator{T,
363363
} <: AbstractSciMLOperator{T}
364364
ops::O
365365

366-
function AddedOperator(ops::AbstractSciMLOperator...)
367-
sz = size(first(ops))
368-
for op in ops[2:end]
369-
@assert size(op) == sz "Size mismatich in operators $ops"
370-
end
371-
366+
function AddedOperator(ops)
372367
T = promote_type(eltype.(ops)...)
373368
new{T,typeof(ops)}(ops)
374369
end
375370
end
376371

372+
function AddedOperator(ops::AbstractSciMLOperator...)
373+
sz = size(first(ops))
374+
for op in ops[2:end]
375+
@assert size(op) == sz "Size mismatich in operators $ops"
376+
end
377+
AddedOperator(ops)
378+
end
379+
377380
# constructors
378381
Base.:+(ops::AbstractSciMLOperator...) = AddedOperator(ops...)
379382
Base.:-(A::AbstractSciMLOperator, B::AbstractSciMLOperator) = AddedOperator(A, -B)

0 commit comments

Comments
 (0)