Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nam
ProxPython
Commits
f77a22f8
Commit
f77a22f8
authored
Mar 13, 2019
by
robin.requadt
Browse files
Upload New File: P_amp.py
parent
cb0297bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
proxtoolbox/ProxOperators/P_amp.py
0 → 100644
View file @
f77a22f8
from
proxoperators
import
ProxOperator
import
numpy
as
np
class
P_amp
(
ProxOperator
):
"""
Projection onto amplitude constraints
"""
def
__init__
(
self
,
config
):
"""
Initialization
Parameters
----------
config : dict - Dictionary containing the problem configuration. It must contain the following mapping:
'amplitude' : array_like - nonnegative array
"""
self
.
amplitude
=
config
[
'amplitude'
]
def
work
(
self
,
u
):
"""
Evaluates Magproj (Projection operator onto a magnitude constraint) with arguments u and the amplitude constraints
Parameters
----------
u : array_like - complex-valued array to be projected onto the amplitude constraints
Returns
-------
array_like - the Projection
"""
a
=
self
.
amplitude
return
eval
(
'magproj(u,a)'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment