Commit 5dddf49f authored by alexander.dornheim's avatar alexander.dornheim
Browse files

Modified ProxOperators for alternating projections, s.t. iteration counter...

Modified ProxOperators for alternating projections, s.t. iteration counter works with diagnostic switch
parent 12a22454
......@@ -65,7 +65,6 @@ class SimpleAlgorithm:
config = self.config
normM = self.normM
beta = self.beta_0
iter = self.iter
if u.ndim < 3:
p = 1
......
......@@ -501,17 +501,16 @@ class P_sequential_hyperplane_odd(ProxOperator):
self.m = config['A'].shape[0]
self.A = config['A']
self.b = config['b']
self.iter = config['iter']
self.config = config #this is not a copy
def work(self,u):
K=np.mod(2*self.iter,self.m)+1
K=np.mod(2*self.config['iter'],self.m)+1
a=self.A[K,:]
a=a.reshape((1,a.size)) #numpy doesn't differentiate between row and colum vectors for 1D
aaT=(a @ a.T)+1e-20
b=self.b[K]/aaT
v=a @ u /aaT;
v=u+a.T@(b-v);
self.iter = self.iter +1
return v
class P_sequential_hyperplane_even(ProxOperator):
......@@ -520,17 +519,17 @@ class P_sequential_hyperplane_even(ProxOperator):
self.m = config['A'].shape[0]
self.A = config['A']
self.b = config['b']
self.iter = config['iter']
self.config = config #this is not a copy
def work(self,u):
K=np.mod(2*self.iter,self.m)+1
print(self.config['iter'])
K=np.mod(2*self.config['iter'],self.m)+1
a=self.A[K,:]
a=a.reshape((1,a.size)) #numpy doesn't differentiate between row and colum vectors for 1D
aaT=(a @ a.T)+1e-20
b=self.b[K]/aaT
v=a @ u /aaT;
v=u+a.T@(b-v);
self.iter = self.iter +1
return v
# hyperplane projection subroutine of the
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment