summaryrefslogtreecommitdiff
path: root/src/Rips_complex/test/test_rips_complex.cpp
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-14 13:27:02 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-14 13:27:02 +0000
commitde2573cf2b2eb92cff628d9690a067b50b4ca145 (patch)
tree1b9ec11f5fcb1e4a2bd08ea48f7ea26fb3733f1e /src/Rips_complex/test/test_rips_complex.cpp
parentd9895d13cecf61de78a1c812bfb80bbc2778e7a6 (diff)
Rollback pointer modification, and use of of a hack for no deep copy of boost graph
"voidification" of create_complex method git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/distance_matrix_in_rips_module@1868 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 3667c8f57388dec0300d1fed8bf1b063843727dd
Diffstat (limited to 'src/Rips_complex/test/test_rips_complex.cpp')
-rw-r--r--src/Rips_complex/test/test_rips_complex.cpp38
1 files changed, 31 insertions, 7 deletions
diff --git a/src/Rips_complex/test/test_rips_complex.cpp b/src/Rips_complex/test/test_rips_complex.cpp
index 7e0473d9..1bdd0512 100644
--- a/src/Rips_complex/test/test_rips_complex.cpp
+++ b/src/Rips_complex/test/test_rips_complex.cpp
@@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE(RIPS_DOC_OFF_file) {
const int DIMENSION_1 = 1;
Simplex_tree st;
- BOOST_CHECK(rips_complex_from_file.create_complex(st, DIMENSION_1));
+ rips_complex_from_file.create_complex(st, DIMENSION_1);
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == DIMENSION_1);
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(RIPS_DOC_OFF_file) {
const int DIMENSION_2 = 2;
Simplex_tree st2;
- BOOST_CHECK(rips_complex_from_file.create_complex(st2, DIMENSION_2));
+ rips_complex_from_file.create_complex(st2, DIMENSION_2);
std::cout << "st2.dimension()=" << st2.dimension() << std::endl;
BOOST_CHECK(st2.dimension() == DIMENSION_2);
@@ -124,7 +124,7 @@ BOOST_AUTO_TEST_CASE(RIPS_DOC_OFF_file) {
const int DIMENSION_3 = 3;
Simplex_tree st3;
- BOOST_CHECK(rips_complex_from_file.create_complex(st3, DIMENSION_3));
+ rips_complex_from_file.create_complex(st3, DIMENSION_3);
std::cout << "st3.dimension()=" << st3.dimension() << std::endl;
BOOST_CHECK(st3.dimension() == DIMENSION_3);
@@ -192,7 +192,7 @@ BOOST_AUTO_TEST_CASE(Rips_complex_from_points) {
std::cout << "========== Rips_complex_from_points ==========" << std::endl;
Simplex_tree st;
const int DIMENSION = 3;
- BOOST_CHECK(rips_complex_from_points.create_complex(st, DIMENSION));
+ rips_complex_from_points.create_complex(st, DIMENSION);
// Another way to check num_simplices
std::cout << "Iterator on rips complex simplices in the filtration order, with [filtration value]:" << std::endl;
@@ -249,7 +249,7 @@ BOOST_AUTO_TEST_CASE(Rips_doc_csv_file) {
const int DIMENSION_1 = 1;
Simplex_tree st;
- BOOST_CHECK(rips_complex_from_file.create_complex(st, DIMENSION_1));
+ rips_complex_from_file.create_complex(st, DIMENSION_1);
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == DIMENSION_1);
@@ -282,7 +282,7 @@ BOOST_AUTO_TEST_CASE(Rips_doc_csv_file) {
const int DIMENSION_2 = 2;
Simplex_tree st2;
- BOOST_CHECK(rips_complex_from_file.create_complex(st2, DIMENSION_2));
+ rips_complex_from_file.create_complex(st2, DIMENSION_2);
std::cout << "st2.dimension()=" << st2.dimension() << std::endl;
BOOST_CHECK(st2.dimension() == DIMENSION_2);
@@ -308,7 +308,7 @@ BOOST_AUTO_TEST_CASE(Rips_doc_csv_file) {
const int DIMENSION_3 = 3;
Simplex_tree st3;
- BOOST_CHECK(rips_complex_from_file.create_complex(st3, DIMENSION_3));
+ rips_complex_from_file.create_complex(st3, DIMENSION_3);
std::cout << "st3.dimension()=" << st3.dimension() << std::endl;
BOOST_CHECK(st3.dimension() == DIMENSION_3);
@@ -327,3 +327,27 @@ BOOST_AUTO_TEST_CASE(Rips_doc_csv_file) {
BOOST_CHECK(are_almost_the_same(f0123, std::max(f012, std::max(f123, std::max(f013, f023)))));
}
+
+#ifdef GUDHI_DEBUG
+BOOST_AUTO_TEST_CASE(Rips_create_complex_throw) {
+ // ----------------------------------------------------------------------------
+ //
+ // Init of a rips complex from a OFF file
+ //
+ // ----------------------------------------------------------------------------
+ std::string off_file_name("alphacomplexdoc.off");
+ double rips_threshold = 12.0;
+ std::cout << "========== OFF FILE NAME = " << off_file_name << " - rips threshold=" <<
+ rips_threshold << "==========" << std::endl;
+
+ Gudhi::Points_off_reader<Point> off_reader(off_file_name);
+ Rips_complex rips_complex_from_file(off_reader.get_point_cloud(), rips_threshold, Euclidean_distance());
+
+ Simplex_tree stree;
+ std::vector<int> simplex = {0, 1, 2};
+ stree.insert_simplex_and_subfaces(simplex);
+ std::cout << "Check exception throw in debug mode" << std::endl;
+ // throw excpt because stree is not empty
+ BOOST_CHECK_THROW (rips_complex_from_file.create_complex(stree, 1), std::invalid_argument);
+}
+#endif