Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
f87c1e11
Commit
f87c1e11
authored
Jan 01, 2015
by
Tiago Peixoto
Browse files
Improve speed of Graph.remove_vertex()
parent
1b6f5ae1
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/graph/graph_properties.cc
View file @
f87c1e11
...
...
@@ -125,7 +125,7 @@ struct reindex_vertex_property
void
GraphInterface
::
ReIndexVertexProperty
(
boost
::
any
map
,
boost
::
any
aold_index
)
const
{
typedef
property_map_type
::
apply
<
int
32
_t
,
typedef
property_map_type
::
apply
<
int
64
_t
,
GraphInterface
::
vertex_index_map_t
>::
type
index_prop_t
;
index_prop_t
old_index
=
any_cast
<
index_prop_t
>
(
aold_index
);
...
...
src/graph_tool/__init__.py
View file @
f87c1e11
...
...
@@ -1454,9 +1454,7 @@ class Graph(object):
self
.
__check_perms
(
"del_vertex"
)
vertex
=
self
.
vertex
(
int
(
vertex
))
index
=
self
.
vertex_index
[
vertex
]
u
=
GraphView
(
self
,
skip_properties
=
True
,
skip_vfilt
=
True
)
back
=
u
.
num_vertices
()
-
1
back
=
self
.
__graph
.
GetNumberOfVertices
(
False
)
-
1
# move / shift all known property maps
if
index
!=
back
:
...
...
@@ -2114,7 +2112,7 @@ class Graph(object):
"""
if
in_place
:
old_indexes
=
self
.
vertex_index
.
copy
(
"int
32
_t"
)
old_indexes
=
self
.
vertex_index
.
copy
(
"int
64
_t"
)
self
.
__graph
.
PurgeVertices
(
_prop
(
"v"
,
self
,
old_indexes
))
self
.
set_vertex_filter
(
None
)
for
pmap
in
self
.
__known_properties
.
values
():
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment