diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-11-23 10:49:43 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-11-23 10:49:43 +0000 |
commit | bfd989dae36a22450c1da3dc21cea57bb7d2e96e (patch) | |
tree | 51461185f148f2f5fab5318ead9cffaac4c84f7e /src | |
parent | 88a83fe20ce9100f2292c3945d26e4696fd2e7d2 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/Alpha_complex/include/gudhi/Alpha_complex_3d.h | 32 |
1 files changed, 5 insertions, 27 deletions
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 <complexity Complexity, bool Weighted_or_periodic> +template <complexity Complexity> struct Value_from_iterator { template <typename Iterator> static double perform(Iterator it) { @@ -88,28 +85,9 @@ struct Value_from_iterator { }; template <> -struct Value_from_iterator<complexity::SAFE, false> { - template <typename Iterator> - 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<bool Weighted_or_periodic> -struct Value_from_iterator<complexity::EXACT,Weighted_or_periodic>{ +struct Value_from_iterator<complexity::EXACT> { template <typename Iterator> 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<Complexity, (Weighted || Periodic)>::perform(alpha_value_iterator); + Filtration_value filtr = Value_from_iterator<Complexity>::perform(alpha_value_iterator); #ifdef DEBUG_TRACES std::cout << "filtration = " << filtr << std::endl; |