From bfd989dae36a22450c1da3dc21cea57bb7d2e96e Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 23 Nov 2018 10:49:43 +0000 Subject: Code review : Use CGAL::to_double(it->exact()) for Exact version, and CGAL::to_double(*it) otherwise git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alpha_complex_3d_module_vincent@4013 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 5ff40181e71c7df721df38fa90635cee8ab7e799 --- src/Alpha_complex/include/gudhi/Alpha_complex_3d.h | 32 ++++------------------ 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'src/Alpha_complex') diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h b/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h index b5d4201d..19445637 100644 --- a/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h +++ b/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h @@ -72,13 +72,10 @@ thread_local // Value_from_iterator returns the filtration value from an iterator on alpha shapes values // -// FAST SAFE EXACT -// not weighted and *iterator Specific case due to CGAL CGAL::to_double(iterator->exact()) -// not periodic issue # 3153 -// -// otherwise *iterator CGAL::to_double(*iterator) CGAL::to_double(iterator->exact()) +// FAST SAFE EXACT +// CGAL::to_double(*iterator) CGAL::to_double(*iterator) CGAL::to_double(iterator->exact()) -template +template struct Value_from_iterator { template static double perform(Iterator it) { @@ -88,28 +85,9 @@ struct Value_from_iterator { }; template <> -struct Value_from_iterator { - template - static double perform(Iterator it) { - // In SAFE mode, we are with Epeck with EXACT value set to CGAL::Tag_true. - // Specific case due to CGAL issue https://github.com/CGAL/cgal/issues/3153 - auto approx = it->approx(); - double r; - if (CGAL::fit_in_double(approx, r)) return r; - - // If it's precise enough, then OK. - if (CGAL::has_smaller_relative_precision(approx, RELATIVE_PRECISION_OF_TO_DOUBLE)) return CGAL::to_double(approx); - - it->exact(); - return CGAL::to_double(it->approx()); - } -}; - -template -struct Value_from_iterator{ +struct Value_from_iterator { template static double perform(Iterator it) { - // In EXACT mode, we are with Epeck, or with Epick and EXACT value set to CGAL::Tag_true. return CGAL::to_double(it->exact()); } }; @@ -568,7 +546,7 @@ private: } } // Construction of the simplex_tree - Filtration_value filtr = Value_from_iterator::perform(alpha_value_iterator); + Filtration_value filtr = Value_from_iterator::perform(alpha_value_iterator); #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; -- cgit v1.2.3