Commit 3c0bd41c authored by robin.requadt's avatar robin.requadt

Upload New File

parent cb0297bc
from proxoperators import ProxOperator
import numpy as np
class P_SP(ProxOperator):
Projection onto nonnegativity and 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_SP
u : array_like - function in the physical domain to be projected
p_SP : array_like - the projection IN THE PHYSICAL (time) DOMAIN
n = self.n
p_SP = np.zeros(u.shape,dtype=u.dtype)
for x in n:
p_SP[x] = eval('max((u[x]).real,0)')
return p_SP
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