From 8e80fd44796073ebf716110c220a03b63028968e Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Mon, 18 Feb 2019 16:28:23 +0000 Subject: fix TomoIdentity with scalar --- Wrappers/Python/ccpi/optimisation/ops.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Wrappers/Python') diff --git a/Wrappers/Python/ccpi/optimisation/ops.py b/Wrappers/Python/ccpi/optimisation/ops.py index 3845621..a0e1713 100755 --- a/Wrappers/Python/ccpi/optimisation/ops.py +++ b/Wrappers/Python/ccpi/optimisation/ops.py @@ -98,20 +98,20 @@ class TomoIdentity(Operator): super(TomoIdentity, self).__init__() def direct(self,x,out=None): - if self.scalar != 1: - x *= self.scalar + if out is None: + if self.scalar != 1: + return x * self.scalar return x.copy() else: + if self.scalar != 1: + out.fill(x * self.scalar) + return out.fill(x) + return def adjoint(self,x, out=None): - if self.scalar != 1: - x *= self.scalar - if out is None: - return x.copy() - else: - out.fill(x) + return self.direct(x, out) def size(self): return NotImplemented -- cgit v1.2.3