Commit 96112c76 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_Amod(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 - indeces of the nonzero elements in the object domain
"""
self.n = config['support_idx']
def work(self,u):
"""
the projection IN THE PHYSICAL (time) DOMAIN, leaves the phase alone on the support, resets amplitude to 1 and sets amplitude to 1 with 0 phase outside support.
Parameters
----------
u : array_like - function in the physical domain to be projected
Returns
-------
p_A : array_like - Projection
"""
n = self.n
p_A= np.ones(u.shape,dtype=u.dtype)
for x in n:
p_A[x] = u[x]/abs(u[x])
return p_A
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