Commit 0fbfec7b authored by robin.requadt's avatar robin.requadt
Browse files

Upload New File

parent cb0297bc
from proxoperators import ProxOperator
import numpy as np
class P_S(ProxOperator):
Projection onto support constraints
def __init__(self,config):
config : dict - Dictionary containing the problem configuration. It must contain the following mapping:
'support :idx' : array_like - a vector of indeces of the nonzero elements of the array.
self.n = config['support_idx']
def work(self,u):
Applies the proxoperator P_S
u : array_like - array to be projected
p_S : array_like - the Projection
n = self.n
p_S= np.zeros(u.shape,dtype=u.dtype)
for x in n:
p_S[x] = u[x]
return p_S
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