diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2019-02-18 16:28:23 +0000 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2019-02-18 16:28:23 +0000 |
commit | 8e80fd44796073ebf716110c220a03b63028968e (patch) | |
tree | 09fa2bde1b0c91b3ad6845ad47ed2cdcde15fb23 /Wrappers/Python | |
parent | 965d78b4a3dd43c89eedae732f1caa1d569a0066 (diff) | |
download | framework-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-x | Wrappers/Python/ccpi/optimisation/ops.py | 16 |
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 |