Skip to content
GitLab
Menu
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
90462548
Commit
90462548
authored
Apr 04, 2008
by
Tiago Peixoto
Browse files
Fix graph copying
parent
b7237044
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/graph_copy.cc
View file @
90462548
...
...
@@ -40,6 +40,7 @@ struct graph_copy
{
GraphDst
&
dst
=
*
dstp
;
GraphSrc
&
src
=
*
srcp
;
vector
<
size_t
>
index_map
(
num_vertices
(
src
));
typename
graph_traits
<
GraphSrc
>::
vertex_iterator
v
,
v_end
;
for
(
tie
(
v
,
v_end
)
=
vertices
(
src
);
v
!=
v_end
;
++
v
)
...
...
@@ -54,8 +55,8 @@ struct graph_copy
typename
graph_traits
<
GraphSrc
>::
edge_iterator
e
,
e_end
;
for
(
tie
(
e
,
e_end
)
=
edges
(
src
);
e
!=
e_end
;
++
e
)
{
size_t
s
=
src_vertex_index
[
source
(
*
e
,
src
)];
size_t
t
=
src_vertex_index
[
target
(
*
e
,
src
)];
size_t
s
=
index_map
[
src_vertex_index
[
source
(
*
e
,
src
)]
]
;
size_t
t
=
index_map
[
src_vertex_index
[
target
(
*
e
,
src
)]
]
;
typename
graph_traits
<
GraphDst
>::
edge_descriptor
new_e
=
add_edge
(
vertex
(
s
,
dst
),
vertex
(
t
,
dst
),
dst
).
first
;
dst_edge_index
[
new_e
]
=
src_edge_index
[
new_e
];
...
...
Write
Preview
Supports
Markdown
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