Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tiago Peixoto
graph-tool
Commits
4211214b
Commit
4211214b
authored
Feb 04, 2010
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug in Graph.purge_vertices()
This fixes a crash when purging filtered vertices.
parent
4e60cbfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
src/graph/graph_filtering.cc
src/graph/graph_filtering.cc
+8
-3
No files found.
src/graph/graph_filtering.cc
View file @
4211214b
...
...
@@ -258,20 +258,25 @@ void GraphInterface::PurgeVertices()
for
(
size_t
i
=
0
;
i
<
N
;
++
i
)
deleted
[
i
]
=
!
filter
(
vertex
(
i
,
_mg
));
vector
<
graph_traits
<
multigraph_t
>::
edge_descriptor
>
edges
;
//remove vertices
for
(
size_
t
i
=
N
-
1
;
i
<
N
;
--
i
)
for
(
in
t
i
=
N
-
1
;
i
>=
0
;
--
i
)
{
if
(
deleted
[
i
])
{
graph_traits
<
multigraph_t
>::
vertex_descriptor
v
=
vertex
(
i
,
_mg
);
graph_traits
<
multigraph_t
>::
out_edge_iterator
e
,
e_end
;
for
(
tie
(
e
,
e_end
)
=
out_edges
(
v
,
_mg
);
e
!=
e_end
;
++
e
)
RemoveEdgeIndex
(
*
e
);
edges
.
push_back
(
*
e
);
graph_traits
<
multigraph_t
>::
in_edge_iterator
ei
,
ei_end
;
for
(
tie
(
ei
,
ei_end
)
=
in_edges
(
v
,
_mg
);
ei
!=
ei_end
;
++
ei
)
RemoveEdgeIndex
(
*
ei
);
edges
.
push_back
(
*
ei
);
for
(
size_t
j
=
0
;
j
<
edges
.
size
();
++
j
)
RemoveEdgeIndex
(
edges
[
j
]);
clear_vertex
(
v
,
_mg
);
remove_vertex
(
v
,
_mg
);
edges
.
clear
();
}
}
}
...
...
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