summaryrefslogtreecommitdiff
path: root/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp
diff options
context:
space:
mode:
authorsalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-02-05 16:41:19 +0000
committersalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-02-05 16:41:19 +0000
commit14fbbfd3bb3c615336661f0fe72b96f486977d0a (patch)
tree6b28ddcb250cf0497c6183446806355a7758818d /src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp
parentd55d30d2fadff5b7f9a045c596e9f8ad37c6b206 (diff)
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
Diffstat (limited to 'src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp')
-rw-r--r--src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp45
1 files changed, 45 insertions, 0 deletions
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<Simplex_handle> 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<Complex>(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<Simplex_handle> 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<Complex>(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()){