diff options
Diffstat (limited to 'Wrappers/Python')
-rw-r--r-- | Wrappers/Python/ccpi/optimisation/operators/ZeroOperator.py | 9 |
1 files changed, 5 insertions, 4 deletions
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 |