summaryrefslogtreecommitdiff
path: root/src/Witness_complex/include/gudhi/Witness_complex1.h
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-03-24 12:31:43 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-03-24 12:31:43 +0000
commit1ec3e1ae82dab1109ce871f690df716fb05c6a16 (patch)
tree43806606f2e50633807bbe2b9a74d9f98f94ad83 /src/Witness_complex/include/gudhi/Witness_complex1.h
parentb33bcf4bb496870b73ee6c4783777bf794e28fb7 (diff)
Now at every loop curr_sibl to root() as it should
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@502 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 618fbf7be18e0caa150132a63466d77205634479
Diffstat (limited to 'src/Witness_complex/include/gudhi/Witness_complex1.h')
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex1.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Witness_complex/include/gudhi/Witness_complex1.h b/src/Witness_complex/include/gudhi/Witness_complex1.h
index acb83647..6950c3bf 100644
--- a/src/Witness_complex/include/gudhi/Witness_complex1.h
+++ b/src/Witness_complex/include/gudhi/Witness_complex1.h
@@ -265,12 +265,12 @@ void witness_complex(KNearestNeighbours & knn)
simplex_vector.push_back(knn[*it][i]);
}
returnValue = insert_simplex(simplex_vector,0.0);
- it++
+ it++;
}
else
active_w.erase(it++); //First increase the iterator and then erase the previous element
+ print_sc(root()); std::cout << std::endl;
}
- print_sc(root());
k++;
}
}
@@ -326,16 +326,28 @@ private:
for (int i = 0; i != k+1; ++i)
{
curr_sh = sh_bup;
+ curr_sibl = root();
if (knn[witness_id][i] != inserted_vertex)
{
for (int j = 0; j != k+1; ++j)
{
if (j != i)
{
+ std::cout << "+++ We are at vertex=" << knn[witness_id][j] << std::endl;
if (curr_sibl->find(knn[witness_id][j]) == null_simplex())
return false;
+ std::cout << "++++ the simplex is there\n";
curr_sh = curr_sibl->find(knn[witness_id][j]);
- curr_sibl = self_siblings(curr_sh);
+ std::cout << "++++ curr_sh affectation is OK\n";
+ if (has_children(curr_sh))
+ curr_sibl = curr_sh->second.children();
+ else
+ if (j < k || (j < k-1 && i == k))
+ {
+ std::cout << "++++ the values: j=" << j << ", k=" << k << std::endl;
+ return false;
+ }
+ std::cout << "++++ finished loop safely\n";
}//endif j!=i
}//endfor
}//endif