summaryrefslogtreecommitdiff
path: root/src/Alpha_complex/include/gudhi/Alpha_complex.h
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-11-05 20:49:14 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-11-05 20:49:14 +0100
commit0f6714990421d967a5e76676920ab190acc61364 (patch)
tree6243e8a79b4f08f51166f03545d43381f30f5ff4 /src/Alpha_complex/include/gudhi/Alpha_complex.h
parent16d84f8c33fe5bdb3b9b5ac14ed13004332a76de (diff)
Exact version only for CGAL < 5.X
Diffstat (limited to 'src/Alpha_complex/include/gudhi/Alpha_complex.h')
-rw-r--r--src/Alpha_complex/include/gudhi/Alpha_complex.h8
1 files changed, 7 insertions, 1 deletions
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