Using CGAL::is_zero

This commit is contained in:
G Yuvan Shankar 2022-01-25 19:00:25 +05:30
parent a2dd287a07
commit 3a254451e2
4 changed files with 7 additions and 7 deletions

View File

@ -88,7 +88,7 @@ linear_least_squares_fitting_2(InputIterator first,
0.0, radius};
Matrix transformation = init_matrix<FT>(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<FT>(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.

View File

@ -93,7 +93,7 @@ linear_least_squares_fitting_2(InputIterator first,
Matrix transformation = init_matrix<FT>(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.

View File

@ -85,7 +85,7 @@ linear_least_squares_fitting_2(InputIterator first,
Matrix transformation = init_matrix<FT>(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.

View File

@ -89,7 +89,7 @@ linear_least_squares_fitting_2(InputIterator first,
Matrix transformation = init_matrix<FT>(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.