Commit 23b0ed81 authored by Martin Reinecke's avatar Martin Reinecke

bug fix

parent 039a629a
Pipeline #29525 passed with stages
in 11 minutes and 47 seconds
......@@ -64,7 +64,7 @@ class ChainOperator(LinearOperator):
opsnew[i] = opsnew[i]._scale(fct)
fct = 1.
break
if fct != 1:
if fct != 1 or len(opsnew) == 0:
# have to add the scaling operator at the end
opsnew.append(ScalingOperator(fct, lastdom))
ops = opsnew
......@@ -83,6 +83,8 @@ class ChainOperator(LinearOperator):
@staticmethod
def make(ops):
ops = tuple(ops)
if len(ops) == 0:
raise ValueError("ops is empty")
ops = ChainOperator.simplify(ops)
if len(ops) == 1:
return ops[0]
......
......@@ -108,6 +108,8 @@ class SumOperator(LinearOperator):
def make(ops, neg):
ops = tuple(ops)
neg = tuple(neg)
if len(ops) == 0:
raise ValueError("ops is empty")
if len(ops) != len(neg):
raise ValueError("length mismatch between ops and neg")
ops, neg = SumOperator.simplify(ops, neg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment