From 7865ef2cc4abd972b2ba1eb50790912820fa2ee2 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 25 Sep 2018 16:05:33 +0000 Subject: clang-format all files Add safe version alpha complex 3d persistence utility git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alpha_complex_3d_module_vincent@3907 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 54b2d0de9231511864df9fa637b60b7ccf34f50f --- .../test/Alpha_complex_3d_unit_test.cpp | 234 +++++++++++---------- 1 file changed, 123 insertions(+), 111 deletions(-) (limited to 'src/Alpha_complex/test') diff --git a/src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp b/src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp index a32e88a6..9e071195 100644 --- a/src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp +++ b/src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp @@ -42,21 +42,33 @@ #include #include -using Fast_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; -using Safe_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; -using Exact_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; - -using Fast_weighted_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; -using Safe_weighted_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; -using Exact_weighted_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; - -using Fast_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; -using Safe_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; -using Exact_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; - -using Fast_weighted_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; -using Safe_weighted_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; -using Exact_weighted_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; +using Fast_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; +using Safe_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; +using Exact_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; + +using Fast_weighted_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; +using Safe_weighted_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; +using Exact_weighted_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; + +using Fast_periodic_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; +using Safe_periodic_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; +using Exact_periodic_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; + +using Fast_weighted_periodic_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; +using Safe_weighted_periodic_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; +using Exact_weighted_periodic_alpha_complex_3d = + Gudhi::alpha_complex::Alpha_complex_3d; BOOST_AUTO_TEST_CASE(Alpha_complex_3d_from_points) { // ----------------- @@ -89,18 +101,18 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_3d_from_points) { // --------------------- // Compare both versions // --------------------- - std::cout << "Exact Alpha complex 3d is of dimension " << exact_stree.dimension() - << " - Non exact is " << stree.dimension() << std::endl; + std::cout << "Exact Alpha complex 3d is of dimension " << exact_stree.dimension() << " - Non exact is " + << stree.dimension() << std::endl; BOOST_CHECK(exact_stree.dimension() == stree.dimension()); - std::cout << "Exact Alpha complex 3d num_simplices " << exact_stree.num_simplices() - << " - Non exact is " << stree.num_simplices() << std::endl; + std::cout << "Exact Alpha complex 3d num_simplices " << exact_stree.num_simplices() << " - Non exact is " + << stree.num_simplices() << std::endl; BOOST_CHECK(exact_stree.num_simplices() == stree.num_simplices()); - std::cout << "Exact Alpha complex 3d num_vertices " << exact_stree.num_vertices() - << " - Non exact is " << stree.num_vertices() << std::endl; + std::cout << "Exact Alpha complex 3d num_vertices " << exact_stree.num_vertices() << " - Non exact is " + << stree.num_vertices() << std::endl; BOOST_CHECK(exact_stree.num_vertices() == stree.num_vertices()); auto sh = stree.filtration_simplex_range().begin(); - while(sh != stree.filtration_simplex_range().end()) { + while (sh != stree.filtration_simplex_range().end()) { std::vector simplex; std::vector exact_simplex; std::cout << "Non-exact ( "; @@ -108,7 +120,8 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_3d_from_points) { simplex.push_back(vertex); std::cout << vertex << " "; } - std::cout << ") -> " << "[" << stree.filtration(*sh) << "] "; + std::cout << ") -> " + << "[" << stree.filtration(*sh) << "] "; std::cout << std::endl; // Find it in the exact structure @@ -133,18 +146,18 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_3d_from_points) { // --------------------- // Compare both versions // --------------------- - std::cout << "Exact Alpha complex 3d is of dimension " << safe_stree.dimension() - << " - Non exact is " << stree.dimension() << std::endl; + std::cout << "Exact Alpha complex 3d is of dimension " << safe_stree.dimension() << " - Non exact is " + << stree.dimension() << std::endl; BOOST_CHECK(safe_stree.dimension() == stree.dimension()); - std::cout << "Exact Alpha complex 3d num_simplices " << safe_stree.num_simplices() - << " - Non exact is " << stree.num_simplices() << std::endl; + std::cout << "Exact Alpha complex 3d num_simplices " << safe_stree.num_simplices() << " - Non exact is " + << stree.num_simplices() << std::endl; BOOST_CHECK(safe_stree.num_simplices() == stree.num_simplices()); - std::cout << "Exact Alpha complex 3d num_vertices " << safe_stree.num_vertices() - << " - Non exact is " << stree.num_vertices() << std::endl; + std::cout << "Exact Alpha complex 3d num_vertices " << safe_stree.num_vertices() << " - Non exact is " + << stree.num_vertices() << std::endl; BOOST_CHECK(safe_stree.num_vertices() == stree.num_vertices()); auto safe_sh = stree.filtration_simplex_range().begin(); - while(safe_sh != stree.filtration_simplex_range().end()) { + while (safe_sh != stree.filtration_simplex_range().end()) { std::vector simplex; std::vector exact_simplex; #ifdef DEBUG_TRACES @@ -157,7 +170,8 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_3d_from_points) { #endif } #ifdef DEBUG_TRACES - std::cout << ") -> " << "[" << stree.filtration(*safe_sh) << "] "; + std::cout << ") -> " + << "[" << stree.filtration(*safe_sh) << "] "; std::cout << std::endl; #endif @@ -172,9 +186,9 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_3d_from_points) { } } -typedef boost::mpl::list weighted_variants_type_list; +typedef boost::mpl::list + weighted_variants_type_list; #ifdef GUDHI_DEBUG BOOST_AUTO_TEST_CASE_TEMPLATE(Alpha_complex_weighted_throw, Weighted_alpha_complex_3d, weighted_variants_type_list) { @@ -191,7 +205,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Alpha_complex_weighted_throw, Weighted_alpha_compl std::vector weights = {0.01, 0.005, 0.006, 0.01, 0.009, 0.001}; std::cout << "Check exception throw in debug mode" << std::endl; - BOOST_CHECK_THROW (Weighted_alpha_complex_3d wac(w_points, weights), std::invalid_argument); + BOOST_CHECK_THROW(Weighted_alpha_complex_3d wac(w_points, weights), std::invalid_argument); } #endif @@ -218,7 +232,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Alpha_complex_weighted, Weighted_alpha_complex_3d, std::vector weighted_points; - for (std::size_t i=0; i < w_points.size(); i++) { + for (std::size_t i = 0; i < w_points.size(); i++) { weighted_points.push_back(Weighted_point_3(w_points[i], weights[i])); } Weighted_alpha_complex_3d alpha_complex_w_p(weighted_points); @@ -229,18 +243,18 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Alpha_complex_weighted, Weighted_alpha_complex_3d, // --------------------- // Compare both versions // --------------------- - std::cout << "Weighted alpha complex 3d is of dimension " << stree_bis.dimension() - << " - versus " << stree.dimension() << std::endl; + std::cout << "Weighted alpha complex 3d is of dimension " << stree_bis.dimension() << " - versus " + << stree.dimension() << std::endl; BOOST_CHECK(stree_bis.dimension() == stree.dimension()); - std::cout << "Weighted alpha complex 3d num_simplices " << stree_bis.num_simplices() - << " - versus " << stree.num_simplices() << std::endl; + std::cout << "Weighted alpha complex 3d num_simplices " << stree_bis.num_simplices() << " - versus " + << stree.num_simplices() << std::endl; BOOST_CHECK(stree_bis.num_simplices() == stree.num_simplices()); - std::cout << "Weighted alpha complex 3d num_vertices " << stree_bis.num_vertices() - << " - versus " << stree.num_vertices() << std::endl; + std::cout << "Weighted alpha complex 3d num_vertices " << stree_bis.num_vertices() << " - versus " + << stree.num_vertices() << std::endl; BOOST_CHECK(stree_bis.num_vertices() == stree.num_vertices()); auto sh = stree.filtration_simplex_range().begin(); - while(sh != stree.filtration_simplex_range().end()) { + while (sh != stree.filtration_simplex_range().end()) { std::vector simplex; std::vector exact_simplex; #ifdef DEBUG_TRACES @@ -253,7 +267,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Alpha_complex_weighted, Weighted_alpha_complex_3d, #endif } #ifdef DEBUG_TRACES - std::cout << ") -> " << "[" << stree.filtration(*sh) << "] "; + std::cout << ") -> " + << "[" << stree.filtration(*sh) << "] "; std::cout << std::endl; #endif @@ -266,13 +281,12 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Alpha_complex_weighted, Weighted_alpha_complex_3d, ++sh; } - } #ifdef GUDHI_DEBUG -typedef boost::mpl::list periodic_variants_type_list; +typedef boost::mpl::list + periodic_variants_type_list; BOOST_AUTO_TEST_CASE_TEMPLATE(Alpha_complex_periodic_throw, Periodic_alpha_complex_3d, periodic_variants_type_list) { std::cout << "Periodic alpha complex 3d exception throw" << std::endl; @@ -284,18 +298,18 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Alpha_complex_periodic_throw, Periodic_alpha_compl std::cout << "Check exception throw in debug mode" << std::endl; // Check it throws an exception when the cuboid is not iso - BOOST_CHECK_THROW (Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 0.9, 1., 1.), - std::invalid_argument); - BOOST_CHECK_THROW (Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 1., 0.9, 1.), - std::invalid_argument); - BOOST_CHECK_THROW (Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 1., 1., 0.9), - std::invalid_argument); - BOOST_CHECK_THROW (Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 1.1, 1., 1.), - std::invalid_argument); - BOOST_CHECK_THROW (Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 1., 1.1, 1.), - std::invalid_argument); - BOOST_CHECK_THROW (Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 1., 1., 1.1), - std::invalid_argument); + BOOST_CHECK_THROW(Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 0.9, 1., 1.), + std::invalid_argument); + BOOST_CHECK_THROW(Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 1., 0.9, 1.), + std::invalid_argument); + BOOST_CHECK_THROW(Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 1., 1., 0.9), + std::invalid_argument); + BOOST_CHECK_THROW(Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 1.1, 1., 1.), + std::invalid_argument); + BOOST_CHECK_THROW(Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 1., 1.1, 1.), + std::invalid_argument); + BOOST_CHECK_THROW(Periodic_alpha_complex_3d periodic_alpha_complex(p_points, 0., 0., 0., 1., 1., 1.1), + std::invalid_argument); } #endif @@ -310,7 +324,7 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_periodic) { CGAL::Random_points_in_cube_3 in_cube(1, random); std::vector p_points; - for (int i=0 ; i < 50 ; i++) { + for (int i = 0; i < 50; i++) { Fast_periodic_alpha_complex_3d::Point_3 p = *in_cube++; p_points.push_back(p); } @@ -327,7 +341,7 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_periodic) { std::vector e_p_points; - for (auto p: p_points) { + for (auto p : p_points) { e_p_points.push_back(Exact_periodic_alpha_complex_3d::Point_3(p[0], p[1], p[2])); } @@ -339,27 +353,25 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_periodic) { // --------------------- // Compare both versions // --------------------- - std::cout << "Exact periodic alpha complex 3d is of dimension " << exact_stree.dimension() - << " - Non exact is " << stree.dimension() << std::endl; + std::cout << "Exact periodic alpha complex 3d is of dimension " << exact_stree.dimension() << " - Non exact is " + << stree.dimension() << std::endl; BOOST_CHECK(exact_stree.dimension() == stree.dimension()); - std::cout << "Exact periodic alpha complex 3d num_simplices " << exact_stree.num_simplices() - << " - Non exact is " << stree.num_simplices() << std::endl; + std::cout << "Exact periodic alpha complex 3d num_simplices " << exact_stree.num_simplices() << " - Non exact is " + << stree.num_simplices() << std::endl; BOOST_CHECK(exact_stree.num_simplices() == stree.num_simplices()); - std::cout << "Exact periodic alpha complex 3d num_vertices " << exact_stree.num_vertices() - << " - Non exact is " << stree.num_vertices() << std::endl; + std::cout << "Exact periodic alpha complex 3d num_vertices " << exact_stree.num_vertices() << " - Non exact is " + << stree.num_vertices() << std::endl; BOOST_CHECK(exact_stree.num_vertices() == stree.num_vertices()); - // We cannot compare as objects from dispatcher on the alpha shape is not deterministic. // cf. https://github.com/CGAL/cgal/issues/3346 auto sh = stree.filtration_simplex_range().begin(); auto sh_exact = exact_stree.filtration_simplex_range().begin(); - while(sh != stree.filtration_simplex_range().end() || sh_exact != exact_stree.filtration_simplex_range().end()) { + while (sh != stree.filtration_simplex_range().end() || sh_exact != exact_stree.filtration_simplex_range().end()) { GUDHI_TEST_FLOAT_EQUALITY_CHECK(stree.filtration(*sh), exact_stree.filtration(*sh_exact), 1e-14); - std::vector vh(stree.simplex_vertex_range(*sh).begin(), - stree.simplex_vertex_range(*sh).end()); + std::vector vh(stree.simplex_vertex_range(*sh).begin(), stree.simplex_vertex_range(*sh).end()); std::vector exact_vh(exact_stree.simplex_vertex_range(*sh_exact).begin(), exact_stree.simplex_vertex_range(*sh_exact).end()); @@ -371,7 +383,6 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_periodic) { BOOST_CHECK(sh == stree.filtration_simplex_range().end()); BOOST_CHECK(sh_exact == exact_stree.filtration_simplex_range().end()); - // ---------------------- // Safe periodic version // ---------------------- @@ -379,7 +390,7 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_periodic) { std::vector s_p_points; - for (auto p: p_points) { + for (auto p : p_points) { s_p_points.push_back(Safe_periodic_alpha_complex_3d::Point_3(p[0], p[1], p[2])); } @@ -396,11 +407,10 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_periodic) { sh = stree.filtration_simplex_range().begin(); auto sh_safe = safe_stree.filtration_simplex_range().begin(); - while(sh != stree.filtration_simplex_range().end() || sh_safe != safe_stree.filtration_simplex_range().end()) { + while (sh != stree.filtration_simplex_range().end() || sh_safe != safe_stree.filtration_simplex_range().end()) { GUDHI_TEST_FLOAT_EQUALITY_CHECK(stree.filtration(*sh), safe_stree.filtration(*sh_safe), 1e-14); - std::vector vh(stree.simplex_vertex_range(*sh).begin(), - stree.simplex_vertex_range(*sh).end()); + std::vector vh(stree.simplex_vertex_range(*sh).begin(), stree.simplex_vertex_range(*sh).end()); std::vector safe_vh(safe_stree.simplex_vertex_range(*sh_safe).begin(), safe_stree.simplex_vertex_range(*sh_safe).end()); @@ -411,11 +421,11 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_periodic) { BOOST_CHECK(sh == stree.filtration_simplex_range().end()); BOOST_CHECK(sh_safe == safe_stree.filtration_simplex_range().end()); - } typedef boost::mpl::list wp_variants_type_list; + Safe_weighted_periodic_alpha_complex_3d> + wp_variants_type_list; #ifdef GUDHI_DEBUG BOOST_AUTO_TEST_CASE_TEMPLATE(Alpha_complex_weighted_periodic_throw, Weighted_periodic_alpha_complex_3d, @@ -427,7 +437,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Alpha_complex_weighted_periodic_throw, Weighted_pe CGAL::Random_points_in_cube_3 in_cube(1, random); std::vector wp_points; - for (int i=0 ; i < 50 ; i++) { + for (int i = 0; i < 50; i++) { Weighted_periodic_alpha_complex_3d::Point_3 p = *in_cube++; wp_points.push_back(p); } @@ -439,44 +449,50 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Alpha_complex_weighted_periodic_throw, Weighted_pe std::cout << "Cuboid is not iso exception" << std::endl; // Check it throws an exception when the cuboid is not iso - BOOST_CHECK_THROW (Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 0.9, 1., 1.), - std::invalid_argument); - BOOST_CHECK_THROW (Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 1., 0.9, 1.), - std::invalid_argument); - BOOST_CHECK_THROW (Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 1., 1., 0.9), - std::invalid_argument); - BOOST_CHECK_THROW (Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 1.1, 1., 1.), - std::invalid_argument); - BOOST_CHECK_THROW (Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 1., 1.1, 1.), - std::invalid_argument); - BOOST_CHECK_THROW (Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 1., 1., 1.1), - std::invalid_argument); + BOOST_CHECK_THROW( + Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 0.9, 1., 1.), + std::invalid_argument); + BOOST_CHECK_THROW( + Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 1., 0.9, 1.), + std::invalid_argument); + BOOST_CHECK_THROW( + Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 1., 1., 0.9), + std::invalid_argument); + BOOST_CHECK_THROW( + Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 1.1, 1., 1.), + std::invalid_argument); + BOOST_CHECK_THROW( + Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 1., 1.1, 1.), + std::invalid_argument); + BOOST_CHECK_THROW( + Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, -1., -1., -1., 1., 1., 1.1), + std::invalid_argument); std::cout << "0 <= point.weight() < 1/64 * domain_size * domain_size exception" << std::endl; // Weights must be in range ]0, 1/64 = 0.015625[ double temp = p_weights[25]; p_weights[25] = 1.0; - BOOST_CHECK_THROW (Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, 0., 0., 0., 1., 1., 1.), - std::invalid_argument); + BOOST_CHECK_THROW(Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, 0., 0., 0., 1., 1., 1.), + std::invalid_argument); // Weights must be in range ]0, 1/64 = 0.015625[ p_weights[25] = temp; temp = p_weights[14]; p_weights[14] = -1e-10; - BOOST_CHECK_THROW (Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, 0., 0., 0., 1., 1., 1.), - std::invalid_argument); + BOOST_CHECK_THROW(Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, 0., 0., 0., 1., 1., 1.), + std::invalid_argument); p_weights[14] = temp; std::cout << "wp_points and p_weights size exception" << std::endl; // Weights and points must have the same size // + 1 p_weights.push_back(1e-10); - BOOST_CHECK_THROW (Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, 0., 0., 0., 1., 1., 1.), - std::invalid_argument); + BOOST_CHECK_THROW(Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, 0., 0., 0., 1., 1., 1.), + std::invalid_argument); // - 1 p_weights.pop_back(); p_weights.pop_back(); - BOOST_CHECK_THROW (Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, 0., 0., 0., 1., 1., 1.), - std::invalid_argument); + BOOST_CHECK_THROW(Weighted_periodic_alpha_complex_3d wp_alpha_complex(wp_points, p_weights, 0., 0., 0., 1., 1., 1.), + std::invalid_argument); } #endif @@ -491,7 +507,7 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_weighted_periodic) { CGAL::Random_points_in_cube_3 in_cube(1, random); std::vector p_points; - for (int i=0 ; i < 50 ; i++) { + for (int i = 0; i < 50; i++) { Fast_weighted_periodic_alpha_complex_3d::Point_3 p = *in_cube++; p_points.push_back(p); } @@ -513,7 +529,7 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_weighted_periodic) { std::vector e_p_points; - for (auto p: p_points) { + for (auto p : p_points) { e_p_points.push_back(Exact_weighted_periodic_alpha_complex_3d::Point_3(p[0], p[1], p[2])); } @@ -535,17 +551,15 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_weighted_periodic) { << " - Non exact is " << stree.num_vertices() << std::endl; BOOST_CHECK(exact_stree.num_vertices() == stree.num_vertices()); - // We cannot compare as objects from dispatcher on the alpha shape is not deterministic. // cf. https://github.com/CGAL/cgal/issues/3346 auto sh = stree.filtration_simplex_range().begin(); auto sh_exact = exact_stree.filtration_simplex_range().begin(); - while(sh != stree.filtration_simplex_range().end() || sh_exact != exact_stree.filtration_simplex_range().end()) { + while (sh != stree.filtration_simplex_range().end() || sh_exact != exact_stree.filtration_simplex_range().end()) { GUDHI_TEST_FLOAT_EQUALITY_CHECK(stree.filtration(*sh), exact_stree.filtration(*sh_exact), 1e-14); - std::vector vh(stree.simplex_vertex_range(*sh).begin(), - stree.simplex_vertex_range(*sh).end()); + std::vector vh(stree.simplex_vertex_range(*sh).begin(), stree.simplex_vertex_range(*sh).end()); std::vector exact_vh(exact_stree.simplex_vertex_range(*sh_exact).begin(), exact_stree.simplex_vertex_range(*sh_exact).end()); @@ -557,7 +571,6 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_weighted_periodic) { BOOST_CHECK(sh == stree.filtration_simplex_range().end()); BOOST_CHECK(sh_exact == exact_stree.filtration_simplex_range().end()); - // ---------------------- // Safe weighted periodic version // ---------------------- @@ -565,7 +578,7 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_weighted_periodic) { std::vector s_p_points; - for (auto p: p_points) { + for (auto p : p_points) { s_p_points.push_back(Safe_weighted_periodic_alpha_complex_3d::Point_3(p[0], p[1], p[2])); } @@ -582,11 +595,10 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_weighted_periodic) { sh = stree.filtration_simplex_range().begin(); auto sh_safe = safe_stree.filtration_simplex_range().begin(); - while(sh != stree.filtration_simplex_range().end() || sh_safe != safe_stree.filtration_simplex_range().end()) { + while (sh != stree.filtration_simplex_range().end() || sh_safe != safe_stree.filtration_simplex_range().end()) { GUDHI_TEST_FLOAT_EQUALITY_CHECK(stree.filtration(*sh), safe_stree.filtration(*sh_safe), 1e-14); - std::vector vh(stree.simplex_vertex_range(*sh).begin(), - stree.simplex_vertex_range(*sh).end()); + std::vector vh(stree.simplex_vertex_range(*sh).begin(), stree.simplex_vertex_range(*sh).end()); std::vector safe_vh(safe_stree.simplex_vertex_range(*sh_safe).begin(), safe_stree.simplex_vertex_range(*sh_safe).end()); -- cgit v1.2.3