summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xWrappers/Python/ccpi/optimisation/ops.py16
1 files changed, 8 insertions, 8 deletions
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