From 0f6714990421d967a5e76676920ab190acc61364 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Tue, 5 Nov 2019 20:49:14 +0100 Subject: Exact version only for CGAL < 5.X --- src/Alpha_complex/include/gudhi/Alpha_complex.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Alpha_complex/include/gudhi') diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex.h b/src/Alpha_complex/include/gudhi/Alpha_complex.h index 4e0e5159..22e17226 100644 --- a/src/Alpha_complex/include/gudhi/Alpha_complex.h +++ b/src/Alpha_complex/include/gudhi/Alpha_complex.h @@ -338,12 +338,18 @@ class Alpha_complex { if (f_simplex_dim > 0) { // squared_radius function initialization Squared_Radius squared_radius = kernel_.compute_squared_radius_d_object(); - + +#if CGAL_VERSION_NR < 1050000000 + // With CGAL >= 4.11 and < 5.X, CGAL::exact do not work as it is always exact values + // This is why it is slow and 5.X is advised + alpha_complex_filtration = CGAL::to_double(squared_radius(pointVector.begin(), pointVector.end())); +#else // CGAL_VERSION_NR < 1050000000 if (exact) { alpha_complex_filtration = CGAL::to_double(CGAL::exact(squared_radius(pointVector.begin(), pointVector.end()))); } else { alpha_complex_filtration = CGAL::to_double(squared_radius(pointVector.begin(), pointVector.end())); } +#endif //CGAL_VERSION_NR < 1050000000 } complex.assign_filtration(f_simplex, alpha_complex_filtration); #ifdef DEBUG_TRACES -- cgit v1.2.3