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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Radek Hušek
cdc-counting
Commits
015b4bb8
Commit
015b4bb8
authored
3 years ago
by
Radek Hušek
Browse files
Options
Downloads
Patches
Plain Diff
make edge_model_join_matrix parallel
parent
2db208cd
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
graph_tools/misc.py
+15
-3
15 additions, 3 deletions
graph_tools/misc.py
with
15 additions
and
3 deletions
graph_tools/misc.py
+
15
−
3
View file @
015b4bb8
...
...
@@ -176,10 +176,22 @@ def _init_():
return
m
# FIXME k cemu je to dobry?
def
edge_model_join_matrix
(
P
,
k
):
def
edge_model_join_matrix
(
P
,
k
,
threads
=
1
):
from
sage.all
import
matrix
,
QQ
from
parmap
import
parmap
BG
=
[
FakeGadget
(
k
,
[
BoundaryValue
(
b
,
1
)
])
for
b
in
P
.
enumerate_boundaries
(
k
)
]
return
parameter_matrix
(
P
,
BG
)
inp
=
(
(
r
,
c
)
for
r
in
range
(
len
(
BG
))
for
c
in
range
(
len
(
BG
))
)
def
worker
(
x
):
r
,
c
=
x
return
(
r
,
c
,
edge_model_join
(
BG
[
r
],
BG
[
c
]).
eval
(
P
,
no_cache
=
True
))
m
=
matrix
(
QQ
,
len
(
BG
),
len
(
BG
),
sparse
=
True
)
for
r
,
c
,
v
in
parmap
(
worker
,
inp
,
nprocs
=
threads
,
in_order
=
False
):
m
[
r
,
c
]
=
v
return
m
def
enumerate_diamond_matchings
(
k
):
...
...
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