From aec7ab1737a5284f4b7c2d1f7fe3eb7977df7537 Mon Sep 17 00:00:00 2001 From: Hind-M Date: Tue, 26 Apr 2022 16:52:26 +0200 Subject: Modify cech doc Use Filtration_value instead of double for casting Use a templated range of points instead of vector in cech constructor Capitalize sphere_circumradius.h file name and make it private in doc --- src/Cech_complex/include/gudhi/Cech_complex_blocker.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/Cech_complex/include/gudhi/Cech_complex_blocker.h') diff --git a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h index 1a696422..1a09f7e1 100644 --- a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h +++ b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h @@ -11,7 +11,7 @@ #ifndef CECH_COMPLEX_BLOCKER_H_ #define CECH_COMPLEX_BLOCKER_H_ -#include // for casting from FT to double +#include // for casting from FT to Filtration_value and double to FT #include #include @@ -36,7 +36,7 @@ namespace cech_complex { * * \tparam Cech_complex is required by the blocker. * - * \tparam Kernel CGAL kernel. + * \tparam Kernel CGAL kernel: either Epick_d or Epeck_d. */ template class Cech_blocker { @@ -69,8 +69,8 @@ class Cech_blocker { * \return true if the simplex radius is greater than the Cech_complex max_radius*/ bool operator()(Simplex_handle sh) { using Point_cloud = std::vector; - CGAL::NT_converter cast_to_double; - Filtration_value radius = 0.; + CGAL::NT_converter cast_to_fv; + Filtration_value radius = 0; // 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 Sphere min_enclos_ball; @@ -105,18 +105,18 @@ class Cech_blocker { face_points.clear(); if (kernel_.squared_distance_d_object()(sph.first, cc_ptr_->get_point(extra)) <= sph.second) { - radius = std::sqrt(cast_to_double(sph.second)); + radius = std::sqrt(cast_to_fv(sph.second)); #ifdef DEBUG_TRACES std::clog << "center: " << sph.first << ", radius: " << radius << std::endl; #endif // DEBUG_TRACES - if (cast_to_double(sph.second) < cast_to_double(min_enclos_ball.second)) + if (sph.second < min_enclos_ball.second) min_enclos_ball = sph; break; } } // Get the minimal radius of all faces enclosing balls if exists - if(cast_to_double(min_enclos_ball.second) != std::numeric_limits::max()) { - radius = std::sqrt(cast_to_double(min_enclos_ball.second)); + if(min_enclos_ball.second != std::numeric_limits::max()) { + radius = std::sqrt(cast_to_fv(min_enclos_ball.second)); sc_ptr_->assign_key(sh, cc_ptr_->get_cache().size()); cc_ptr_->get_cache().push_back(min_enclos_ball); @@ -128,7 +128,7 @@ class Cech_blocker { points.push_back(cc_ptr_->get_point(vertex)); } Sphere sph = get_sphere(points.cbegin(), points.cend()); - radius = std::sqrt(cast_to_double(sph.second)); + 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); -- cgit v1.2.3