From 482f5ef2d8bdac129d6f93da4a02f0c61c397717 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Tue, 7 Jul 2020 23:17:19 +0200 Subject: [PATCH] Document Power_center_d, Power_distance_d (renamed) --- Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h | 17 +++++++++++++++++ Kernel_d/doc/Kernel_d/CGAL/Epick_d.h | 17 +++++++++++++++++ .../CGAL/NewKernel_d/Kernel_d_interface.h | 4 ++-- NewKernel_d/test/NewKernel_d/Epick_d.cpp | 2 +- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h b/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h index eb43e4c69e9..aef8bea9360 100644 --- a/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h +++ b/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h @@ -149,9 +149,26 @@ public: template Bounded_side operator()(ForwardIterator first, ForwardIterator last, const Weighted_point_d&p); }; +class Power_center_d { +public: +/*! returns a weighted point on the affine hull of the weighted points of `A=tuple[first,last)` at power distance 0 of each of them. In other words, this returns the smallest sphere orthogonal to the spheres of A. + \pre A is affinely independent. + \tparam ForwardIterator has `Epeck_d::Weighted_point_d` as value type. + */ +template +Weighted_point_d operator()(ForwardIterator first, ForwardIterator last); +}; +class Compute_power_product_d { +public: +/*! returns the power product (aka power distance) of the weighted points `pw` and `qw`, that is, the squared Euclidean distance between the points minus their weights. + */ +FT operator()(Weighted_point_d pw, Weighted_point_d qw); +}; Construct_circumcenter_d construct_circumcenter_d_object(); +Compute_power_product_d compute_power_product_d_object(); Compute_squared_radius_d compute_squared_radius_d_object(); Compute_squared_radius_smallest_orthogonal_sphere_d compute_squared_radius_smallest_orthogonal_sphere_d_object(); +Power_center_d power_center_d_object(); Power_side_of_bounded_power_sphere_d power_side_of_bounded_power_sphere_d_object(); }; /* end Epeck_d */ } /* end namespace CGAL */ diff --git a/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h b/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h index 50295d58d96..15ed831c47f 100644 --- a/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h +++ b/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h @@ -138,9 +138,26 @@ public: template Bounded_side operator()(ForwardIterator first, ForwardIterator last, const Weighted_point_d&p); }; +class Power_center_d { +public: +/*! returns a weighted point on the affine hull of the weighted points of `A=tuple[first,last)` at power distance 0 of each of them. In other words, this returns the smallest sphere orthogonal to the spheres of A. + \pre A is affinely independent. + \tparam ForwardIterator has `Epick_d::Weighted_point_d` as value type. + */ +template +Weighted_point_d operator()(ForwardIterator first, ForwardIterator last); +}; +class Compute_power_product_d { +public: +/*! returns the power product (aka power distance) of the weighted points `pw` and `qw`, that is, the squared Euclidean distance between the points minus their weights. + */ +FT operator()(Weighted_point_d pw, Weighted_point_d qw); +}; Construct_circumcenter_d construct_circumcenter_d_object(); +Compute_power_product_d compute_power_product_d_object(); Compute_squared_radius_d compute_squared_radius_d_object(); Compute_squared_radius_smallest_orthogonal_sphere_d compute_squared_radius_smallest_orthogonal_sphere_d_object(); +Power_center_d power_center_d_object(); Power_side_of_bounded_power_sphere_d power_side_of_bounded_power_sphere_d_object(); }; /* end Epick_d */ } /* end namespace CGAL */ diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Kernel_d_interface.h b/NewKernel_d/include/CGAL/NewKernel_d/Kernel_d_interface.h index 23e2fad48d0..c86920db142 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Kernel_d_interface.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Kernel_d_interface.h @@ -60,7 +60,7 @@ template struct Kernel_d_interface : public Base_ { typedef typename Get_functor::type Power_side_of_power_sphere_d; typedef typename Get_functor::type Power_side_of_bounded_power_sphere_d; typedef typename Get_functor::type Power_center_d; - typedef typename Get_functor::type Power_distance_d; + typedef typename Get_functor::type Compute_power_product_d; typedef typename Get_functor::type Contained_in_affine_hull_d; typedef typename Get_functor::type Construct_flat_orientation_d; typedef typename Get_functor::type In_flat_orientation_d; @@ -223,7 +223,7 @@ template struct Kernel_d_interface : public Base_ { Power_side_of_power_sphere_d power_side_of_power_sphere_d_object()const{ return Power_side_of_power_sphere_d(*this); } Power_side_of_bounded_power_sphere_d power_side_of_bounded_power_sphere_d_object()const{ return Power_side_of_bounded_power_sphere_d(*this); } Power_center_d power_center_d_object()const{ return Power_center_d(*this); } - Power_distance_d power_distance_d_object()const{ return Power_distance_d(*this); } + Compute_power_product_d compute_power_product_d_object()const{ return Compute_power_product_d(*this); } Side_of_bounded_sphere_d side_of_bounded_sphere_d_object()const{ return Side_of_bounded_sphere_d(*this); } Contained_in_affine_hull_d contained_in_affine_hull_d_object()const{ return Contained_in_affine_hull_d(*this); } Contained_in_linear_hull_d contained_in_linear_hull_d_object()const{ return Contained_in_linear_hull_d(*this); } diff --git a/NewKernel_d/test/NewKernel_d/Epick_d.cpp b/NewKernel_d/test/NewKernel_d/Epick_d.cpp index 3a3b150432f..5ccdf19920f 100644 --- a/NewKernel_d/test/NewKernel_d/Epick_d.cpp +++ b/NewKernel_d/test/NewKernel_d/Epick_d.cpp @@ -142,7 +142,7 @@ void test2(){ typedef typename K1::Compute_squared_radius_d SR; typedef typename K1::Translated_point_d TP; typedef typename K1::Power_center_d PC; - typedef typename K1::Power_distance_d PoD; + typedef typename K1::Compute_power_product_d PoD; typedef typename K1::Construct_weighted_point_d CWP; typedef typename K1::Power_side_of_bounded_power_sphere_d PSBPS; typedef typename K1::Compute_squared_radius_smallest_orthogonal_sphere_d CSRSOS;