Commit e7b80441 authored by Romina Julieta Parada Venossa's avatar Romina Julieta Parada Venossa
Browse files

erase fixed

parent a9a2b37a
......@@ -179,7 +179,7 @@ struct collapsedGraph : genericGraph<graph> {
// TODO
bool is_collapsable(pos p) {
return super::deg(p) == 2 && !is_local_min[p];
return super::deg(p) == 2 && true;//!is_local_min[p];
}
bool is_uncollapsable(pos p) { return !is_collapsable(p); }
......@@ -230,6 +230,7 @@ struct collapsedGraph : genericGraph<graph> {
if(same_direction(adj1,adj2)){
super::add_e(adj1, adj2);
super::add_e(adj2, adj1);
super::erase_v(p);
}
}
......@@ -252,12 +253,14 @@ struct collapsedGraph : genericGraph<graph> {
pos_set adj = all_adj(p);
for (auto it = adj.begin(); it != adj.end(); it++) {
pos n = *it;
if (is_collapsable(p)) {
// i want to collapsed if belongs to boost
if (is_uncollapsed(n) && is_collapsable(n)) {
collapse(n);
}
}
}
// Los vecinos de los vecinos de un nodo p, que se agrega o se remueve no van a colapsarse o descolapsarse. Solo los vecinos del grafo full.
void erase_v(pos p) {
// 0. erase from uncollapsed
full_graph.erase(p);
......@@ -275,11 +278,11 @@ struct collapsedGraph : genericGraph<graph> {
}
void add_v(pos p) {
if (is_elem(full_graph, p)) {
/*if (is_elem(full_graph, p)) {
/// update local min
if(is_local_min[p]){
if(is_collapsed(p)){
uncollapse(p)
uncollapse(p);
}
}else if is_uncollapsed(p){
if(is_collapsable(p)){
......@@ -287,7 +290,7 @@ struct collapsedGraph : genericGraph<graph> {
}
}
return;
}
}*/
// 0. add to uncollapsed
full_graph.insert(p);
......@@ -311,7 +314,7 @@ struct collapsedGraph : genericGraph<graph> {
void add_v(pos_set to_add) {
for (auto it = to_add.begin(); it != to_add.end(); it++) {
pos p = *it;
//add_v(*it); TODO descomentar esto y borrar lo de abajo (lo hice para probar)
//add_v(*it); //TODO descomentar esto y borrar lo de abajo (lo hice para probar)
super::add_v(p);
full_graph.insert(p);
}
......
......@@ -431,7 +431,7 @@ void GVDIC::update_gvd() {
gvd.erase_v(*it);
}
//recorrer el set generado y hacer esto
gvd.local_min[pos] = is_local_min(p)
//gvd.local_min[pos] = is_local_min(p)
//set de cosas
gvd.add_v(to_add_gvd);
......
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment