Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdc-counting
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Radek Hušek
cdc-counting
Commits
923e2c4d
Commit
923e2c4d
authored
5 years ago
by
Radek Hušek
Browse files
Options
Downloads
Patches
Plain Diff
improve count_cdc.py
parent
01d06d80
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
count_cdc.py
+14
-6
14 additions, 6 deletions
count_cdc.py
test_graphs.py
+0
-17
0 additions, 17 deletions
test_graphs.py
with
14 additions
and
23 deletions
count_cdc.py
+
14
−
6
View file @
923e2c4d
#!/usr/bin/python
from
sys
import
stdin
import
sys
import
os
from
flower_snarks
import
*
from
sage.all
import
Graph
from
flower_snarks
import
count_cdc_naive
from
parmap
import
parmap
for
l
in
stdin
:
G
=
Graph
(
l
)
cdc
,
hyp
=
count_cdc_naive
(
G
)
print
(
"
%-20i %s
"
%
(
cdc
,
""
if
cdc
>=
hyp
else
"
FAIL
"
))
def
process
(
g6
):
g6
=
g6
.
rstrip
()
ret
=
count_cdc_naive
(
Graph
(
g6
))
return
"
%s %s %s
"
%
(
g6
,
ret
,
ret
[
0
]
>=
ret
[
1
])
inp
=
[
l
for
l
in
sys
.
stdin
]
nprocs
=
int
(
os
.
getenv
(
"
NPROCS
"
,
"
0
"
))
or
None
for
ret
in
parmap
(
process
,
inp
,
nprocs
=
nprocs
,
in_order
=
False
):
print
(
ret
)
This diff is collapsed.
Click to expand it.
test_graphs.py
deleted
100755 → 0
+
0
−
17
View file @
01d06d80
#!/usr/bin/python
import
sys
from
flower_snarks
import
*
from
sage.all
import
Graph
from
parmap
import
parmap
def
process
(
g6
):
g6
=
g6
.
rstrip
()
ret
=
count_cdc_naive
(
Graph
(
g6
))
return
"
%s %s %s
"
%
(
g6
,
ret
,
ret
[
0
]
>=
ret
[
1
])
inp
=
[
l
for
l
in
sys
.
stdin
]
for
ret
in
parmap
(
process
,
inp
,
nprocs
=
50
,
in_order
=
False
):
print
(
ret
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment