Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tiago Peixoto
graph-tool
Commits
ca3c49f6
Commit
ca3c49f6
authored
Dec 01, 2013
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix segfault in sfdp_layout()
parent
58b73413
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
28 deletions
+15
-28
src/graph/layout/graph_sfdp.cc
src/graph/layout/graph_sfdp.cc
+15
-28
No files found.
src/graph/layout/graph_sfdp.cc
View file @
ca3c49f6
...
...
@@ -97,33 +97,24 @@ struct do_propagate_pos
uniform_real_distribution
<
val_t
>
noise
(
-
delta
,
delta
);
unordered_map
<
c_t
,
pos_t
,
boost
::
hash
<
c_t
>
>
cmap
(
num_vertices
(
*
cg
));
int
i
,
N
=
num_vertices
(
*
cg
);
#pragma omp parallel for default(shared) private(i)
for
(
i
=
0
;
i
<
N
;
++
i
)
typename
graph_traits
<
Graph
>::
vertex_iterator
vi
,
vi_end
;
for
(
tie
(
vi
,
vi_end
)
=
vertices
(
g
);
vi
!=
vi_end
;
++
v
i
)
{
typename
graph_traits
<
CoarseGraph
>::
vertex_descriptor
v
=
vertex
(
i
,
*
cg
);
if
(
v
==
graph_traits
<
CoarseGraph
>::
null_vertex
())
continue
;
typename
graph_traits
<
Graph
>::
vertex_descriptor
v
=
*
vi
;
cmap
[
cvmap
[
v
]]
=
cpos
[
v
];
pos
[
v
].
resize
(
2
,
0
);
}
N
=
num_vertices
(
g
);
#pragma omp parallel for default(shared) private(i)
for
(
i
=
0
;
i
<
N
;
++
i
)
for
(
tie
(
vi
,
vi_end
)
=
vertices
(
g
);
vi
!=
vi_end
;
++
vi
)
{
typename
graph_traits
<
Graph
>::
vertex_descriptor
v
=
vertex
(
i
,
g
);
if
(
v
==
graph_traits
<
Graph
>::
null_vertex
())
continue
;
typename
graph_traits
<
Graph
>::
vertex_descriptor
v
=
*
vi
;
pos
[
v
]
=
cmap
[
vmap
[
v
]];
if
(
delta
>
0
)
{
if
(
delta
>
0
)
{
#pragma omp critical
for
(
size_t
j
=
0
;
j
<
pos
[
v
].
size
();
++
j
)
pos
[
v
][
j
]
+=
noise
(
rng
);
}
for
(
size_t
j
=
0
;
j
<
pos
[
v
].
size
();
++
j
)
pos
[
v
][
j
]
+=
noise
(
rng
);
}
}
}
...
...
@@ -169,14 +160,10 @@ struct do_propagate_pos_mivs
uniform_real_distribution
<
val_t
>
noise
(
-
delta
,
delta
);
int
i
,
N
=
num_vertices
(
g
);
#pragma omp parallel for default(shared) private(i)
for
(
i
=
0
;
i
<
N
;
++
i
)
typename
graph_traits
<
Graph
>::
vertex_iterator
vi
,
vi_end
;
for
(
tie
(
vi
,
vi_end
)
=
vertices
(
g
);
vi
!=
vi_end
;
++
vi
)
{
typename
graph_traits
<
Graph
>::
vertex_descriptor
v
=
vertex
(
i
,
g
);
if
(
v
==
graph_traits
<
Graph
>::
null_vertex
())
continue
;
typename
graph_traits
<
Graph
>::
vertex_descriptor
v
=
*
vi
;
if
(
mivs
[
v
])
continue
;
pos
[
v
].
resize
(
2
);
...
...
@@ -187,6 +174,7 @@ struct do_propagate_pos_mivs
{
if
(
!
mivs
[
*
a
])
continue
;
pos
[
*
a
].
resize
(
2
,
0
);
for
(
size_t
j
=
0
;
j
<
pos
[
v
].
size
();
++
j
)
pos
[
v
][
j
]
+=
pos
[
*
a
][
j
];
++
count
;
...
...
@@ -200,7 +188,6 @@ struct do_propagate_pos_mivs
{
if
(
delta
>
0
)
{
#pragma omp critical
for
(
size_t
j
=
0
;
j
<
pos
[
v
].
size
();
++
j
)
pos
[
v
][
j
]
+=
noise
(
rng
);
}
...
...
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