From 14fbbfd3bb3c615336661f0fe72b96f486977d0a Mon Sep 17 00:00:00 2001 From: salinasd Date: Thu, 5 Feb 2015 16:41:19 +0000 Subject: skbl constructor top faces without enumerating subfaces git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@455 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: dc7c3527a36ea79c262487a78e35a2d5c89ab629 --- .../test/TestSkeletonBlockerComplex.cpp | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp') diff --git a/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp b/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp index 468a4fca..ecc7649e 100644 --- a/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp +++ b/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp @@ -842,6 +842,49 @@ bool test_constructor6(){ } +bool test_constructor7(){ + typedef Vertex_handle Vh; + typedef Simplex_handle Sh; + std::vector simplices; + simplices.push_back(Sh(Vh(0),Vh(1),Vh(2))); + simplices.push_back(Sh(Vh(1),Vh(2),Vh(3))); + simplices.push_back(Sh(Vh(3),Vh(0),Vh(2))); + simplices.push_back(Sh(Vh(3),Vh(0),Vh(1))); + + //get complex from top faces + Complex complex(make_complex_from_top_faces(simplices.begin(),simplices.end())); + + DBGVALUE(complex.to_string()); + + if(complex.num_blockers()!=1) return false; + Sh expected_blocker(Vh(0),Vh(1),Vh(2),Vh(3)); + for(auto b : complex.const_blocker_range()) + if(*b!=expected_blocker) return false; + return complex.num_vertices()==4 && complex.num_blockers()==1 && complex.num_edges()==6; +} + + +bool test_constructor8(){ + typedef Vertex_handle Vh; + typedef Simplex_handle Sh; + std::vector simplices; + simplices.push_back(Sh(Vh(0),Vh(1))); + simplices.push_back(Sh(Vh(2),Vh(1))); + simplices.push_back(Sh(Vh(0),Vh(2))); + simplices.push_back(Sh(Vh(3),Vh(1))); + simplices.push_back(Sh(Vh(2),Vh(3))); + + //get complex from top faces + Complex complex(make_complex_from_top_faces(simplices.begin(),simplices.end())); + + DBGVALUE(complex.to_string()); + + return complex.num_vertices()==4 && complex.num_blockers()==2 && complex.num_edges()==5; +} + + + + int main (int argc, char *argv[]) { @@ -877,6 +920,8 @@ int main (int argc, char *argv[]) tests_complex.add("test_constructor_list_simplices4",test_constructor4); tests_complex.add("test_constructor_list_simplices5",test_constructor5); tests_complex.add("test_constructor_list_simplices6",test_constructor6); + tests_complex.add("test_constructor_list_simplices7",test_constructor7); + tests_complex.add("test_constructor_list_simplices8",test_constructor8); if(tests_complex.run()){ -- cgit v1.2.3