diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_circles_2.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_circles_2.h index f856fafccc4..73c4fd78ca7 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_circles_2.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_circles_2.h @@ -88,7 +88,7 @@ linear_least_squares_fitting_2(InputIterator first, 0.0, radius}; Matrix transformation = init_matrix(2,delta); FT area = t.squared_radius(); - CGAL_assertion(area != 0.0); + CGAL_assertion(!CGAL::is_zero(area)); // Find the 2nd order moment for the circle wrt to the origin by an affine transformation. @@ -194,7 +194,7 @@ linear_least_squares_fitting_2(InputIterator first, 0.0, radius}; Matrix transformation = init_matrix(2,delta); FT length = 2 * radius; - CGAL_assertion(length != FT(0)); + CGAL_assertion(!CGAL::is_zero(length)); // Find the 2nd order moment for the circle wrt to the origin by an affine transformation. diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_rectangles_2.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_rectangles_2.h index 48e441e9ca5..f5d2b3f9a21 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_rectangles_2.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_rectangles_2.h @@ -93,7 +93,7 @@ linear_least_squares_fitting_2(InputIterator first, Matrix transformation = init_matrix(2,delta); FT area = (x1-x0)*(y2-y0); - CGAL_assertion(area != FT(0)); + CGAL_assertion(!CGAL::is_zero(area)); // Find the 2nd order moment for the rectangle wrt to the origin by an affine transformation. @@ -111,7 +111,7 @@ linear_least_squares_fitting_2(InputIterator first, mass += area; } - CGAL_assertion_msg (mass != FT(0), "Can't compute PCA of null measure."); + CGAL_assertion_msg (!CGAL::is_zero(mass), "Can't compute PCA of null measure."); // Translate the 2nd order moment calculated about the origin to // the center of mass to get the covariance. diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h index b35d3742583..8f4392c30be 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h @@ -85,7 +85,7 @@ linear_least_squares_fitting_2(InputIterator first, Matrix transformation = init_matrix(2,delta); using std::sqrt; FT length = CGAL::approximate_sqrt(t.squared_length()); - CGAL_assertion(length != FT(0)); + CGAL_assertion(!CGAL::is_zero(length)); // Find the 2nd order moment for the segment wrt to the origin by an affine transformation. diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_2.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_2.h index 8f78ea09ea0..7a92b5ace24 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_2.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_2.h @@ -89,7 +89,7 @@ linear_least_squares_fitting_2(InputIterator first, Matrix transformation = init_matrix(2,delta); FT area = FT(0.5) * CGAL::abs(LA::determinant(transformation)); - CGAL_assertion(area!=FT(0)); + CGAL_assertion(!CGAL::is_zero(area)); // Find the 2nd order moment for the triangle wrt to the origin by an affine transformation. @@ -108,7 +108,7 @@ linear_least_squares_fitting_2(InputIterator first, mass += area; } - CGAL_assertion_msg (mass != FT(0), "Can't compute PCA of null measure."); + CGAL_assertion_msg (!CGAL::is_zero(mass), "Can't compute PCA of null measure."); // Translate the 2nd order moment calculated about the origin to // the center of mass to get the covariance.