diff options
author | skachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-03 08:40:22 +0000 |
---|---|---|
committer | skachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-03 08:40:22 +0000 |
commit | 5f049ec0dbf0f756d8ecc5e55b00d2bd748cb927 (patch) | |
tree | 9053d176d18d0cbc0b6d034ec1abbf384b668609 /src/Witness_complex/include/gudhi | |
parent | 9e99b02fa2d91aced59c5fded3f1a2e07afe30aa (diff) |
witness: Added good-bad link count to witness_complex_perturbations
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@602 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: b4dbfbf4f8c59399b174574216b577075f08ede8
Diffstat (limited to 'src/Witness_complex/include/gudhi')
-rw-r--r-- | src/Witness_complex/include/gudhi/Witness_complex.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 0888c086..222e379c 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -641,8 +641,11 @@ private: } // Find the dimension typeVectorVertex init_simplex = {star_vertices[0]}; - int d = star_dim(star_vertices, star_vertices.begin()+1, 0, init_simplex) - 1; //link_dim = star_dim - 1 + bool is_pure = true; + int d = star_dim(star_vertices, star_vertices.begin()+1, 0, init_simplex, is_pure) - 1; //link_dim = star_dim - 1 assert(init_simplex.size() == 1); + if (!is_pure) + std::cout << "Found an impure star around " << v << "\n"; /* if (d == count_good.size()) { @@ -651,7 +654,7 @@ private: } */ if (d == -1) bad_count[0]++; - bool b= (link_is_pseudomanifold(star_vertices,d)); + bool b= (is_pure && link_is_pseudomanifold(star_vertices,d)); if (d != -1) {if (b) good_count[d]++; else bad_count[d]++;} return (d != -1 && b); @@ -713,7 +716,8 @@ private: int star_dim(std::vector< Vertex_handle >& star_vertices, typename std::vector< Vertex_handle >::iterator curr_v, int curr_d, - typeVectorVertex& curr_simplex) + typeVectorVertex& curr_simplex, + bool& is_pure) { //std::cout << "Entered star_dim for " << *(curr_v-1) << "\n"; Simplex_handle sh; @@ -733,7 +737,9 @@ private: if (sh != null_simplex()) { //std::cout << " -> " << *it << "\n"; - int d = star_dim(star_vertices, it+1, curr_d+1, curr_simplex); + int d = star_dim(star_vertices, it+1, curr_d+1, curr_simplex, is_pure); + if (it != curr_v && d != final_d) //If the dimension is known and differs from the one computed previously + is_pure = false; //the simplex is not pure if (d >= final_d) { final_d = d; |