Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jirka Fink
large_scale_optimization
Commits
6aa5b328
Commit
6aa5b328
authored
Oct 07, 2021
by
Jirka Fink
Browse files
1st assignment: Fixed running individual tests
parent
1bce6e2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
01-ilp_matching/matching_tests.py
View file @
6aa5b328
...
...
@@ -42,7 +42,7 @@ def evaluate(vertex_cnt, edge_cnt, is_bipartite, seed, optimal_weight, max_weigh
def
main
():
tests
=
{
"trivial"
:
(
10
,
15
,
False
,
2157
,
2453
,
1000
,
0
,
0.01
),
"general_sparse_unweighted"
:
(
1
00
,
2
00
,
False
,
45876
,
49
,
1
,
2
,
4
),
"general_sparse_unweighted"
:
(
5
00
,
10
00
,
False
,
45876
,
245
,
1
,
2
,
0.1
),
"bipartite_dense"
:
(
500
,
1000000
,
True
,
98754
,
249987
,
1000
,
2
,
10
),
"general_dense"
:
(
500
,
1000000
,
False
,
2134
,
249987
,
1000
,
2
,
20
),
"bipartite_sparse"
:
(
10000
,
30000
,
True
,
4578
,
3700952
,
1000
,
2
,
1.5
),
...
...
@@ -58,13 +58,13 @@ def main():
running_time
=
process_time
()
-
start_time
print
(
msg
)
print
()
results
.
add_row
([
name
,
points
,
vertices
,
edges
,
expected_time
,
running_time
,
msg
])
print
(
results
)
else
:
name
=
sys
.
argv
[
1
]
if
name
in
tests
:
status
,
msg
=
evaluate
(
*
tests
[
name
])
vertices
,
edges
,
bipartite
,
seed
,
optimal_weight
,
max_weight
,
points
,
expected_time
=
tests
[
name
]
status
,
msg
=
evaluate
(
vertices
,
edges
,
bipartite
,
seed
,
optimal_weight
,
max_weight
)
print
(
msg
)
else
:
print
(
"Unknown test"
,
name
)
...
...
Write
Preview
Supports
Markdown
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