summaryrefslogtreecommitdiff
path: root/src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-09-25 16:05:33 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-09-25 16:05:33 +0000
commit7865ef2cc4abd972b2ba1eb50790912820fa2ee2 (patch)
tree58ee04316937d22d2f30eb0b3af5acb6cf5f40ee /src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp
parent5624cfc39b51dd7f201b11c45b5ca5f218591c04 (diff)
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
Diffstat (limited to 'src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp')
-rw-r--r--src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp234
1 files changed, 123 insertions, 111 deletions
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 <CGAL/Random.h>
#include <CGAL/point_generators_3.h>
-using Fast_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::FAST, false, false>;
-using Safe_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::SAFE, false, false>;
-using Exact_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::EXACT, false, false>;
-
-using Fast_weighted_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::FAST, true, false>;
-using Safe_weighted_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::SAFE, true, false>;
-using Exact_weighted_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::EXACT, true, false>;
-
-using Fast_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::FAST, false, true>;
-using Safe_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::SAFE, false, true>;
-using Exact_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::EXACT, false, true>;
-
-using Fast_weighted_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::FAST, true, true>;
-using Safe_weighted_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::SAFE, true, true>;
-using Exact_weighted_periodic_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::EXACT, true, true>;
+using Fast_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::FAST, false, false>;
+using Safe_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::SAFE, false, false>;
+using Exact_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::EXACT, false, false>;
+
+using Fast_weighted_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::FAST, true, false>;
+using Safe_weighted_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::SAFE, true, false>;
+using Exact_weighted_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::EXACT, true, false>;
+
+using Fast_periodic_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::FAST, false, true>;
+using Safe_periodic_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::SAFE, false, true>;
+using Exact_periodic_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::EXACT, false, true>;
+
+using Fast_weighted_periodic_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::FAST, true, true>;
+using Safe_weighted_periodic_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::SAFE, true, true>;
+using Exact_weighted_periodic_alpha_complex_3d =
+ Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::EXACT, true, true>;
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<int> simplex;
std::vector<int> 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<int> simplex;
std::vector<int> 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<Fast_weighted_alpha_complex_3d,
- Safe_weighted_alpha_complex_3d,
- Exact_weighted_alpha_complex_3d> weighted_variants_type_list;
+typedef boost::mpl::list<Fast_weighted_alpha_complex_3d, Safe_weighted_alpha_complex_3d,
+ Exact_weighted_alpha_complex_3d>
+ 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<double> 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_point_3> 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<int> simplex;
std::vector<int> 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<Fast_periodic_alpha_complex_3d,
- Safe_periodic_alpha_complex_3d,
- Exact_periodic_alpha_complex_3d> periodic_variants_type_list;
+typedef boost::mpl::list<Fast_periodic_alpha_complex_3d, Safe_periodic_alpha_complex_3d,
+ Exact_periodic_alpha_complex_3d>
+ 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<Fast_periodic_alpha_complex_3d::Point_3, Creator> in_cube(1, random);
std::vector<Fast_periodic_alpha_complex_3d::Point_3> 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<Exact_periodic_alpha_complex_3d::Point_3> 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<int> vh(stree.simplex_vertex_range(*sh).begin(),
- stree.simplex_vertex_range(*sh).end());
+ std::vector<int> vh(stree.simplex_vertex_range(*sh).begin(), stree.simplex_vertex_range(*sh).end());
std::vector<int> 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<Safe_periodic_alpha_complex_3d::Point_3> 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<int> vh(stree.simplex_vertex_range(*sh).begin(),
- stree.simplex_vertex_range(*sh).end());
+ std::vector<int> vh(stree.simplex_vertex_range(*sh).begin(), stree.simplex_vertex_range(*sh).end());
std::vector<int> 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<Fast_weighted_periodic_alpha_complex_3d, Exact_weighted_periodic_alpha_complex_3d,
- Safe_weighted_periodic_alpha_complex_3d> 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<Weighted_periodic_alpha_complex_3d::Point_3, Creator> in_cube(1, random);
std::vector<Weighted_periodic_alpha_complex_3d::Point_3> 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<Fast_weighted_periodic_alpha_complex_3d::Point_3, Creator> in_cube(1, random);
std::vector<Fast_weighted_periodic_alpha_complex_3d::Point_3> 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<Exact_weighted_periodic_alpha_complex_3d::Point_3> 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<int> vh(stree.simplex_vertex_range(*sh).begin(),
- stree.simplex_vertex_range(*sh).end());
+ std::vector<int> vh(stree.simplex_vertex_range(*sh).begin(), stree.simplex_vertex_range(*sh).end());
std::vector<int> 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<Safe_weighted_periodic_alpha_complex_3d::Point_3> 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<int> vh(stree.simplex_vertex_range(*sh).begin(),
- stree.simplex_vertex_range(*sh).end());
+ std::vector<int> vh(stree.simplex_vertex_range(*sh).begin(), stree.simplex_vertex_range(*sh).end());
std::vector<int> safe_vh(safe_stree.simplex_vertex_range(*sh_safe).begin(),
safe_stree.simplex_vertex_range(*sh_safe).end());