diff --git a/Principal_component_analysis/include/CGAL/PCA_tags.h b/Principal_component_analysis/include/CGAL/PCA_tags.h index d7ac35e7791..ecf3ed1c50c 100644 --- a/Principal_component_analysis/include/CGAL/PCA_tags.h +++ b/Principal_component_analysis/include/CGAL/PCA_tags.h @@ -42,6 +42,30 @@ struct PCA_dimension_1_tag {}; // For the vertices of objects. struct PCA_dimension_0_tag {}; +//:::::::::::::::::::::::::::::::::::::::::::::::::::::: +// Struct to denote dimension compile time decisions +//:::::::::::::::::::::::::::::::::::::::::::::::::::::: + +template +struct PCA_default_dimension{}; + +template < typename K > +struct PCA_default_dimension { + typedef CGAL::PCA_dimension_0_tag Tag; +}; + +template < typename K > +struct PCA_default_dimension { + typedef CGAL::PCA_dimension_1_tag Tag; +}; + +template < typename K > +struct PCA_default_dimension { + typedef CGAL::PCA_dimension_2_tag Tag; +}; + + CGAL_END_NAMESPACE #endif // CGAL_LINEAR_LEAST_SQUARES_FITTING_TAGS_H diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_2.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_2.h index 4f3ec979a37..acbe2fd29e7 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_2.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_2.h @@ -43,10 +43,9 @@ linear_least_squares_fitting_2(InputIterator first, typename K::Line_2& line, typename K::Point_2& centroid, const K& k, - const tag& t) + const tag& t) { typedef typename std::iterator_traits::value_type Value_type; - // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); return CGALi::linear_least_squares_fitting_2(first, beyond, line, centroid, k, (Value_type*) NULL, t); } @@ -59,7 +58,7 @@ linear_least_squares_fitting_2(InputIterator first, InputIterator beyond, typename K::Line_2& line, const K& k, - const tag& t) + const tag& t) { typedef typename std::iterator_traits::value_type Value_type; // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); @@ -71,37 +70,39 @@ linear_least_squares_fitting_2(InputIterator first, // deduces the kernel from the points in container. template < typename InputIterator, typename Line, - typename tag> + typename tag> inline typename Kernel_traits::Kernel::FT linear_least_squares_fitting_2(InputIterator first, InputIterator beyond, Line& line, typename Kernel_traits::Kernel::Point_2& centroid, - const tag& t) + const tag& t) { typedef typename std::iterator_traits::value_type Value_type; - // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); typedef typename Kernel_traits::Kernel K; return CGAL::linear_least_squares_fitting_2(first,beyond,line,centroid,K(), t); } // does not return the centroid and deduces the kernel as well. template < typename InputIterator, - typename Line, typename tag > + typename Line, + typename tag > inline typename Kernel_traits::Kernel::FT linear_least_squares_fitting_2(InputIterator first, InputIterator beyond, Line& line, - const tag& t) + const tag& t) { typedef typename std::iterator_traits::value_type Value_type; typedef typename Kernel_traits::Kernel K; - // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); return CGAL::linear_least_squares_fitting_2(first,beyond,line,K(), t); } CGAL_END_NAMESPACE + // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); + + #endif // CGAL_LINEAR_LEAST_SQUARES_FITTING_2_H diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_3.h index 756c2ca2c9d..990a6968675 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_3.h @@ -46,10 +46,9 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Plane_3& plane, typename K::Point_3& centroid, const K& k, - const tag& t) + const tag& t) { typedef typename std::iterator_traits::value_type Value_type; - // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); return CGALi::linear_least_squares_fitting_3(first, beyond, plane, centroid, k, (Value_type*) NULL, t); } @@ -63,7 +62,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Line_3& line, typename K::Point_3& centroid, const K& k, - const tag& t) + const tag& t) { typedef typename std::iterator_traits::value_type Value_type; // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); @@ -79,7 +78,7 @@ linear_least_squares_fitting_3(InputIterator first, InputIterator beyond, typename K::Plane_3& plane, const K& k, - const tag& t) + const tag& t) { typedef typename std::iterator_traits::value_type Value_type; // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); @@ -96,16 +95,15 @@ linear_least_squares_fitting_3(InputIterator first, InputIterator beyond, typename K::Line_3& line, const K& k, - const tag& t) + const tag& t) { typedef typename std::iterator_traits::value_type Value_type; - // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); typename K::Point_3 centroid; return CGALi::linear_least_squares_fitting_3(first, beyond, line, centroid, k,(Value_type*) NULL, t); } -// deduces the kernel from the points in container. +// deduces kernel template < typename InputIterator, typename Object, typename tag> @@ -115,14 +113,14 @@ linear_least_squares_fitting_3(InputIterator first, InputIterator beyond, Object& object, typename Kernel_traits::Kernel::Point_3& centroid, - const tag& t) + const tag& t) { typedef typename std::iterator_traits::value_type Value_type; - // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); typedef typename Kernel_traits::Kernel K; return CGAL::linear_least_squares_fitting_3(first,beyond,object,centroid,K(), t); } +/* // does not return the centroid and deduces the kernel as well. template < typename InputIterator, typename Object, typename tag > @@ -131,7 +129,7 @@ typename Kernel_traits::Kernel::FT linear_least_squares_fitting_3(InputIterator first, InputIterator beyond, Object& object, - const tag& t) + const tag& t) { typedef typename std::iterator_traits::value_type Value_type; // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); @@ -139,6 +137,40 @@ linear_least_squares_fitting_3(InputIterator first, return CGAL::linear_least_squares_fitting_3(first,beyond,object,K(), t); } +// default tag +template < typename InputIterator, + typename Object > +inline +typename Kernel_traits::Kernel::FT +linear_least_squares_fitting_3(InputIterator first, + InputIterator beyond, + Object& object) +{ + typedef typename std::iterator_traits::value_type Value_type; + typedef typename Kernel_traits::Kernel K; + return CGAL::linear_least_squares_fitting_3(first,beyond,object,K()); +} +*/ + +// does not return the centroid and deduces the kernel as well. +template < typename InputIterator, + typename Object, + typename tag = typename PCA_default_dimension< typename std::iterator_traits::value_type >::Tag> +inline +typename Kernel_traits::Kernel::FT +linear_least_squares_fitting_3(InputIterator first, + InputIterator beyond, + Object& object, + const tag& t = tag()) +{ + typedef typename std::iterator_traits::value_type Value_type; + typedef typename Kernel_traits::Kernel K; + return CGAL::linear_least_squares_fitting_3(first,beyond,object,K(), t); +} + + // BOOST_STATIC_ASSERT((boost::is_same::Algebraic_category,CGAL::Field_with_sqrt_tag>::value)); + + CGAL_END_NAMESPACE #endif // CGAL_LINEAR_LEAST_SQUARES_FITTING_3_H diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h index 45da055a06a..c7b53572b08 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h @@ -41,7 +41,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Iso_cuboid_3*, // used for indirection - const CGAL::PCA_dimension_3_tag& tag) + const CGAL::PCA_dimension_3_tag& tag = CGAL::PCA_dimension_3_tag()) { typedef typename K::FT FT; typedef typename K::Iso_cuboid_3 Iso_cuboid; @@ -72,7 +72,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Iso_cuboid_3*, // used for indirection - const CGAL::PCA_dimension_2_tag& tag) + const CGAL::PCA_dimension_2_tag& tag) { typedef typename K::FT FT; typedef typename K::Iso_cuboid_3 Iso_cuboid; @@ -103,7 +103,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Iso_cuboid_3*, // used for indirection - const CGAL::PCA_dimension_1_tag& tag) + const CGAL::PCA_dimension_1_tag& tag) { typedef typename K::FT FT; typedef typename K::Iso_cuboid_3 Iso_cuboid; @@ -147,7 +147,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Iso_cuboid_3*, // used for indirection - const CGAL::PCA_dimension_0_tag& tag) + const CGAL::PCA_dimension_0_tag& tag) { typedef typename K::FT FT; typedef typename K::Iso_cuboid_3 Iso_cuboid; @@ -183,7 +183,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Iso_cuboid_3*, // used for indirection - const CGAL::PCA_dimension_3_tag& tag) + const CGAL::PCA_dimension_3_tag& tag = CGAL::PCA_dimension_3_tag()) { typedef typename K::FT FT; typedef typename K::Iso_cuboid_3 Iso_cuboid; @@ -213,7 +213,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Iso_cuboid_3*, // used for indirection - const CGAL::PCA_dimension_2_tag& tag) + const CGAL::PCA_dimension_2_tag& tag) { typedef typename K::FT FT; typedef typename K::Iso_cuboid_3 Iso_cuboid; @@ -244,7 +244,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Iso_cuboid_3*, // used for indirection - const CGAL::PCA_dimension_1_tag& tag) + const CGAL::PCA_dimension_1_tag& tag) { typedef typename K::FT FT; typedef typename K::Iso_cuboid_3 Iso_cuboid; @@ -288,7 +288,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Iso_cuboid_3*, // used for indirection - const CGAL::PCA_dimension_0_tag& tag) + const CGAL::PCA_dimension_0_tag& tag) { typedef typename K::FT FT; typedef typename K::Iso_cuboid_3 Iso_cuboid; diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_2.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_2.h index 20810a10bda..d2592e62e9d 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_2.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_2.h @@ -45,7 +45,7 @@ linear_least_squares_fitting_2(InputIterator first, typename K::Point_2& c, // centroid const K&, // kernel const typename K::Point_2*,// used for indirection - const CGAL::PCA_dimension_0_tag& t) + const CGAL::PCA_dimension_0_tag& tag = CGAL::PCA_dimension_0_tag()) { // types typedef typename K::FT FT; diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_3.h index 2b7ccd14c4e..5568c072179 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_3.h @@ -43,7 +43,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Point_3*, // used for indirection - const CGAL::PCA_dimension_0_tag& tag) + const CGAL::PCA_dimension_0_tag& tag = CGAL::PCA_dimension_0_tag()) { typedef typename K::FT FT; typedef typename K::Point_3 Point; @@ -77,7 +77,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Point_3*, // used for indirection - const CGAL::PCA_dimension_0_tag& tag) + const CGAL::PCA_dimension_0_tag& tag = CGAL::PCA_dimension_0_tag) { typedef typename K::FT FT; typedef typename K::Point_3 Point; 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 6f6e1574592..c347bb2ff66 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 @@ -48,7 +48,7 @@ linear_least_squares_fitting_2(InputIterator first, typename K::Point_2& c, // centroid const K&, // kernel const typename K::Iso_rectangle_2*,// used for indirection - const CGAL::PCA_dimension_2_tag& tag) + const CGAL::PCA_dimension_2_tag& tag = CGAL::PCA_dimension_2_tag()) { // types typedef typename K::FT FT; @@ -124,20 +124,17 @@ linear_least_squares_fitting_2(InputIterator first, covariance[1] += mass * (-1.0 * c.x() * c.y()); covariance[2] += mass * (-1.0 * c.y() * c.y()); - // to remove later - // std::cout< eigen_values; std::pair eigen_vectors; - // CGALi::eigen_symmetric_2(final_cov, eigen_vectors, eigen_values); FT eigen_vectors1[4]; FT eigen_values1[2]; eigen_symmetric(covariance,2, eigen_vectors1, eigen_values1); eigen_values = std::make_pair(eigen_values1[0],eigen_values1[1]); eigen_vectors = std::make_pair(Vector(eigen_vectors1[0],eigen_vectors1[1]),Vector(eigen_vectors1[2],eigen_vectors1[3])); + // check unicity and build fitting line accordingly if(eigen_values.first != eigen_values.second) { @@ -163,7 +160,7 @@ linear_least_squares_fitting_2(InputIterator first, typename K::Point_2& c, // centroid const K&, // kernel const typename K::Iso_rectangle_2*,// used for indirection - const CGAL::PCA_dimension_1_tag& tag) + const CGAL::PCA_dimension_1_tag& tag) { // types typedef typename K::Iso_rectangle_2 Iso_rectangle; @@ -189,7 +186,9 @@ linear_least_squares_fitting_2(InputIterator first, } // end linear_least_squares_fitting_2 for rectangle set with 1D tag -template < typename InputIterator, typename K > + +template < typename InputIterator, + typename K > typename K::FT linear_least_squares_fitting_2(InputIterator first, InputIterator beyond, @@ -197,7 +196,7 @@ linear_least_squares_fitting_2(InputIterator first, typename K::Point_2& c, // centroid const K&, // kernel const typename K::Iso_rectangle_2*,// used for indirection - const CGAL::PCA_dimension_0_tag& tag) + const CGAL::PCA_dimension_0_tag& tag) { // types typedef typename K::Iso_rectangle_2 Iso_rectangle; 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 2880c85c07c..c97e57e2f75 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 @@ -48,7 +48,7 @@ linear_least_squares_fitting_2(InputIterator first, typename K::Point_2& c, // centroid const K&, // kernel const typename K::Segment_2*,// used for indirection - const CGAL::PCA_dimension_1_tag& tag) + const CGAL::PCA_dimension_1_tag& tag = CGAL::PCA_dimension_1_tag()) { // types typedef typename K::FT FT; @@ -73,8 +73,7 @@ linear_least_squares_fitting_2(InputIterator first, FT covariance[3] = {0.0,0.0,0.0}; // assemble 2nd order moment about the origin. - FT temp[4] = {1.0, 0.5, - 0.5, 1.0}; + FT temp[4] = {1.0, 0.5, 0.5, 1.0}; Matrix moment = (1.0/3.0) * init_matrix(2,temp); for(InputIterator it = first; @@ -148,7 +147,7 @@ linear_least_squares_fitting_2(InputIterator first, typename K::Point_2& c, // centroid const K& k, // kernel const typename K::Segment_2*,// used for indirection - const CGAL::PCA_dimension_0_tag& tag) + const CGAL::PCA_dimension_0_tag& tag) { // types typedef typename K::Point_2 Point; diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h index 59651a5d839..cace4d3d298 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h @@ -41,7 +41,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Segment_3*, // used for indirection - const CGAL::PCA_dimension_1_tag& tag) + const CGAL::PCA_dimension_1_tag& tag = CGAL::PCA_dimension_1_tag()) { typedef typename K::FT FT; typedef typename K::Segment_3 Segment; @@ -71,7 +71,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Segment_3*, // used for indirection - const CGAL::PCA_dimension_0_tag& tag) + const CGAL::PCA_dimension_0_tag& tag) { typedef typename K::FT FT; typedef typename K::Segment_3 Segment; @@ -105,7 +105,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Segment_3*, // used for indirection - const CGAL::PCA_dimension_1_tag& tag) + const CGAL::PCA_dimension_1_tag& tag = CGAL::PCA_dimension_1_tag()) { typedef typename K::FT FT; typedef typename K::Segment_3 Segment; @@ -135,7 +135,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Segment_3*, // used for indirection - const CGAL::PCA_dimension_0_tag& tag) + const CGAL::PCA_dimension_0_tag& tag) { typedef typename K::FT FT; typedef typename K::Segment_3 Segment; diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_spheres_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_spheres_3.h index 3b558095098..d4529fa23f6 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_spheres_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_spheres_3.h @@ -31,7 +31,7 @@ CGAL_BEGIN_NAMESPACE namespace CGALi { -// fits a plane to a 3D sphere set +// fits a plane to a set of 3D balls (3D) template < typename InputIterator, typename K > typename K::FT @@ -41,7 +41,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Sphere_3*, // used for indirection - const CGAL::PCA_dimension_3_tag& tag) + const CGAL::PCA_dimension_3_tag& tag = CGAL::PCA_dimension_3_tag()) { typedef typename K::FT FT; typedef typename K::Sphere_3 Sphere; @@ -71,7 +71,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Sphere_3*, // used for indirection - const CGAL::PCA_dimension_2_tag& tag) + const CGAL::PCA_dimension_2_tag& tag) { typedef typename K::FT FT; typedef typename K::Sphere_3 Sphere; @@ -91,7 +91,8 @@ linear_least_squares_fitting_3(InputIterator first, } // end linear_least_squares_fitting_spheres_3 -// fits a line to a 3D sphere set + +// fits a line to a 3D ball set template < typename InputIterator, typename K > typename K::FT @@ -101,7 +102,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Sphere_3*, // used for indirection - const CGAL::PCA_dimension_3_tag& tag) + const CGAL::PCA_dimension_3_tag& tag = CGAL::PCA_dimension_3_tag()) { typedef typename K::FT FT; typedef typename K::Sphere_3 Sphere; @@ -132,7 +133,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Sphere_3*, // used for indirection - const CGAL::PCA_dimension_2_tag& tag) + const CGAL::PCA_dimension_2_tag& tag) { typedef typename K::FT FT; typedef typename K::Sphere_3 Sphere; diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h index 451a933f067..f343882861c 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h @@ -41,7 +41,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Tetrahedron_3*, // used for indirection - const CGAL::PCA_dimension_3_tag& tag) + const CGAL::PCA_dimension_3_tag& tag = CGAL::PCA_dimension_3_tag()) { typedef typename K::FT FT; typedef typename K::Tetrahedron_3 Tetrahedron; @@ -72,7 +72,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Tetrahedron_3*, // used for indirection - const CGAL::PCA_dimension_2_tag& tag) + const CGAL::PCA_dimension_2_tag& tag) { typedef typename K::FT FT; typedef typename K::Tetrahedron_3 Tetrahedron; @@ -182,7 +182,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Tetrahedron_3*, // used for indirection - const CGAL::PCA_dimension_3_tag& tag) + const CGAL::PCA_dimension_3_tag& tag = CGAL::PCA_dimension_3_tag()) { typedef typename K::FT FT; typedef typename K::Tetrahedron_3 Tetrahedron; diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h index 977df79b9ea..2b15bb8f397 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h @@ -41,7 +41,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Triangle_3*, // used for indirection - const CGAL::PCA_dimension_2_tag& tag) + const CGAL::PCA_dimension_2_tag& tag = CGAL::PCA_dimension_2_tag()) { typedef typename K::FT FT; typedef typename K::Triangle_3 Triangle; @@ -71,7 +71,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Triangle_3*, // used for indirection - const CGAL::PCA_dimension_1_tag& tag) + const CGAL::PCA_dimension_1_tag& tag) { typedef typename K::FT FT; typedef typename K::Triangle_3 Triangle; @@ -106,7 +106,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Triangle_3*, // used for indirection - const CGAL::PCA_dimension_0_tag& tag) + const CGAL::PCA_dimension_0_tag& tag) { typedef typename K::FT FT; typedef typename K::Triangle_3 Triangle; @@ -141,7 +141,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Triangle_3*, // used for indirection - const CGAL::PCA_dimension_2_tag& tag) + const CGAL::PCA_dimension_2_tag& tag = CGAL::PCA_dimension_2_tag()) { typedef typename K::FT FT; typedef typename K::Triangle_3 Triangle; @@ -171,7 +171,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Triangle_3*, // used for indirection - const CGAL::PCA_dimension_1_tag& tag) + const CGAL::PCA_dimension_1_tag& tag) { typedef typename K::FT FT; typedef typename K::Triangle_3 Triangle; @@ -206,7 +206,7 @@ linear_least_squares_fitting_3(InputIterator first, typename K::Point_3& c, // centroid const K& k, // kernel const typename K::Triangle_3*, // used for indirection - const CGAL::PCA_dimension_0_tag& tag) + const CGAL::PCA_dimension_0_tag& tag) { typedef typename K::FT FT; typedef typename K::Triangle_3 Triangle;