From 04ad0af983800e1b59ef95b788b19cb1284d739a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 25 Sep 2013 15:08:09 +0200 Subject: [PATCH] Trivial bug-fix: use FT(n) instead of (FT)n.0 In our concepts, (FT)0.0 and (FT)1.0 (conversion from doubles) are not always allowed, but the construction of an FT from an integer is in the concept FieldNumberType (because it refines IntegralDomainWithoutDivision, that refines FromIntConstructible). The testsuite of PCA passes on my machine, and the bug "fix" is trivial. Approved for CGAL-4.3 by the Release Manager. --- Principal_component_analysis/include/CGAL/PCA_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Principal_component_analysis/include/CGAL/PCA_util.h b/Principal_component_analysis/include/CGAL/PCA_util.h index 58832112ce9..5a4b3b5e0ee 100644 --- a/Principal_component_analysis/include/CGAL/PCA_util.h +++ b/Principal_component_analysis/include/CGAL/PCA_util.h @@ -696,7 +696,7 @@ fitting_plane_3(const typename K::FT covariance[6], // covariance matrix // assemble a default horizontal plane that goes // through the centroid. plane = Plane(c,Vector(FT(0),FT(0),FT(1))); - return (FT)0.0; + return FT(0); } else // regular and line case { @@ -704,7 +704,7 @@ fitting_plane_3(const typename K::FT covariance[6], // covariance matrix eigen_vectors[7], eigen_vectors[8]); plane = Plane(c,normal); - return (FT)1.0 - eigen_values[2] / eigen_values[1]; + return FT(1) - eigen_values[2] / eigen_values[1]; } // end regular case }