diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-04-10 14:53:20 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-04-10 14:53:20 +0000 |
commit | 51ce9b513116f5fed2b4dc109f0b52595a2cd538 (patch) | |
tree | 89e4b98cc9aeb0184c28bbc0f1f2d21734831e95 /src/Cech_complex/test/test_cech_complex.cpp | |
parent | 97460e6058ab032fefb13289eb29c97d4d106bf8 (diff) |
Code review : Cech_blocker was hardcoding double
replace point_iterator function in a get_point const function that returns a Point
InputPointRange description
Cech blocker is now templated with Cech complex, which is no more included.
Deep copy of the point cloud on Cech complex ctor
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cechcomplex_vincent@3365 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 93e3cf3fe61290b88a0714b9e55ad80e01a34f36
Diffstat (limited to 'src/Cech_complex/test/test_cech_complex.cpp')
-rw-r--r-- | src/Cech_complex/test/test_cech_complex.cpp | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/Cech_complex/test/test_cech_complex.cpp b/src/Cech_complex/test/test_cech_complex.cpp index 8658729b..5ca25db4 100644 --- a/src/Cech_complex/test/test_cech_complex.cpp +++ b/src/Cech_complex/test/test_cech_complex.cpp @@ -78,11 +78,8 @@ BOOST_AUTO_TEST_CASE(Cech_complex_for_documentation) { GUDHI_TEST_FLOAT_EQUALITY_CHECK(cech_complex_for_doc.max_radius(), max_radius); std::size_t i = 0; for (; i < points.size(); i++) { - BOOST_CHECK(points[i] == *(cech_complex_for_doc.point_iterator(i))); + BOOST_CHECK(points[i] == cech_complex_for_doc.get_point(i)); } -#ifdef GUDHI_DEBUG - BOOST_CHECK_THROW (cech_complex_for_doc.point_iterator(i+1), std::out_of_range); -#endif // GUDHI_DEBUG const int DIMENSION_1 = 1; Simplex_tree st; @@ -137,8 +134,7 @@ BOOST_AUTO_TEST_CASE(Cech_complex_for_documentation) { Point_cloud points012; for (std::size_t vertex = 0; vertex <= 2; vertex++) { - points012.push_back(Point(cech_complex_for_doc.point_iterator(vertex)->begin(), - cech_complex_for_doc.point_iterator(vertex)->end())); + points012.push_back(cech_complex_for_doc.get_point(vertex)); } std::size_t dimension = points[0].end() - points[0].begin(); Min_sphere ms012(dimension, points012.begin(),points012.end()); @@ -149,12 +145,9 @@ BOOST_AUTO_TEST_CASE(Cech_complex_for_documentation) { GUDHI_TEST_FLOAT_EQUALITY_CHECK(f012, std::sqrt(ms012.squared_radius())); Point_cloud points1410; - points1410.push_back(Point(cech_complex_for_doc.point_iterator(1)->begin(), - cech_complex_for_doc.point_iterator(1)->end())); - points1410.push_back(Point(cech_complex_for_doc.point_iterator(4)->begin(), - cech_complex_for_doc.point_iterator(4)->end())); - points1410.push_back(Point(cech_complex_for_doc.point_iterator(10)->begin(), - cech_complex_for_doc.point_iterator(10)->end())); + points1410.push_back(cech_complex_for_doc.get_point(1)); + points1410.push_back(cech_complex_for_doc.get_point(4)); + points1410.push_back(cech_complex_for_doc.get_point(10)); Min_sphere ms1410(dimension, points1410.begin(),points1410.end()); Simplex_tree::Filtration_value f1410 = st2.filtration(st2.find({1, 4, 10})); @@ -163,12 +156,9 @@ BOOST_AUTO_TEST_CASE(Cech_complex_for_documentation) { GUDHI_TEST_FLOAT_EQUALITY_CHECK(f1410, std::sqrt(ms1410.squared_radius())); Point_cloud points469; - points469.push_back(Point(cech_complex_for_doc.point_iterator(4)->begin(), - cech_complex_for_doc.point_iterator(4)->end())); - points469.push_back(Point(cech_complex_for_doc.point_iterator(6)->begin(), - cech_complex_for_doc.point_iterator(6)->end())); - points469.push_back(Point(cech_complex_for_doc.point_iterator(9)->begin(), - cech_complex_for_doc.point_iterator(9)->end())); + points469.push_back(cech_complex_for_doc.get_point(4)); + points469.push_back(cech_complex_for_doc.get_point(6)); + points469.push_back(cech_complex_for_doc.get_point(9)); Min_sphere ms469(dimension, points469.begin(),points469.end()); Simplex_tree::Filtration_value f469 = st2.filtration(st2.find({4, 6, 9})); |