From 6e5acc587ad08d1c6fe3de1c259f505e51b4c90f Mon Sep 17 00:00:00 2001 From: epapoutsellis Date: Tue, 23 Apr 2019 09:41:19 +0100 Subject: fix __init__ --- Wrappers/Python/ccpi/optimisation/operators/ZeroOperator.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Wrappers/Python') diff --git a/Wrappers/Python/ccpi/optimisation/operators/ZeroOperator.py b/Wrappers/Python/ccpi/optimisation/operators/ZeroOperator.py index d5fd8ae..8168f0b 100644 --- a/Wrappers/Python/ccpi/optimisation/operators/ZeroOperator.py +++ b/Wrappers/Python/ccpi/optimisation/operators/ZeroOperator.py @@ -13,25 +13,26 @@ from ccpi.optimisation.operators import LinearOperator class ZeroOperator(LinearOperator): def __init__(self, gm_domain, gm_range=None): + + super(ZeroOperator, self).__init__() self.gm_domain = gm_domain self.gm_range = gm_range if self.gm_range is None: self.gm_range = self.gm_domain - - super(ZeroOperator, self).__init__() + def direct(self,x,out=None): if out is None: return self.gm_range.allocate() else: - return self.gm_range.allocate() + out.fill(self.gm_range.allocate()) def adjoint(self,x, out=None): if out is None: return self.gm_domain.allocate() else: - return self.gm_domain.allocate() + out.fill(self.gm_domain.allocate()) def norm(self): return 0 -- cgit v1.2.3