From 34b13affef0010eccd19f7778259e664b030f691 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 17 Sep 2013 10:58:38 +0200 Subject: [PATCH 1/2] Try to "fix" an assertion that compares a computed value to another On the paper, dleft_frac must be greater that 1.0. But with rounding errors, it can be slightly lower. Let's try to compare it with 1.0-2*ulp(1.0). I do not like that sort of hack but I do not know what to do best. --- Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index c575c1986e5..d890e40cda5 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -30,6 +30,9 @@ #include #include +#ifndef CGAL_NO_ASSERTIONS +# include // for float_prior +#endif namespace CGAL { namespace Mesh_3 { @@ -981,7 +984,9 @@ insert_balls(const Vertex_handle& vp, pt_dist = d_signF * step_size; norm_step_size = step_size; } else { - CGAL_assertion(n==0 || dleft_frac >= 1); + using boost::math::float_prior; + CGAL_assertion(n==0 || + dleft_frac >= float_prior(float_prior(1.))); } // Launch balls From 930a7862d461c4f0e60fb97db81c5ffeb2c98009 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 17 Sep 2013 11:10:42 +0200 Subject: [PATCH 2/2] Fix the patch when CGAL_NO_ASSERTIONS is defined. --- Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index d890e40cda5..6dd604a7c78 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -984,7 +984,7 @@ insert_balls(const Vertex_handle& vp, pt_dist = d_signF * step_size; norm_step_size = step_size; } else { - using boost::math::float_prior; + CGAL_assertion_code(using boost::math::float_prior); CGAL_assertion(n==0 || dleft_frac >= float_prior(float_prior(1.))); }