Commit e69914c0 authored by Martin Reinecke's avatar Martin Reinecke

fixes

parent d07a537e
......@@ -45,7 +45,7 @@ class BlockDiagonalOperator(EndomorphicOperator):
if self._domain is not op._domain:
raise ValueError("domain mismatch")
res = {key : v1*v2 for key, v1, v2 in zip(self._domain.keys(), self._ops, op._ops)}
return BlockDiagonalOperator(res)
return BlockDiagonalOperator(self._domain, res)
def _combine_sum(self, op, selfneg, opneg):
from ..operators.sum_operator import SumOperator
......@@ -54,4 +54,4 @@ class BlockDiagonalOperator(EndomorphicOperator):
res = {}
for key, v1, v2 in zip(self._domain.keys(), self._ops, op._ops):
res[key] = SumOperator.make([v1, v2], [selfneg, opneg])
return BlockDiagonalOperator(res)
return BlockDiagonalOperator(self._domain, res)
......@@ -39,8 +39,8 @@ class Test_Functionality(unittest.TestCase):
assert_equal(val.local_data, f2[key].local_data)
def test_blockdiagonal(self):
op = ift.BlockDiagonalOperator({"d1":
ift.ScalingOperator(20., dom["d1"])})
op = ift.BlockDiagonalOperator(
dom, {"d1": ift.ScalingOperator(20., dom["d1"])})
op2 = op*op
ift.extra.consistency_check(op2)
assert_equal(type(op2), ift.BlockDiagonalOperator)
......
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