diff options
Diffstat (limited to 'src/Witness_complex/include')
-rw-r--r-- | src/Witness_complex/include/gudhi/Witness_complex.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 69521e6a..bb553347 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -192,6 +192,7 @@ namespace Gudhi { } Simplex_handle sh; vv = {u,v}; + //if (u==v) std::cout << "Bazzinga!\n"; sh = (root()->find(u))->second.children()->find(v); active_w.push_back(i); } @@ -200,7 +201,8 @@ namespace Gudhi { //std::cout << "Successfully added edges" << std::endl; count_good = {0,0}; count_bad = {0,0}; - while (!active_w.empty() && k < nbL ) + int D = knn[0].size(); + while (!active_w.empty() && k < D ) { count_good.push_back(0); count_bad.push_back(0); @@ -623,6 +625,30 @@ private: } } } + + /** \brief Returns true if the link is good + */ + bool has_good_link(Vertex_handle v) + { + std::vector< Vertex_handle > link_vertices; + // Fill link_vertices + for (auto u: complex_vertex_range()) + { + typeVectorVertex edge = {u,v}; + if (u != v && find(edge) != null_simplex()) + link_vertices.push_back(u); + } + /* + print_vector(link_vertices); + std::cout << "\n"; + */ + // Find the dimension + typeVectorVertex empty_simplex = {}; + int d = link_dim(link_vertices, link_vertices.begin(),-1, empty_simplex); + //std::cout << " dim " << d << "\n"; + //Siblings* curr_sibl = root(); + return (link_is_pseudomanifold(link_vertices,d)); + } /** \brief Search and output links around vertices that are not pseudomanifolds * |