Commit 6adc2c0e authored by Russell Luke's avatar Russell Luke

Revert "Merge branch 'patch-6' into 'master'"

This reverts merge request !10
parent e9c3c268
from proxoperators import ProxOperator
import numpy as np
class P_SP(ProxOperator):
"""
Projection onto nonnegativity and 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_SP
Parameters
----------
u : array_like - function in the physical domain to be projected
Returns
-------
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