Skip to content

Commit

Permalink
update Norm2sq for SIRF compatibility (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
paskino authored Mar 15, 2019
1 parent 03ad730 commit 9f1eb50
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Wrappers/Python/ccpi/optimisation/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,13 @@ def __call__(self,x):
#else:
y = self.A.direct(x)
y.__isub__(self.b)
y.__imul__(y)
return y.sum() * self.c
#y.__imul__(y)
#return y.sum() * self.c
try:
return y.squared_norm() * self.c
except AttributeError as ae:
# added for compatibility with SIRF
return (y.norm()**2) * self.c

def gradient(self, x, out = None):
if self.memopt:
Expand Down

0 comments on commit 9f1eb50

Please sign in to comment.