summaryrefslogtreecommitdiff
path: root/src/Witness_complex/include
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-05-20 15:16:13 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-05-20 15:16:13 +0000
commitbc9d9bdaec5e4ca1604cca2a5251031f25c64b0f (patch)
treef4bc82ced0908f52c847c95093ce62b965a6eb6b /src/Witness_complex/include
parentd8984eab8b054dbdaa2d2ada040f6b1927594bef (diff)
Added perturbation witness complex construction
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@590 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 5c478d127e0fefa8696be5ca72ab89efa2e2dfc6
Diffstat (limited to 'src/Witness_complex/include')
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex.h28
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
*