Commit 866d1380 authored by jansen31's avatar jansen31
Browse files

work towards sparsity in higher dimensions (not point but line)

parent d091e36d
import numpy as np import numpy as np
from .proxoperators import ProxOperator from .proxoperators import ProxOperator
class P_S_real(ProxOperator): class P_S_real(ProxOperator):
""" """
Projection subroutine for projecting onto support constraints Projection subroutine for projecting onto support constraints
""" """
def __init__(self,config): def __init__(self, config):
""" """
Initialization Initialization
...@@ -17,7 +18,7 @@ class P_S_real(ProxOperator): ...@@ -17,7 +18,7 @@ class P_S_real(ProxOperator):
""" """
self.support_idx = config['support_idx'] self.support_idx = config['support_idx']
def work(self,u): def work(self, u):
""" """
Parameters Parameters
---------- ----------
...@@ -27,11 +28,7 @@ class P_S_real(ProxOperator): ...@@ -27,11 +28,7 @@ class P_S_real(ProxOperator):
------- -------
p_S : array_like - the projection p_S : array_like - the projection
""" """
support_idx = self.support_idx -1 support_idx = self.support_idx - 1
p_S = np.zeros(u.shape, dtype=u.dtype) p_S = np.zeros(u.shape, dtype=u.dtype)
p_S[support_idx] = np.real(u[support_idx]) p_S[support_idx] = np.real(u[support_idx])
return p_S 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