diff options
author | Hind-M <hind.montassif@gmail.com> | 2022-04-27 17:08:14 +0200 |
---|---|---|
committer | Hind-M <hind.montassif@gmail.com> | 2022-04-27 17:08:14 +0200 |
commit | a14d9becec7361a2559fa239c1ca8f2c1b5c5768 (patch) | |
tree | 88e70e834eab2e7b78f208d1a38e973e9da2fe80 /src/Cech_complex/include/gudhi/Cech_complex_blocker.h | |
parent | 70c20c20f89e2037544e7906c5743a30a7e3beb7 (diff) |
Ultimately, we don't really need to store the min enclosing ball in case it
contains the extra point, a bool is enough
Diffstat (limited to 'src/Cech_complex/include/gudhi/Cech_complex_blocker.h')
-rw-r--r-- | src/Cech_complex/include/gudhi/Cech_complex_blocker.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h index 72876512..fb12946a 100644 --- a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h +++ b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h @@ -11,8 +11,7 @@ #ifndef CECH_COMPLEX_BLOCKER_H_ #define CECH_COMPLEX_BLOCKER_H_ -#include <CGAL/NT_converter.h> // for casting from FT to Filtration_value and double to FT -#include <boost/optional.hpp> +#include <CGAL/NT_converter.h> // for casting from FT to Filtration_value #include <iostream> #include <vector> @@ -72,9 +71,9 @@ class Cech_blocker { using Point_cloud = std::vector<Point_d>; CGAL::NT_converter<FT, Filtration_value> cast_to_fv; Filtration_value radius = 0; + bool is_min_enclos_ball = false; // for each face of simplex sh, test outsider point is indeed inside enclosing ball, if yes, take it and exit loop, otherwise, new sphere is circumsphere of all vertices - boost::optional<Sphere const&> min_enclos_ball; for (auto face : sc_ptr_->boundary_simplex_range(sh)) { // Find which vertex of sh is missing in face. We rely on the fact that simplex_vertex_range is sorted. auto longlist = sc_ptr_->simplex_vertex_range(sh); @@ -107,15 +106,15 @@ class Cech_blocker { #ifdef DEBUG_TRACES std::clog << "center: " << sph.first << ", radius: " << radius << std::endl; #endif // DEBUG_TRACES + is_min_enclos_ball = true; radius = std::sqrt(cast_to_fv(sph.second)); sc_ptr_->assign_key(sh, cc_ptr_->get_cache().size()); cc_ptr_->get_cache().push_back(sph); - min_enclos_ball.emplace(cc_ptr_->get_cache().back()); break; } } // Spheres of each face don't contain the whole simplex - if(!min_enclos_ball) { + if(!is_min_enclos_ball) { Point_cloud points; for (auto vertex : sc_ptr_->simplex_vertex_range(sh)) { points.push_back(cc_ptr_->get_point(vertex)); |