From 76f88d25572ce80057552fe05fc78ec621e98adf Mon Sep 17 00:00:00 2001 From: epapoutsellis Date: Wed, 10 Apr 2019 11:33:31 +0100 Subject: wip for with and without operators, functions --- Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'Wrappers/Python') diff --git a/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py b/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py index 3b81d98..0d479ee 100644 --- a/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py +++ b/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py @@ -141,21 +141,25 @@ def PDHG_old(f, g, operator, tau = None, sigma = None, opt = None, **kwargs): else: -# operator.direct(xbar, out = y_tmp) + operator.direct(xbar, out = y_tmp) + + y_tmp.multiply(sigma, out = y_tmp) + y_tmp.add(y_old, out = y_tmp) # y_tmp.__imul__(sigma) # y_tmp.__iadd__(y_old) # y_tmp *= sigma # y_tmp += y_old - y_tmp = y_old + sigma * operator.direct(xbar) +# y_tmp = y_old + sigma * operator.direct(xbar) f.proximal_conjugate(y_tmp, sigma, out=y) - x_tmp = x_old - tau * operator.adjoint(y) +# x_tmp = x_old - tau * operator.adjoint(y) + + operator.adjoint(y, out = x_tmp) + x_tmp.multiply(-tau, out = x_tmp) + x_tmp.add(x_old, out = x_tmp) -# operator.adjoint(y, out = x_tmp) -# z = x_tmp -# x_tmp = x_old - tau * z # x_tmp *= -tau # x_tmp += x_old @@ -166,7 +170,8 @@ def PDHG_old(f, g, operator, tau = None, sigma = None, opt = None, **kwargs): xbar *= theta xbar += x - + x_old.fill(x) + y_old.fill(y) # pass # -- cgit v1.2.3