Skip to content
Snippets Groups Projects
Commit 23b0ed81 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

bug fix

parent 039a629a
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment