summaryrefslogtreecommitdiff
path: root/src/Witness_complex/include
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-05-30 15:36:35 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-05-30 15:36:35 +0000
commit3efbb8c26aecc9f88dae4ec69d3149a4f5f1bd40 (patch)
tree7425d42c49d1d67ee56d92775ee9df9b0b3874e4 /src/Witness_complex/include
parent5cae0e771c7d4603d25ccf06c782fe383f91e74a (diff)
witness: Testing continues
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@600 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 57d8d66a90e9839887289e4efd7fbddabe009d94
Diffstat (limited to 'src/Witness_complex/include')
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex.h32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h
index c8eaa3ef..c45d144d 100644
--- a/src/Witness_complex/include/gudhi/Witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Witness_complex.h
@@ -628,7 +628,7 @@ private:
/** \brief Returns true if the link is good
*/
- bool has_good_link(Vertex_handle v)
+ bool has_good_link(Vertex_handle v, std::vector< int >& bad_count, std::vector< int >& good_count)
{
std::vector< Vertex_handle > link_vertices;
// Fill link_vertices
@@ -642,14 +642,28 @@ private:
print_vector(link_vertices);
std::cout << "\n";
*/
- print_vector(link_vertices); std::cout << "\n";
+ //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);
+ /*
+ if (d >= good_count.size())
+ {
+ std::cout << "d=" << d << std::endl;
+ std::cout << "gc.size=" << good_count.size() << std::endl;
+ print_vector(link_vertices);
+ std::cout << std::endl;
+ }
+ */
+ //assert(d < good_count.size());
+ if (d == -1) bad_count[0]++;
//std::cout << " dim " << d << "\n";
//Siblings* curr_sibl = root();
//std::cout << "Currently at vertex "
- return (link_is_pseudomanifold(link_vertices,d));
+ bool b= (link_is_pseudomanifold(link_vertices,d));
+ if (d != -1) {if (b) good_count[d]++; else bad_count[d]++;}
+ return b;
+
}
/** \brief Search and output links around vertices that are not pseudomanifolds
@@ -737,9 +751,9 @@ private:
if (d >= final_d)
{
final_d = d;
- std::cout << d << " ";
- print_vector(curr_simplex);
- std::cout << std::endl;
+ //std::cout << d << " ";
+ //print_vector(curr_simplex);
+ // std::cout << std::endl;
}
}
/*
@@ -789,13 +803,15 @@ private:
//std::cout << "Degree of " << f_map_it.first->first << " is " << boost::out_degree(f_map_it.second, adj_graph) << "\n";
if (boost::out_degree(f_map_it.second, adj_graph) != 2)
{
+ /*
if (boost::out_degree(f_map_it.second, adj_graph) == 3)
- {
+ {
std::cout << "This simplex has 3 cofaces: ";
for(auto v : simplex_vertex_range(f_map_it.first))
std::cout << v << " ";
std::cout << std::endl;
- }
+
+ }*/
count_bad[dimension]++;
return false;
}