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
43
Issues
43
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
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
5e8d708e
Commit
5e8d708e
authored
May 02, 2008
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix edge re-indexing
parent
713c9854
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
src/graph/graph_filtering.cc
src/graph/graph_filtering.cc
+8
-7
No files found.
src/graph/graph_filtering.cc
View file @
5e8d708e
...
...
@@ -200,7 +200,7 @@ pair<string, bool> GraphInterface::GetEdgeFilterProperty() const
void
GraphInterface
::
ReIndexEdges
()
{
size_t
n_edges
=
num_edges
(
_mg
);
if
(
n_edges
==
0
||
true
)
if
(
n_edges
==
0
)
return
;
vector
<
dynamic_property_map
*>
edge_props
;
...
...
@@ -209,8 +209,7 @@ void GraphInterface::ReIndexEdges()
if
(
p
->
second
->
key
()
==
typeid
(
edge_t
))
edge_props
.
push_back
(
p
->
second
);
vector
<
pair
<
edge_t
,
bool
>
>
edge_map
(
n_edges
,
make_pair
(
edge_t
(),
false
));
vector
<
pair
<
edge_t
,
bool
>
>
edge_map
(
n_edges
,
make_pair
(
edge_t
(),
false
));
graph_traits
<
multigraph_t
>::
vertex_iterator
v
,
v_end
;
graph_traits
<
multigraph_t
>::
out_edge_iterator
e
,
e_end
;
...
...
@@ -221,7 +220,7 @@ void GraphInterface::ReIndexEdges()
if
(
index
>=
num_edges
(
_mg
))
continue
;
if
(
index
>=
edge_map
.
size
())
edge_map
.
resize
(
index
+
1
);
edge_map
.
resize
(
index
+
1
,
make_pair
(
edge_t
(),
false
)
);
edge_map
[
index
]
=
make_pair
(
*
e
,
true
);
}
...
...
@@ -236,10 +235,11 @@ void GraphInterface::ReIndexEdges()
}
edge_t
old_edge
=
edge_map
[
new_index
].
first
;
if
(
edge_map
[
new_index
].
second
)
if
(
edge_map
[
new_index
].
second
&&
_edge_index
[
*
e
]
!=
_edge_index
[
old_edge
])
{
// another edge exists with the same
index; index
es
// must be swapped
, as well as the properties
// another edge exists with the same
(new) index; the properti
es
// must be swapped
_edge_index
[
old_edge
]
=
_edge_index
[
*
e
];
edge_map
[
_edge_index
[
*
e
]]
=
make_pair
(
old_edge
,
true
);
_edge_index
[
*
e
]
=
new_index
;
...
...
@@ -257,6 +257,7 @@ void GraphInterface::ReIndexEdges()
// assigned for this edge, and the properties must be
// copied over
size_t
old_index
=
_edge_index
[
*
e
];
_edge_index
[
*
e
]
=
new_index
;
for
(
size_t
i
=
0
;
i
<
edge_props
.
size
();
++
i
)
{
_edge_index
[
*
e
]
=
old_index
;
...
...
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