Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
nam
ProxPython
Commits
866d1380
Commit
866d1380
authored
Apr 03, 2020
by
jansen31
Browse files
work towards sparsity in higher dimensions (not point but line)
parent
d091e36d
Changes
1
Hide whitespace changes
Inline
Side-by-side
proxtoolbox/ProxOperators/P_S_real.py
View file @
866d1380
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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