summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2019-02-18 16:28:23 +0000
committerEdoardo Pasca <edo.paskino@gmail.com>2019-02-18 16:28:23 +0000
commit8e80fd44796073ebf716110c220a03b63028968e (patch)
tree09fa2bde1b0c91b3ad6845ad47ed2cdcde15fb23 /Wrappers/Python
parent965d78b4a3dd43c89eedae732f1caa1d569a0066 (diff)
downloadframework-8e80fd44796073ebf716110c220a03b63028968e.tar.gz
framework-8e80fd44796073ebf716110c220a03b63028968e.tar.bz2
framework-8e80fd44796073ebf716110c220a03b63028968e.tar.xz
framework-8e80fd44796073ebf716110c220a03b63028968e.zip
fix TomoIdentity with scalar
Diffstat (limited to 'Wrappers/Python')
-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