From 2d09420d881427f96ed951f6a020b1980fc1860f Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Thu, 18 Oct 2018 17:05:44 +0100 Subject: removed default behaviour of Function as Identity (#155) addresses this loophole https://github.com/CCPPETMR/Hackathon-SIRF/issues/12#issuecomment-430944064 --- Wrappers/Python/ccpi/optimisation/funcs.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Wrappers/Python') diff --git a/Wrappers/Python/ccpi/optimisation/funcs.py b/Wrappers/Python/ccpi/optimisation/funcs.py index 490d742..c105236 100755 --- a/Wrappers/Python/ccpi/optimisation/funcs.py +++ b/Wrappers/Python/ccpi/optimisation/funcs.py @@ -38,12 +38,12 @@ def isSizeCorrect(data1 ,data2): class Function(object): def __init__(self): - self.op = Identity() - def __call__(self,x, out=None): return 0 - def grad(self, x): return 0 - def prox(self, x, tau): return x - def gradient(self, x, out=None): return self.grad(x) - def proximal(self, x, tau, out=None): return self.prox(x, tau) + pass + def __call__(self,x, out=None): raise NotImplementedError + def grad(self, x): raise NotImplementedError + def prox(self, x, tau): raise NotImplementedError + def gradient(self, x, out=None): raise NotImplementedError + def proximal(self, x, tau, out=None): raise NotImplementedError class Norm2(Function): -- cgit v1.2.3