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

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):
"""
Initialization
Parameters
----------
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
Parameters
----------
u : array_like - array to be projected
Returns
-------
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
Markdown is supported
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