Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Federico Ciuffardi Alves
pgMappingCooperativo
Commits
c1a1967c
Commit
c1a1967c
authored
Oct 13, 2020
by
Romina Parada
Browse files
is collapsable fix
parent
e1a2b340
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/GVD/GVD.h
View file @
c1a1967c
...
...
@@ -176,6 +176,17 @@ struct collapsedGraph : genericGraph<graph> {
[
this
](
int
deg
,
pos
n
)
{
return
deg
+
is_elem
(
full_graph
,
n
);
});
}
pos_set
full_neighbors
(
pos
p
){
pos_set
adj_p
=
all_adj
(
p
);
pos_set
neighbors
;
for
(
auto
it
=
adj_p
;
it
!=
adj_p
.
end
();
it
++
){
pos
n
=
*
it
;
if
(
is_elem
(
full_graph
,
n
)){
neighbor
.
insert
(
n
);
}
}
return
neighbors
;
}
// vertex is uncollapsed
bool
is_uncollapsed
(
pos
p
)
{
return
is_elem
(
this
->
positions
,
p
);
}
...
...
@@ -189,15 +200,11 @@ struct collapsedGraph : genericGraph<graph> {
return
false
;
}
AdjacencyIterator
it
,
it_end
;
boost
::
tie
(
it
,
it_end
)
=
super
::
neighbors
(
p
);
pos
n1
=
this
->
g
[
*
it
].
p
;
pos
dir1
=
n1
-
p
;
it
++
;
pos
n2
=
this
->
g
[
*
it
].
p
;
pos
dir2
=
n2
-
p
;
auto
it_n
=
full_neighbors
(
p
).
begin
();
pos
dir1
=
(
*
it_n
)
-
p
;
it_n
++
;
pos
dir2
=
(
*
it_n
)
-
p
;
return
same_direction
(
dir1
,
dir2
);
}
...
...
@@ -332,14 +339,11 @@ struct collapsedGraph : genericGraph<graph> {
cout
<<
"PASO 2 CON P: "
<<
p
<<
endl
;
super
::
add_v
(
p
);
pos_set
adj
=
a
ll_
adj
(
p
);
pos_set
adj
=
fu
ll_
neighbors
(
p
);
for
(
auto
it
=
adj
.
begin
();
it
!=
adj
.
end
();
it
++
)
{
pos
n
=
*
it
;
if
(
is_elem
(
full_graph
,
n
)){
super
::
add_e
(
p
,
n
);
super
::
add_e
(
n
,
p
);
}
super
::
add_e
(
p
,
n
);
super
::
add_e
(
n
,
p
);
}
// 3. collapse p if possible
...
...
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