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
c5ad5f40
Commit
c5ad5f40
authored
Sep 27, 2019
by
robin.requadt
Browse files
Upload New File
parent
a7d46f52
Changes
1
Hide whitespace changes
Inline
Side-by-side
TestSuite/testing_Algorithms/test_RRR.py
0 → 100644
View file @
c5ad5f40
import
numpy
as
np
import
unittest
from
proxtoolbox.Algorithms.RRR
import
*
from
proxtoolbox.ProxOperators.P_binary
import
*
from
proxtoolbox.ProxOperators.P_RN
import
*
from
proxtoolbox.ProxOperators.P_M
import
*
class
test_RRR
(
unittest
.
TestCase
):
def
test_RRR
(
self
):
config
=
{
'proxoperators'
:[
P_RN
,
P_M
],
'beta0'
:
2
,
'beta_max'
:
2
,
'beta_switch'
:
1
,
'prox_idx'
:
2
,
'iter'
:
10
,
'prox_idx'
:
2
,
'support_idx'
:
np
.
array
([
1
,
2
]),
'Nx'
:
8
,
'Ny'
:
0
,
'Nz'
:
0
,
'Prox'
:[
P_binary
,
P_RN
],
'norm_data'
:
1
,
'product_space_dimension'
:
5
,
'beta_0'
:
2
,
'M'
:
np
.
array
([
1
,
2
,
2
,
2
,
2
,
12
])}
self
.
pro
=
RRR
(
config
)
u
=
np
.
array
([
1
,
2
,
5
,
6
,
-
5
,
-
6
])
self
.
assertEqual
(
self
.
pro
.
evaluate
(
u
).
tolist
(),
np
.
array
([
-
2.93569806278751
+
3.0408182027976864j
,
-
1.1419114597009248
+
2.7029495135979418j
,
-
6.127136941692142
-
0.3378686891997414j
,
-
7.779020587713914
-
3.0408182027976864j
,
6.062835004479652
-
2.7029495135979418j
,
7.920932047414839
+
0.3378686891997414j
]).
tolist
())
if
__name__
==
'__main__'
:
unittest
.
main
()
#input:u=[1,2,5,6,-5,-6]
#output:[-2.9357+3.0408j,-1.1419+2.7029j,-6.1271-0.3379j, -7.7790-3.0408j,6.0628-2.7029j,7.9209+0.3379j]
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