From 1d8779b171fb6cb18ea54c531fd08a4968a44ba6 Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Wed, 9 Apr 2008 13:35:34 +0000 Subject: [PATCH] Rename the following functions: det2x2_by_formula det3x3_by_formula det4x4_by_formula det5x5_by_formula det6x6_by_formula to: determinant How cute... a name independent of the dimension, and even readable ! --- ...ed_radius_smallest_orthogonalcircle_ftC2.h | 6 +- .../Apollonius_graph_2/Constructions_ftC2.h | 12 ++-- .../CGAL/Apollonius_graph_2/Incircle8_C2.h | 12 ++-- .../Infinite_edge_test_C2.h | 2 +- .../CGAL/Apollonius_graph_2/Orientation8_C2.h | 28 +++++----- .../CGAL/Apollonius_graph_2/Orientation_2.h | 4 +- .../Predicate_constructions_C2.h | 42 +++++++------- .../new_traits/Conflict_2.h | 14 ++--- Apollonius_graph_2/include/CGAL/Hyperbola_2.h | 2 +- Apollonius_graph_2/include/CGAL/Parabola_2.h | 2 +- .../CGAL/Cartesian/Aff_transformation_rep_3.h | 26 ++++----- .../include/CGAL/Cartesian/function_objects.h | 56 +++++++++---------- .../include/CGAL/constructions/kernel_ftC2.h | 8 +-- .../include/CGAL/constructions/kernel_ftC3.h | 24 ++++---- .../include/CGAL/predicates/kernel_ftC2.h | 36 ++++++------ .../include/CGAL/predicates/kernel_ftC3.h | 14 ++--- .../package_info/Cartesian_kernel/changes.txt | 2 +- .../include/CGAL/squared_distance_utils.h | 2 +- .../Static_filters/Coplanar_orientation_3.h | 2 +- .../Coplanar_side_of_bounded_circle_3.h | 4 +- .../CGAL/Static_filters/Orientation_2.h | 4 +- .../CGAL/Static_filters/Orientation_3.h | 4 +- .../Side_of_oriented_circle_2.h | 4 +- .../Side_of_oriented_sphere_3.h | 4 +- .../CGAL/Homogeneous/Aff_transformationH3.h | 28 +++++----- .../include/CGAL/Homogeneous/PlaneH3.h | 2 +- .../CGAL/Homogeneous/basic_constructionsH3.h | 8 +-- .../CGAL/Homogeneous/function_objects.h | 22 ++++---- ...s_for_voronoi_intersection_cartesian_2_3.h | 24 ++++---- Kernel_23/include/CGAL/Kernel/Wutils.h | 2 +- Kernel_23/include/CGAL/determinant.h | 10 ++-- .../CGAL/predicates/sign_of_determinant.h | 8 +-- Kernel_23/package_info/Kernel_23/changes.txt | 2 +- .../include/CGAL/_test_fct_determinant.h | 28 +++++----- .../update_Delaunay_triangulation_2.cpp | 2 +- ...Updatable_Delaunay_triangulation_table_2.h | 4 +- .../internal/Kernel/cartesian_predicates_3.h | 20 +++---- .../Are_parallel_C2.h | 2 +- .../Arrangement_type_C2.h | 8 +-- .../CGAL/Segment_Delaunay_graph_site_2.h | 4 +- .../include/CGAL/Cartesian/MatrixC33.h | 20 +++---- ...tructions_on_weighted_points_cartesian_2.h | 6 +- .../include/CGAL/_test_traits.h | 2 +- ...tructions_on_weighted_points_cartesian_3.h | 36 ++++++------ ...redicates_on_weighted_points_cartesian_3.h | 20 +++---- 45 files changed, 286 insertions(+), 286 deletions(-) diff --git a/Alpha_shapes_2/include/CGAL/constructions/squared_radius_smallest_orthogonalcircle_ftC2.h b/Alpha_shapes_2/include/CGAL/constructions/squared_radius_smallest_orthogonalcircle_ftC2.h index f02958f7dd8..03a0e841d0f 100644 --- a/Alpha_shapes_2/include/CGAL/constructions/squared_radius_smallest_orthogonalcircle_ftC2.h +++ b/Alpha_shapes_2/include/CGAL/constructions/squared_radius_smallest_orthogonalcircle_ftC2.h @@ -44,11 +44,11 @@ squared_radius_orthogonalcircleC2( FT dpp = CGAL_NTS square(dpx)+CGAL_NTS square(dpy)-pw+rw; FT dqq = CGAL_NTS square(dqx)+CGAL_NTS square(dqy)-qw+rw; - FT det0 = det2x2_by_formula(dpx, dpy, dqx, dqy); + FT det0 = determinant(dpx, dpy, dqx, dqy); - FT det1 = det2x2_by_formula(dpp, dpy, dqq, dqy); + FT det1 = determinant(dpp, dpy, dqq, dqy); - FT det2 = det2x2_by_formula(dpx, dpp, dqx, dqq); + FT det2 = determinant(dpx, dpp, dqx, dqq); return (CGAL_NTS square(det1)+CGAL_NTS square(det2))/ diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h index 9ce668a1701..6d8881da544 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h @@ -65,9 +65,9 @@ w_plane_tangent_line_2(const FT &x1, const FT &y1, const FT &w1, FT Dv = v2 - v3; FT Dr = r2 - r3; - FT Duv = det2x2_by_formula(u2, v2, u3, v3); - FT Dur = det2x2_by_formula(u2, r2, u3, r3); - FT Dvr = det2x2_by_formula(v2, r2, v3, r3); + FT Duv = determinant(u2, v2, u3, v3); + FT Dur = determinant(u2, r2, u3, r3); + FT Dvr = determinant(v2, r2, v3, r3); FT D1 = CGAL::square(Du) + CGAL::square(Dv); FT D1inv = FT(1) / D1; @@ -162,9 +162,9 @@ ad_left_bitangent_lineC2(const FT &x1, const FT &y1, const FT &w1, FT dy = y1 - y2; FT dw = w1 - w2; - FT dxw = det2x2_by_formula(x1, w1, x2, w2); - FT dyw = det2x2_by_formula(y1, w1, y2, w2); - FT dxy = det2x2_by_formula(x1, y1, x2, y2); + FT dxw = determinant(x1, w1, x2, w2); + FT dyw = determinant(y1, w1, y2, w2); + FT dxy = determinant(x1, y1, x2, y2); FT D1 = CGAL::square(dx) + CGAL::square(dy); FT invD1 = FT(1) / D1; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h index 0b1e324fec6..7b7e99edb16 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h @@ -101,13 +101,13 @@ public: FT pk = CGAL::square(xk) + CGAL::square(yk) - CGAL::square(rk); FT pl = CGAL::square(xl) + CGAL::square(yl) - CGAL::square(rl); - FT Exp = det2x2_by_formula(xj, pj, xk, pk); - FT Eyp = det2x2_by_formula(yj, pj, yk, pk); - FT Erp = det2x2_by_formula(rj, pj, rk, pk); + FT Exp = determinant(xj, pj, xk, pk); + FT Eyp = determinant(yj, pj, yk, pk); + FT Erp = determinant(rj, pj, rk, pk); - FT Exy = det2x2_by_formula(xj, yj, xk, yk); - FT Exr = det2x2_by_formula(xj, rj, xk, rk); - FT Eyr = det2x2_by_formula(yj, rj, yk, rk); + FT Exy = determinant(xj, yj, xk, yk); + FT Exr = determinant(xj, rj, xk, rk); + FT Eyr = determinant(yj, rj, yk, rk); FT Exyp = xl * Eyp - yl * Exp + pl * Exy; FT Exrp = xl * Erp - rl * Exp + pl * Exr; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h index b7e24c96dc6..37858e1c4e7 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h @@ -155,7 +155,7 @@ public: const FT& D, const FT& P) const { FT sigma = a * A + b * B; - FT delta = det2x2_by_formula(a, b, A, B); + FT delta = determinant(a, b, A, B); Sign sign_sigma = CGAL::sign(sigma); Sign sign_delta = CGAL::sign(delta); diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h index 97ec989297a..ddc90ec6a0d 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h @@ -118,15 +118,15 @@ public: FT pj = CGAL::square(xj) + CGAL::square(yj) - CGAL::square(rj); FT pk = CGAL::square(xk) + CGAL::square(yk) - CGAL::square(rk); - FT Exp = det2x2_by_formula(xj, pj, xk, pk); - FT Eyp = det2x2_by_formula(yj, pj, yk, pk); - FT Erp = det2x2_by_formula(rj, pj, rk, pk); + FT Exp = determinant(xj, pj, xk, pk); + FT Eyp = determinant(yj, pj, yk, pk); + FT Erp = determinant(rj, pj, rk, pk); - FT Exy = det2x2_by_formula(xj, yj, xk, yk); - FT Exr = det2x2_by_formula(xj, rj, xk, rk); - FT Eyr = det2x2_by_formula(yj, rj, yk, rk); + FT Exy = determinant(xj, yj, xk, yk); + FT Exr = determinant(xj, rj, xk, rk); + FT Eyr = determinant(yj, rj, yk, rk); - FT Exy2 = 2 * det2x2_by_formula(xl, yl, xm, ym); + FT Exy2 = 2 * determinant(xl, yl, xm, ym); FT A = (Exp * Exr + Eyp * Eyr) * Exy2 + (Eyp * dx - Exp * dy) * Erp; FT B = Exy * Exy2 - Exp * dx - Eyp * dy; @@ -194,13 +194,13 @@ public: pj = nj - CGAL::square(rj); pk = nk - CGAL::square(rk); - Exp = det2x2_by_formula(xj, pj, xk, pk); - Eyp = det2x2_by_formula(yj, pj, yk, pk); - Erp = det2x2_by_formula(rj, pj, rk, pk); + Exp = determinant(xj, pj, xk, pk); + Eyp = determinant(yj, pj, yk, pk); + Erp = determinant(rj, pj, rk, pk); - Exy = det2x2_by_formula(xj, yj, xk, yk); - Exr = det2x2_by_formula(xj, rj, xk, rk); - Eyr = det2x2_by_formula(yj, rj, yk, rk); + Exy = determinant(xj, yj, xk, yk); + Exr = determinant(xj, rj, xk, rk); + Eyr = determinant(yj, rj, yk, rk); A1 = Exp * Exr + Eyp * Eyr; @@ -284,7 +284,7 @@ private: FT dx = xl - xm; FT dy = yl - ym; - FT Exy2 = 2 * det2x2_by_formula(xl, yl, xm, ym); + FT Exy2 = 2 * determinant(xl, yl, xm, ym); FT A = A1 * Exy2 + (Eyp * dx - Exp * dy) * Erp; FT B = Exy * Exy2 - Exp * dx - Eyp * dy; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h index a37a7a29465..e7e3021e4e5 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h @@ -62,7 +62,7 @@ private: FT b = vc.b1() + vc.b2() * CGAL::sqrt(vc.delta()); FT det1 = a * (p2.y() - p1.y()) - b * (p2.x() - p1.x()); FT c = vc.c1() + vc.c2() * CGAL::sqrt(vc.delta()); - FT det2 = det2x2_by_formula(p1.x() - sp1.x(), p1.y() - sp1.y(), + FT det2 = determinant(p1.x() - sp1.x(), p1.y() - sp1.y(), p2.x() - sp1.x(), p2.y() - sp1.y()); return CGAL::sign(det1 + FT(2) * c * det2); } @@ -73,7 +73,7 @@ private: { FT dx = p2.x() - p1.x(); FT dy = p2.y() - p1.y(); - FT det1 = det2x2_by_formula(p1.x() - sp1.x(), p1.y() - sp1.y(), + FT det1 = determinant(p1.x() - sp1.x(), p1.y() - sp1.y(), p2.x() - sp1.x(), p2.y() - sp1.y()); FT A = vc.a1() * dy - vc.b1() * dx + FT(2) * vc.c1() * det1; FT B = vc.a2() * dy - vc.b2() * dx + FT(2) * vc.c2() * det1; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h index 8c01cdd3953..196ab2c6996 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h @@ -100,12 +100,12 @@ public: Voronoi_radius_2(const Inverted_weighted_point& u1, const Inverted_weighted_point& u2) { - FT dxp = det2x2_by_formula(u1.x(), u1.p(), u2.x(), u2.p()); - FT dyp = det2x2_by_formula(u1.y(), u1.p(), u2.y(), u2.p()); - FT dwp = det2x2_by_formula(u1.weight(), u1.p(), u2.weight(), u2.p()); - FT dxy = det2x2_by_formula(u1.x(), u1.y(), u2.x(), u2.y()); - FT dxw = det2x2_by_formula(u1.x(), u1.weight(), u2.x(), u2.weight()); - FT dyw = det2x2_by_formula(u1.y(), u1.weight(), u2.y(), u2.weight()); + FT dxp = determinant(u1.x(), u1.p(), u2.x(), u2.p()); + FT dyp = determinant(u1.y(), u1.p(), u2.y(), u2.p()); + FT dwp = determinant(u1.weight(), u1.p(), u2.weight(), u2.p()); + FT dxy = determinant(u1.x(), u1.y(), u2.x(), u2.y()); + FT dxw = determinant(u1.x(), u1.weight(), u2.x(), u2.weight()); + FT dyw = determinant(u1.y(), u1.weight(), u2.y(), u2.weight()); _a = CGAL::square(dxp) + CGAL::square(dyp); _b = dxp * dxw + dyp * dyw; @@ -193,9 +193,9 @@ public: FT dx = p1.x() - p2.x(); FT dy = p1.y() - p2.y(); FT dw = p1.weight() - p2.weight(); - FT dxy = det2x2_by_formula(p1.x(), p1.y(), p2.x(), p2.y()); - FT dxw = det2x2_by_formula(p1.x(), p1.weight(), p2.x(), p2.weight()); - FT dyw = det2x2_by_formula(p1.y(), p1.weight(), p2.y(), p2.weight()); + FT dxy = determinant(p1.x(), p1.y(), p2.x(), p2.y()); + FT dxw = determinant(p1.x(), p1.weight(), p2.x(), p2.weight()); + FT dyw = determinant(p1.y(), p1.weight(), p2.y(), p2.weight()); store(dx, dy, dw, dxy, dxw, dyw); } @@ -204,12 +204,12 @@ public: Bitangent_line_2(const Inverted_weighted_point& u1, const Inverted_weighted_point& u2) { - FT dxp = det2x2_by_formula(u1.x(), u1.p(), u2.x(), u2.p()); - FT dyp = det2x2_by_formula(u1.y(), u1.p(), u2.y(), u2.p()); - FT dwp = det2x2_by_formula(u1.weight(), u1.p(), u2.weight(), u2.p()); - FT dxy = det2x2_by_formula(u1.x(), u1.y(), u2.x(), u2.y()); - FT dxw = det2x2_by_formula(u1.x(), u1.weight(), u2.x(), u2.weight()); - FT dyw = det2x2_by_formula(u1.y(), u1.weight(), u2.y(), u2.weight()); + FT dxp = determinant(u1.x(), u1.p(), u2.x(), u2.p()); + FT dyp = determinant(u1.y(), u1.p(), u2.y(), u2.p()); + FT dwp = determinant(u1.weight(), u1.p(), u2.weight(), u2.p()); + FT dxy = determinant(u1.x(), u1.y(), u2.x(), u2.y()); + FT dxw = determinant(u1.x(), u1.weight(), u2.x(), u2.weight()); + FT dyw = determinant(u1.y(), u1.weight(), u2.y(), u2.weight()); store(dxp, dyp, dwp, dxy, dxw, dyw); } @@ -315,13 +315,13 @@ public: const Inverted_weighted_point& u2, const Inverted_weighted_point& u3) const { - FT dx1 = det2x2_by_formula(u2.x(), u2.p(), u1.x(), u1.p()); - FT dy1 = det2x2_by_formula(u2.y(), u2.p(), u1.y(), u1.p()); - FT dw1 = det2x2_by_formula(u2.weight(), u2.p(), u1.weight(), u1.p()); + FT dx1 = determinant(u2.x(), u2.p(), u1.x(), u1.p()); + FT dy1 = determinant(u2.y(), u2.p(), u1.y(), u1.p()); + FT dw1 = determinant(u2.weight(), u2.p(), u1.weight(), u1.p()); - FT dx3 = det2x2_by_formula(u3.x(), u3.p(), u2.x(), u2.p()); - FT dy3 = det2x2_by_formula(u3.y(), u3.p(), u2.y(), u2.p()); - FT dw3 = det2x2_by_formula(u3.weight(), u3.p(), u2.weight(), u2.p()); + FT dx3 = determinant(u3.x(), u3.p(), u2.x(), u2.p()); + FT dy3 = determinant(u3.y(), u3.p(), u2.y(), u2.p()); + FT dw3 = determinant(u3.weight(), u3.p(), u2.weight(), u2.p()); FT u2Pv2 = CGAL::square(u2.x()) + CGAL::square(u2.y()); FT u2Mv2 = CGAL::square(u2.x()) - CGAL::square(u2.y()); diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/new_traits/Conflict_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/new_traits/Conflict_2.h index 2ed8a8e481c..e85fcc344d5 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/new_traits/Conflict_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/new_traits/Conflict_2.h @@ -58,15 +58,15 @@ protected: const Inverted_weighted_point &p3, int i) const { Sign s = CGAL::sign( - CGAL::square(det3x3_by_formula( + CGAL::square(determinant( p1.p(), p1.weight(), p1.y(), p2.p(), p2.weight(), p2.y(), p3.p(), p3.weight(), p3.y())) - + CGAL::square(det3x3_by_formula( + + CGAL::square(determinant( p1.p(), p1.x(), p1.weight(), p2.p(), p2.x(), p2.weight(), p3.p(), p3.x(), p3.weight())) - - CGAL::square(det3x3_by_formula( + - CGAL::square(determinant( p1.p(), p1.x(), p1.y(), p2.p(), p2.x(), p2.y(), p3.p(), p3.x(), p3.y()))); @@ -91,17 +91,17 @@ protected: CGAL_assertion(i == -1 || i == 1 || i == 2 || i == 3); Sign s = -CGAL::sign( - det2x2_by_formula( + determinant( p1.p(), p1.x(), p2.p(), p2.x()) - * det3x3_by_formula( + * determinant( p1.p(), p1.weight(), p1.x(), p2.p(), p2.weight(), p2.x(), p3.p(), p3.weight(), p3.x()) - + det2x2_by_formula( + + determinant( p1.p(), p1.y(), p2.p(), p2.y()) - * det3x3_by_formula( + * determinant( p1.p(), p1.weight(), p1.y(), p2.p(), p2.weight(), p2.y(), p3.p(), p3.weight(), p3.y())); diff --git a/Apollonius_graph_2/include/CGAL/Hyperbola_2.h b/Apollonius_graph_2/include/CGAL/Hyperbola_2.h index ae19d8cfb8b..bcac326f195 100644 --- a/Apollonius_graph_2/include/CGAL/Hyperbola_2.h +++ b/Apollonius_graph_2/include/CGAL/Hyperbola_2.h @@ -159,7 +159,7 @@ protected: bool right(const Point_2& p) const { return - CGAL::is_negative( det3x3_by_formula(f1.x(), f1.y(), 1, + CGAL::is_negative( determinant(f1.x(), f1.y(), 1, f2.x(), f2.y(), 1, p.x(), p.y(), 1) ); } diff --git a/Apollonius_graph_2/include/CGAL/Parabola_2.h b/Apollonius_graph_2/include/CGAL/Parabola_2.h index 925cae5bc65..085e2a7b7ae 100644 --- a/Apollonius_graph_2/include/CGAL/Parabola_2.h +++ b/Apollonius_graph_2/include/CGAL/Parabola_2.h @@ -191,7 +191,7 @@ protected: bool right(const Point_2& p) const { return - CGAL::is_positive( det3x3_by_formula(c.x(), c.y(), FT(1), + CGAL::is_positive( determinant(c.x(), c.y(), FT(1), o.x(), o.y(), FT(1), p.x(), p.y(), FT(1)) ); } diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h index 8935d0fee63..1795855e57c 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h @@ -206,22 +206,22 @@ typename Aff_transformation_repC3::Aff_transformation_3 Aff_transformation_repC3::inverse() const // FIXME : construction { return Aff_transformation_3( - det2x2_by_formula( t22, t23, t32, t33), // i 11 - -det2x2_by_formula( t12, t13, t32, t33), // i 12 - det2x2_by_formula( t12, t13, t22, t23), // i 13 - -det3x3_by_formula( t12, t13, t14, t22, t23, t24, t32, t33, t34 ), + determinant( t22, t23, t32, t33), // i 11 + -determinant( t12, t13, t32, t33), // i 12 + determinant( t12, t13, t22, t23), // i 13 + -determinant( t12, t13, t14, t22, t23, t24, t32, t33, t34 ), - -det2x2_by_formula( t21, t23, t31, t33), // i 21 - det2x2_by_formula( t11, t13, t31, t33), // i 22 - -det2x2_by_formula( t11, t13, t21, t23), // i 23 - det3x3_by_formula( t11, t13, t14, t21, t23, t24, t31, t33, t34 ), + -determinant( t21, t23, t31, t33), // i 21 + determinant( t11, t13, t31, t33), // i 22 + -determinant( t11, t13, t21, t23), // i 23 + determinant( t11, t13, t14, t21, t23, t24, t31, t33, t34 ), - det2x2_by_formula( t21, t22, t31, t32), // i 31 - -det2x2_by_formula( t11, t12, t31, t32), // i 32 - det2x2_by_formula( t11, t12, t21, t22), // i 33 - -det3x3_by_formula( t11, t12, t14, t21, t22, t24, t31, t32, t34 ), + determinant( t21, t22, t31, t32), // i 31 + -determinant( t11, t12, t31, t32), // i 32 + determinant( t11, t12, t21, t22), // i 33 + -determinant( t11, t12, t14, t21, t22, t24, t31, t32, t34 ), - det3x3_by_formula( t11, t12, t13, t21, t22, t23, t31, t32, t33 )); + determinant( t11, t12, t13, t21, t22, t23, t31, t32, t33 )); } template < class R > diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index b2f34b093f0..897fb2055c9 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -769,7 +769,7 @@ namespace CartesianKernelFunctors { FT v1y = q.y() - p.y(); FT v2x = r.x() - p.x(); FT v2y = r.y() - p.y(); - return det2x2_by_formula(v1x, v1y, v2x, v2y)/2; + return determinant(v1x, v1y, v2x, v2y)/2; } result_type @@ -793,7 +793,7 @@ namespace CartesianKernelFunctors { result_type operator()(const Vector_2& v, const Vector_2& w) const { - return det2x2_by_formula(v.x(), v.y(), w.x(), w.y()); + return determinant(v.x(), v.y(), w.x(), w.y()); } }; @@ -809,7 +809,7 @@ namespace CartesianKernelFunctors { result_type operator()(const Vector_3& v, const Vector_3& w, const Vector_3& t) const { - return det3x3_by_formula(v.x(), v.y(), v.z(), + return determinant(v.x(), v.y(), v.z(), w.x(), w.y(), w.z(), t.x(), t.y(), t.z()); } @@ -984,7 +984,7 @@ namespace CartesianKernelFunctors { operator()(const Point_3& p0, const Point_3& p1, const Point_3& p2, const Point_3& p3) const { - return det3x3_by_formula(p1.x()-p0.x(), p1.y()-p0.y(), p1.z()-p0.z(), + return determinant(p1.x()-p0.x(), p1.y()-p0.y(), p1.z()-p0.z(), p2.x()-p0.x(), p2.y()-p0.y(), p2.z()-p0.z(), p3.x()-p0.x(), p3.y()-p0.y(), p3.z()-p0.z())/6; } @@ -1846,24 +1846,24 @@ namespace CartesianKernelFunctors { // The following determinants can be developped and simplified. // - // FT num_x = det3x3_by_formula(psy,psz,ps2, + // FT num_x = determinant(psy,psz,ps2, // qsy,qsz,qs2, // rsy,rsz,0); - // FT num_y = det3x3_by_formula(psx,psz,ps2, + // FT num_y = determinant(psx,psz,ps2, // qsx,qsz,qs2, // rsx,rsz,0); - // FT num_z = det3x3_by_formula(psx,psy,ps2, + // FT num_z = determinant(psx,psy,ps2, // qsx,qsy,qs2, // rsx,rsy,0); - FT num_x = ps2 * det2x2_by_formula(qsy,qsz,rsy,rsz) - - qs2 * det2x2_by_formula(psy,psz,rsy,rsz); - FT num_y = ps2 * det2x2_by_formula(qsx,qsz,rsx,rsz) - - qs2 * det2x2_by_formula(psx,psz,rsx,rsz); - FT num_z = ps2 * det2x2_by_formula(qsx,qsy,rsx,rsy) - - qs2 * det2x2_by_formula(psx,psy,rsx,rsy); + FT num_x = ps2 * determinant(qsy,qsz,rsy,rsz) + - qs2 * determinant(psy,psz,rsy,rsz); + FT num_y = ps2 * determinant(qsx,qsz,rsx,rsz) + - qs2 * determinant(psx,psz,rsx,rsz); + FT num_z = ps2 * determinant(qsx,qsy,rsx,rsy) + - qs2 * determinant(psx,psy,rsx,rsy); - FT den = det3x3_by_formula(psx,psy,psz, + FT den = determinant(psx,psy,psz, qsx,qsy,qsz, rsx,rsy,rsz); @@ -1901,16 +1901,16 @@ namespace CartesianKernelFunctors { FT spz = s.z()-p.z(); FT sp2 = CGAL_NTS square(spx) + CGAL_NTS square(spy) + CGAL_NTS square(spz); - FT num_x = det3x3_by_formula(qpy,qpz,qp2, + FT num_x = determinant(qpy,qpz,qp2, rpy,rpz,rp2, spy,spz,sp2); - FT num_y = det3x3_by_formula(qpx,qpz,qp2, + FT num_y = determinant(qpx,qpz,qp2, rpx,rpz,rp2, spx,spz,sp2); - FT num_z = det3x3_by_formula(qpx,qpy,qp2, + FT num_z = determinant(qpx,qpy,qp2, rpx,rpy,rp2, spx,spy,sp2); - FT den = det3x3_by_formula(qpx,qpy,qpz, + FT den = determinant(qpx,qpy,qpz, rpx,rpy,rpz, spx,spy,spz); CGAL_kernel_assertion( ! CGAL_NTS is_zero(den) ); @@ -2149,24 +2149,24 @@ namespace CartesianKernelFunctors { // The following determinants can be developped and simplified. // - // FT num_x = det3x3_by_formula(psy,psz,ps2, + // FT num_x = determinant(psy,psz,ps2, // qsy,qsz,qs2, // rsy,rsz,0); - // FT num_y = det3x3_by_formula(psx,psz,ps2, + // FT num_y = determinant(psx,psz,ps2, // qsx,qsz,qs2, // rsx,rsz,0); - // FT num_z = det3x3_by_formula(psx,psy,ps2, + // FT num_z = determinant(psx,psy,ps2, // qsx,qsy,qs2, // rsx,rsy,0); - FT num_x = ps2 * det2x2_by_formula(qsy,qsz,rsy,rsz) - - qs2 * det2x2_by_formula(psy,psz,rsy,rsz); - FT num_y = ps2 * det2x2_by_formula(qsx,qsz,rsx,rsz) - - qs2 * det2x2_by_formula(psx,psz,rsx,rsz); - FT num_z = ps2 * det2x2_by_formula(qsx,qsy,rsx,rsy) - - qs2 * det2x2_by_formula(psx,psy,rsx,rsy); + FT num_x = ps2 * determinant(qsy,qsz,rsy,rsz) + - qs2 * determinant(psy,psz,rsy,rsz); + FT num_y = ps2 * determinant(qsx,qsz,rsx,rsz) + - qs2 * determinant(psx,psz,rsx,rsz); + FT num_z = ps2 * determinant(qsx,qsy,rsx,rsy) + - qs2 * determinant(psx,psy,rsx,rsy); - FT den = det3x3_by_formula(psx,psy,psz, + FT den = determinant(psx,psy,psz, qsx,qsy,qsz, rsx,rsy,rsz); diff --git a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h index c8f8b9a4888..e44cd3b3e0f 100644 --- a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h +++ b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h @@ -53,7 +53,7 @@ circumcenter_translateC2(const FT &dqx, const FT &dqy, // What we do is intersect the bisectors. FT r2 = CGAL_NTS square(drx) + CGAL_NTS square(dry); FT q2 = CGAL_NTS square(dqx) + CGAL_NTS square(dqy); - FT den = 2 * det2x2_by_formula(dqx, dqy, drx, dry); + FT den = 2 * determinant(dqx, dqy, drx, dry); // The 3 points aren't collinear. // Hopefully, this is already checked at the upper level. @@ -61,8 +61,8 @@ circumcenter_translateC2(const FT &dqx, const FT &dqy, // One possible optimization here is to precompute 1/den, to avoid one // division. However, we loose precision, and it's maybe not worth it (?). - dcx = det2x2_by_formula (dry, dqy, r2, q2) / den; - dcy = - det2x2_by_formula (drx, dqx, r2, q2) / den; + dcx = determinant (dry, dqy, r2, q2) / den; + dcy = - determinant (drx, dqx, r2, q2) / den; } template < class FT > @@ -338,7 +338,7 @@ scaled_distance_to_lineC2( const FT &px, const FT &py, const FT &qx, const FT &qy, const FT &rx, const FT &ry) { - return det2x2_by_formula(px-rx, py-ry, qx-rx, qy-ry); + return determinant(px-rx, py-ry, qx-rx, qy-ry); } CGAL_END_NAMESPACE diff --git a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h index 74868411473..96defd0d0f5 100644 --- a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h +++ b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h @@ -87,16 +87,16 @@ squared_radiusC3(const FT &px, const FT &py, const FT &pz, FT spz = sz-pz; FT sp2 = CGAL_NTS square(spx) + CGAL_NTS square(spy) + CGAL_NTS square(spz); - FT num_x = det3x3_by_formula(qpy,qpz,qp2, + FT num_x = determinant(qpy,qpz,qp2, rpy,rpz,rp2, spy,spz,sp2); - FT num_y = det3x3_by_formula(qpx,qpz,qp2, + FT num_y = determinant(qpx,qpz,qp2, rpx,rpz,rp2, spx,spz,sp2); - FT num_z = det3x3_by_formula(qpx,qpy,qp2, + FT num_z = determinant(qpx,qpy,qp2, rpx,rpy,rp2, spx,spy,sp2); - FT den = det3x3_by_formula(qpx,qpy,qpz, + FT den = determinant(qpx,qpy,qpz, rpx,rpy,rpz, spx,spy,spz); CGAL_kernel_assertion( ! CGAL_NTS is_zero(den) ); @@ -125,14 +125,14 @@ squared_radiusC3(const FT &px, const FT &py, const FT &pz, FT rsy = psz*qsx-psx*qsz; FT rsz = psx*qsy-psy*qsx; - FT num_x = ps2 * det2x2_by_formula(qsy,qsz,rsy,rsz) - - qs2 * det2x2_by_formula(psy,psz,rsy,rsz); - FT num_y = ps2 * det2x2_by_formula(qsx,qsz,rsx,rsz) - - qs2 * det2x2_by_formula(psx,psz,rsx,rsz); - FT num_z = ps2 * det2x2_by_formula(qsx,qsy,rsx,rsy) - - qs2 * det2x2_by_formula(psx,psy,rsx,rsy); + FT num_x = ps2 * determinant(qsy,qsz,rsy,rsz) + - qs2 * determinant(psy,psz,rsy,rsz); + FT num_y = ps2 * determinant(qsx,qsz,rsx,rsz) + - qs2 * determinant(psx,psz,rsx,rsz); + FT num_z = ps2 * determinant(qsx,qsy,rsx,rsy) + - qs2 * determinant(psx,psy,rsx,rsy); - FT den = det3x3_by_formula(psx,psy,psz, + FT den = determinant(psx,psy,psz, qsx,qsy,qsz, rsx,rsy,rsz); @@ -254,7 +254,7 @@ scaled_distance_to_planeC3( const FT &prx, const FT &pry, const FT &prz, const FT &px, const FT &py, const FT &pz) { - return det3x3_by_formula(ppx-px,ppy-py,ppz-pz, + return determinant(ppx-px,ppy-py,ppz-pz, pqx-px,pqy-py,pqz-pz, prx-px,pry-py,prz-pz); } diff --git a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h index 11ea63b1467..de7e013f173 100644 --- a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h +++ b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h @@ -75,8 +75,8 @@ compare_xC2(const FT &px, const FT &ha, const FT &hb, const FT &hc) { // The abscissa of the intersection point is num/den. - FT num = det2x2_by_formula( lb, lc, hb, hc); - FT den = det2x2_by_formula( la, lb, ha, hb); + FT num = determinant( lb, lc, hb, hc); + FT den = determinant( la, lb, ha, hb); typename Sgn::result_type s = CGAL_NTS sign(den); CGAL_kernel_assertion( s != ZERO ); return s * CGAL_NTS compare(px * den, num); @@ -90,20 +90,20 @@ compare_xC2(const FT &la, const FT &lb, const FT &lc, const FT &h2a, const FT &h2b, const FT &h2c) { /* - FT num1 = det2x2_by_formula( lb, lc, h1b, h1c); - FT den1 = det2x2_by_formula( la, lb, h1a, h1b); - FT num2 = det2x2_by_formula( lb, lc, h2b, h2c); - FT den2 = det2x2_by_formula( la, lb, h2a, h2b); + FT num1 = determinant( lb, lc, h1b, h1c); + FT den1 = determinant( la, lb, h1a, h1b); + FT num2 = determinant( lb, lc, h2b, h2c); + FT den2 = determinant( la, lb, h2a, h2b); Sign s = Sign (CGAL_NTS sign(den1) * CGAL_NTS sign(den2)); CGAL_kernel_assertion( s != ZERO ); return s * sign_of_determinant(num1, num2, den1, den2); */ - FT num1 = det2x2_by_formula( la, lc, h1a, h1c); - FT num2 = det2x2_by_formula( la, lc, h2a, h2c); - FT num = det2x2_by_formula(h1a,h1c,h2a,h2c)*lb - + det2x2_by_formula(num1,num2,h1b,h2b); - FT den1 = det2x2_by_formula( la, lb, h1a, h1b); - FT den2 = det2x2_by_formula( la, lb, h2a, h2b); + FT num1 = determinant( la, lc, h1a, h1c); + FT num2 = determinant( la, lc, h2a, h2c); + FT num = determinant(h1a,h1c,h2a,h2c)*lb + + determinant(num1,num2,h1b,h2b); + FT den1 = determinant( la, lb, h1a, h1b); + FT den2 = determinant( la, lb, h2a, h2b); return CGAL_NTS sign(lb) * CGAL_NTS sign(num) * CGAL_NTS sign(den1) * @@ -118,10 +118,10 @@ compare_xC2(const FT &l1a, const FT &l1b, const FT &l1c, const FT &l2a, const FT &l2b, const FT &l2c, const FT &h2a, const FT &h2b, const FT &h2c) { - FT num1 = det2x2_by_formula( l1b, l1c, h1b, h1c); - FT den1 = det2x2_by_formula( l1a, l1b, h1a, h1b); - FT num2 = det2x2_by_formula( l2b, l2c, h2b, h2c); - FT den2 = det2x2_by_formula( l2a, l2b, h2a, h2b); + FT num1 = determinant( l1b, l1c, h1b, h1c); + FT den1 = determinant( l1a, l1b, h1a, h1b); + FT num2 = determinant( l2b, l2c, h2b, h2c); + FT den2 = determinant( l2a, l2b, h2a, h2b); typename Sgn::result_type s = CGAL_NTS sign(den1) * CGAL_NTS sign(den2); CGAL_kernel_assertion( s != ZERO ); return s * sign_of_determinant(num1, num2, den1, den2); @@ -175,8 +175,8 @@ compare_y_at_xC2(const FT &l1a, const FT &l1b, const FT &l1c, const FT &h2a, const FT &h2b, const FT &h2c) { // The abscissa of the intersection point is num/den. - FT num = det2x2_by_formula( l1b, l1c, l2b, l2c); - FT den = det2x2_by_formula( l1a, l1b, l2a, l2b); + FT num = determinant( l1b, l1c, l2b, l2c); + FT den = determinant( l1a, l1b, l2a, l2b); typename Sgn::result_type s = CGAL_NTS sign(h1b) * CGAL_NTS sign(h2b) * CGAL_NTS sign(den); diff --git a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h index ae75cda7096..a7001c77023 100644 --- a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h +++ b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h @@ -417,14 +417,14 @@ side_of_bounded_sphereC3(const FT &px, const FT &py, const FT &pz, FT tsy = ty-sy; FT tsz = tz-sz; - FT num_x = ps2 * det2x2_by_formula(qsy,qsz,rsy,rsz) - - qs2 * det2x2_by_formula(psy,psz,rsy,rsz); - FT num_y = ps2 * det2x2_by_formula(qsx,qsz,rsx,rsz) - - qs2 * det2x2_by_formula(psx,psz,rsx,rsz); - FT num_z = ps2 * det2x2_by_formula(qsx,qsy,rsx,rsy) - - qs2 * det2x2_by_formula(psx,psy,rsx,rsy); + FT num_x = ps2 * determinant(qsy,qsz,rsy,rsz) + - qs2 * determinant(psy,psz,rsy,rsz); + FT num_y = ps2 * determinant(qsx,qsz,rsx,rsz) + - qs2 * determinant(psx,psz,rsx,rsz); + FT num_z = ps2 * determinant(qsx,qsy,rsx,rsy) + - qs2 * determinant(psx,psy,rsx,rsy); - FT den2 = 2 * det3x3_by_formula(psx,psy,psz, + FT den2 = 2 * determinant(psx,psy,psz, qsx,qsy,qsz, rsx,rsy,rsz); diff --git a/Cartesian_kernel/package_info/Cartesian_kernel/changes.txt b/Cartesian_kernel/package_info/Cartesian_kernel/changes.txt index 9deea35ca3f..1e2cfffd04f 100644 --- a/Cartesian_kernel/package_info/Cartesian_kernel/changes.txt +++ b/Cartesian_kernel/package_info/Cartesian_kernel/changes.txt @@ -21,7 +21,7 @@ - Remove qualification for functions part of the NT interface (sign, compare...), for efficiency. - Add qualification for functions which are not part of the - NT interface (det3x3_by_formula...) to support GMP++ like types. + NT interface (determinant...) to support GMP++ like types. 1 August 2005 Sylvain Pion - Cartesian_converter : specialize when same_type. diff --git a/Distance_2/include/CGAL/squared_distance_utils.h b/Distance_2/include/CGAL/squared_distance_utils.h index e6b510d392c..6d5a46d83b5 100644 --- a/Distance_2/include/CGAL/squared_distance_utils.h +++ b/Distance_2/include/CGAL/squared_distance_utils.h @@ -110,7 +110,7 @@ wcross_tag(const typename K::Point_2 &p, const K&, const Homogeneous_tag&) { - return det3x3_by_formula( + return determinant( p.hx(), q.hx(), r.hx(), p.hy(), q.hy(), r.hy(), p.hw(), q.hw(), r.hw()); diff --git a/Filtered_kernel/include/CGAL/Static_filters/Coplanar_orientation_3.h b/Filtered_kernel/include/CGAL/Static_filters/Coplanar_orientation_3.h index c056ea620fb..20975d03563 100644 --- a/Filtered_kernel/include/CGAL/Static_filters/Coplanar_orientation_3.h +++ b/Filtered_kernel/include/CGAL/Static_filters/Coplanar_orientation_3.h @@ -143,7 +143,7 @@ private: double prx = rx-px; double pry = ry-py; - double det = det2x2_by_formula(pqx, pqy, + double det = determinant(pqx, pqy, prx, pry); // Then semi-static filter. diff --git a/Filtered_kernel/include/CGAL/Static_filters/Coplanar_side_of_bounded_circle_3.h b/Filtered_kernel/include/CGAL/Static_filters/Coplanar_side_of_bounded_circle_3.h index d1883a2ab61..1ea9462ba5e 100644 --- a/Filtered_kernel/include/CGAL/Static_filters/Coplanar_side_of_bounded_circle_3.h +++ b/Filtered_kernel/include/CGAL/Static_filters/Coplanar_side_of_bounded_circle_3.h @@ -42,7 +42,7 @@ class SF_Side_of_bounded_circle_3 F sq = t1*t1+t1*t1+t1*t1; // squares F n1 = t1*t1 - t1*t1; // normal vector F sq_n1 = n1*n1 + n1*n1 + n1*n1; - F det = det4x4_by_formula(t1, t1, t1, sq, + F det = determinant(t1, t1, t1, sq, t1, t1, t1, sq, t1, t1, t1, sq, n1, n1, n1, sq_n1); // Full det @@ -99,7 +99,7 @@ public: double v2 = CGAL_NTS square(vx) + CGAL_NTS square(vy) + CGAL_NTS square(vz); - double det = det4x4_by_formula(ptx,pty,ptz,pt2, + double det = determinant(ptx,pty,ptz,pt2, rtx,rty,rtz,rt2, qtx,qty,qtz,qt2, vx,vy,vz,v2); diff --git a/Filtered_kernel/include/CGAL/Static_filters/Orientation_2.h b/Filtered_kernel/include/CGAL/Static_filters/Orientation_2.h index 4fda22ce312..0d4e680e5a1 100644 --- a/Filtered_kernel/include/CGAL/Static_filters/Orientation_2.h +++ b/Filtered_kernel/include/CGAL/Static_filters/Orientation_2.h @@ -76,7 +76,7 @@ public: double prx = rx - px; double pry = ry - py; - double det = det2x2_by_formula(pqx, pqy, + double det = determinant(pqx, pqy, prx, pry); // Then semi-static filter. @@ -111,7 +111,7 @@ public: { typedef Static_filter_error F; F t1 = F(1, F::ulp()/2); // First translation - F det = det2x2_by_formula(t1, t1, + F det = determinant(t1, t1, t1, t1); // Full det double err = det.error(); err += err * 2 * F::ulp(); // Correction due to "epsilon * maxx * maxy". diff --git a/Filtered_kernel/include/CGAL/Static_filters/Orientation_3.h b/Filtered_kernel/include/CGAL/Static_filters/Orientation_3.h index f51692228f6..7c25314e2c5 100644 --- a/Filtered_kernel/include/CGAL/Static_filters/Orientation_3.h +++ b/Filtered_kernel/include/CGAL/Static_filters/Orientation_3.h @@ -97,7 +97,7 @@ public: if (maxz < fabs(prz)) maxz = fabs(prz); if (maxz < fabs(psz)) maxz = fabs(psz); double eps = 5.1107127829973299e-15 * maxx * maxy * maxz; - double det = det3x3_by_formula(pqx, pqy, pqz, + double det = determinant(pqx, pqy, pqz, prx, pry, prz, psx, psy, psz); @@ -131,7 +131,7 @@ public: { typedef Static_filter_error F; F t1 = F(1, F::ulp()/2); // First translation - F det = det3x3_by_formula(t1, t1, t1, + F det = determinant(t1, t1, t1, t1, t1, t1, t1, t1, t1); // Full det double err = det.error(); diff --git a/Filtered_kernel/include/CGAL/Static_filters/Side_of_oriented_circle_2.h b/Filtered_kernel/include/CGAL/Static_filters/Side_of_oriented_circle_2.h index 3fdbc4193d9..086e2c0dd15 100644 --- a/Filtered_kernel/include/CGAL/Static_filters/Side_of_oriented_circle_2.h +++ b/Filtered_kernel/include/CGAL/Static_filters/Side_of_oriented_circle_2.h @@ -64,7 +64,7 @@ public: double rqx = rx-qx; double rqy = ry-qy; - double det = det2x2_by_formula(qpx*tpy - qpy*tpx, tpx*tqx + tpy*tqy, + double det = determinant(qpx*tpy - qpy*tpx, tpx*tqx + tpy*tqy, qpx*rpy - qpy*rpx, rpx*rqx + rpy*rqy); // We compute the semi-static bound. @@ -106,7 +106,7 @@ public: F t1 = F(1, F::ulp()/2); // First translation F a = t1*t1 - t1*t1; F b = t1*t1 + t1*t1; - F det = det2x2_by_formula(a, b, a, b); + F det = determinant(a, b, a, b); double err = det.error(); err += err * 3 * F::ulp(); // Correction due to "eps * maxx * maxy...". diff --git a/Filtered_kernel/include/CGAL/Static_filters/Side_of_oriented_sphere_3.h b/Filtered_kernel/include/CGAL/Static_filters/Side_of_oriented_sphere_3.h index 67d4649368a..588c43e769c 100644 --- a/Filtered_kernel/include/CGAL/Static_filters/Side_of_oriented_sphere_3.h +++ b/Filtered_kernel/include/CGAL/Static_filters/Side_of_oriented_sphere_3.h @@ -104,7 +104,7 @@ public: double eps = 1.2466136531027298e-13 * maxx * maxy * maxz * (maxz * maxz); - double det = det4x4_by_formula(ptx,pty,ptz,pt2, + double det = determinant(ptx,pty,ptz,pt2, rtx,rty,rtz,rt2, qtx,qty,qtz,qt2, stx,sty,stz,st2); @@ -131,7 +131,7 @@ public: typedef CGAL::Static_filter_error F; F t1 = F(1,F::ulp()/2); // First translation F sq = t1*t1+t1*t1+t1*t1; // squares - F det = det4x4_by_formula(t1, t1, t1, sq, + F det = determinant(t1, t1, t1, sq, t1, t1, t1, sq, t1, t1, t1, sq, t1, t1, t1, sq); // Full det diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h index c56e8275b6b..34a2bbfadc2 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h @@ -441,58 +441,58 @@ Aff_transformation_repH3::inverse() const typedef typename R::RT RT; const RT RT0(0); return Aff_transformation_3( - det3x3_by_formula( t11, t12, t13, + determinant( t11, t12, t13, t21, t22, t23, // i 00 RT0, RT0, t33 ), - - det3x3_by_formula( t01, t02, t03, + - determinant( t01, t02, t03, t21, t22, t23, // i 01 RT0, RT0, t33 ), - det3x3_by_formula( t01, t02, t03, + determinant( t01, t02, t03, t11, t12, t13, // i 02 RT0, RT0, t33 ), - - det3x3_by_formula( t01, t02, t03, + - determinant( t01, t02, t03, t11, t12, t13, // i 03 t21, t22, t23 ), - - det3x3_by_formula( t10, t12, t13, + - determinant( t10, t12, t13, t20, t22, t23, // i 10 RT0, RT0, t33 ), - det3x3_by_formula( t00, t02, t03, + determinant( t00, t02, t03, t20, t22, t23, // i 11 RT0, RT0, t33 ), - - det3x3_by_formula( t00, t02, t03, + - determinant( t00, t02, t03, t10, t12, t13, // i 12 RT0, RT0, t33 ), - det3x3_by_formula( t00, t02, t03, + determinant( t00, t02, t03, t10, t12, t13, // i 13 t20, t22, t23 ), - det3x3_by_formula( t10, t11, t13, + determinant( t10, t11, t13, t20, t21, t23, // i 20 RT0, RT0, t33 ), - - det3x3_by_formula( t00, t01, t03, + - determinant( t00, t01, t03, t20, t21, t23, // i 21 RT0, RT0, t33 ), - det3x3_by_formula( t00, t01, t03, + determinant( t00, t01, t03, t10, t11, t13, // i 22 RT0, RT0, t33 ), - - det3x3_by_formula( t00, t01, t03, + - determinant( t00, t01, t03, t10, t11, t13, // i 23 t20, t21, t23 ), - det3x3_by_formula( t00, t01, t02, + determinant( t00, t01, t02, t10, t11, t12, // i 33 t20, t21, t22 ) ) ; @@ -523,7 +523,7 @@ bool Aff_transformation_repH3::is_even() const { return (CGAL_NTS sign( t33 * - det3x3_by_formula(t00, t01, t02, + determinant(t00, t01, t02, t10, t11, t12, t20, t21, t22 ) ) == POSITIVE ); } diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h index 25196796f78..3d0df1f9087 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h @@ -495,7 +495,7 @@ PlaneH3::transform_to_2d() const RT t32 = -( e1phx*e2phz - e1phz*e2phx ); RT t33 = ( e1phx*e2phy - e1phy*e2phx ); - RT scale = det3x3_by_formula( orthohx, orthohy, orthohz, + RT scale = determinant( orthohx, orthohy, orthohz, e1phx, e1phy, e1phz, e2phx, e2phy, e2phz ); diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/basic_constructionsH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/basic_constructionsH3.h index 7f133758ee8..b27ba4172f9 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/basic_constructionsH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/basic_constructionsH3.h @@ -60,16 +60,16 @@ gp_linear_intersection(const PlaneH3 &f, { typedef typename R::RT RT; return typename R::Point_3( - det3x3_by_formula(-f.d(), f.b(), f.c(), + determinant(-f.d(), f.b(), f.c(), -g.d(), g.b(), g.c(), -h.d(), h.b(), h.c()), - det3x3_by_formula( f.a(),-f.d(), f.c(), + determinant( f.a(),-f.d(), f.c(), g.a(),-g.d(), g.c(), h.a(),-h.d(), h.c()), - det3x3_by_formula( f.a(), f.b(),-f.d(), + determinant( f.a(), f.b(),-f.d(), g.a(), g.b(),-g.d(), h.a(), h.b(),-h.d()), - det3x3_by_formula( f.a(), f.b(), f.c(), + determinant( f.a(), f.b(), f.c(), g.a(), g.b(), g.c(), h.a(), h.b(), h.c())); } diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h index 0f72b4482bb..39f89722308 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h @@ -178,16 +178,16 @@ namespace HomogeneousKernelFunctors { const RT & vpy = vp.hy(); const RT & vpz = vp.hz(); - RT alpha = det3x3_by_formula( vpx, v2x, v3x, + RT alpha = determinant( vpx, v2x, v3x, vpy, v2y, v3y, vpz, v2z, v3z ); - RT beta = det3x3_by_formula( v1x, vpx, v3x, + RT beta = determinant( v1x, vpx, v3x, v1y, vpy, v3y, v1z, vpz, v3z ); - RT gamma = det3x3_by_formula( v1x, v2x, vpx, + RT gamma = determinant( v1x, v2x, vpx, v1y, v2y, vpy, v1z, v2z, vpz ); - RT det = det3x3_by_formula( v1x, v2x, v3x, + RT det = determinant( v1x, v2x, v3x, v1y, v2y, v3y, v1z, v2z, v3z ); @@ -1277,7 +1277,7 @@ namespace HomogeneousKernelFunctors { result_type operator()(const Vector_2& v, const Vector_2& w) const { - return det2x2_by_formula(v.hx(), v.hy(), + return determinant(v.hx(), v.hy(), w.hx(), w.hy()) / FT(v.hw() * w.hw()); } }; @@ -1294,7 +1294,7 @@ namespace HomogeneousKernelFunctors { result_type operator()(const Vector_3& v, const Vector_3& w, const Vector_3& t) const { - return det3x3_by_formula(v.hx(), v.hy(), v.hz(), + return determinant(v.hx(), v.hy(), v.hz(), w.hx(), w.hy(), w.hz(), t.hx(), t.hy(), t.hz()) / FT(v.hw() * w.hw() * t.hw()); @@ -2385,19 +2385,19 @@ namespace HomogeneousKernelFunctors { shz *= shw; shw *= shw; - RT chx = det4x4_by_formula(phy, phz, pssq, phw, + RT chx = determinant(phy, phz, pssq, phw, qhy, qhz, qssq, qhw, rhy, rhz, rssq, rhw, shy, shz, sssq, shw ); - RT chy = det4x4_by_formula(phx, phz, pssq, phw, + RT chy = determinant(phx, phz, pssq, phw, qhx, qhz, qssq, qhw, rhx, rhz, rssq, rhw, shx, shz, sssq, shw ); - RT chz = det4x4_by_formula(phx, phy, pssq, phw, + RT chz = determinant(phx, phy, pssq, phw, qhx, qhy, qssq, qhw, rhx, rhy, rssq, rhw, shx, shy, sssq, shw ); - RT chw = det4x4_by_formula(phx, phy, phz, phw, + RT chw = determinant(phx, phy, phz, phw, qhx, qhy, qhz, qhw, rhx, rhy, rhz, rhw, shx, shy, shz, shw ); @@ -4657,7 +4657,7 @@ namespace HomogeneousKernelFunctors { const RT & thw = t.hw(); const RT thw2 = thw*thw; - const RT det = det5x5_by_formula( + const RT det = determinant( phx*phw, phy*phw, phz*phw, phx*phx + phy*phy + phz*phz, phw2, qhx*qhw, qhy*qhw, qhz*qhw, qhx*qhx + qhy*qhy + qhz*qhz, qhw2, rhx*rhw, rhy*rhw, rhz*rhw, rhx*rhx + rhy*rhy + rhz*rhz, rhw2, diff --git a/Interpolation/include/CGAL/constructions/constructions_for_voronoi_intersection_cartesian_2_3.h b/Interpolation/include/CGAL/constructions/constructions_for_voronoi_intersection_cartesian_2_3.h index acf9e876b47..fad28803eda 100644 --- a/Interpolation/include/CGAL/constructions/constructions_for_voronoi_intersection_cartesian_2_3.h +++ b/Interpolation/include/CGAL/constructions/constructions_for_voronoi_intersection_cartesian_2_3.h @@ -34,7 +34,7 @@ plane_centered_circumcenter_translateC3(const RT &ax, const RT &ay, const RT &rz, RT &x, RT &y, RT &z) { - RT den = RT(2) * det3x3_by_formula(nx,qx,rx, + RT den = RT(2) * determinant(nx,qx,rx, ny,qy,ry, nz,qz,rz); // The 3 points aren't collinear. @@ -48,15 +48,15 @@ plane_centered_circumcenter_translateC3(const RT &ax, const RT &ay, RT na = nx*ax + ny*ay + nz*az; na *= RT(2.0); - x = det3x3_by_formula(ny,nz,na, + x = determinant(ny,nz,na, qy,qz,q2, ry,rz,r2)/ den ; - y = - det3x3_by_formula(nx,nz,na, + y = - determinant(nx,nz,na, qx,qz,q2, rx,rz,r2)/ den ; - z = det3x3_by_formula(nx,ny,na, + z = determinant(nx,ny,na, qx,qy,q2, rx,ry,r2)/ den ; } @@ -106,18 +106,18 @@ bisector_plane_intersection_translateC3(const RT &ax, const RT &ay, // the line is defined by p1 and p2 with //=> p1: z1 =0, p2: z2=1 // precondition: (nx!=0 || ny!=0) && (qx!=0 && qy!=0) && den!=0 - // where RT den = RT(2.0) * det2x2_by_formula(qx,qy,nx, ny); + // where RT den = RT(2.0) * determinant(qx,qy,nx, ny); RT q2 = CGAL_NTS square(qx) + CGAL_NTS square(qy) + CGAL_NTS square(qz); RT na = nx*ax + ny*ay + nz*az; na *= RT(2.0); - x1 = det2x2_by_formula(ny, na, qy, q2); - y1 = - det2x2_by_formula(nx, na, qx, q2); + x1 = determinant(ny, na, qy, q2); + y1 = - determinant(nx, na, qx, q2); - x2 = x1 + RT(2.0) * det2x2_by_formula(qy,qz,ny, nz); - y2 = y1 - RT(2.0) * det2x2_by_formula(qx,qz,nx, nz); + x2 = x1 + RT(2.0) * determinant(qy,qz,ny, nz); + y2 = y1 - RT(2.0) * determinant(qx,qz,nx, nz); x1 /= den; x2 /= den; @@ -199,7 +199,7 @@ bisector_plane_intersectionC3(const RT &ax, const RT &ay, const RT &az, // 2) the projection of n and (p-q) onto the plane is not // identical // computation for (z=0) with adequate permutations - RT den = RT(2.0) * det2x2_by_formula(qx-px,qy-py,nx, ny); + RT den = RT(2.0) * determinant(qx-px,qy-py,nx, ny); if ((nx!=0 || ny!=0) && (qx!=px || qy!=py) && den!=RT(0)) //den==0 <=> projections of (qx,qy) and (nx,ny) are identical //intersection with z=0/z=1 @@ -207,14 +207,14 @@ bisector_plane_intersectionC3(const RT &ax, const RT &ay, const RT &az, qx,qy,qz,den, x1,y1,z1,x2,y2,z2); else{ - den = RT(2.0) * det2x2_by_formula(qy-py,qz-pz,ny,nz); + den = RT(2.0) * determinant(qy-py,qz-pz,ny,nz); if ((ny!=0 || nz!=0) && (qy!=py || qz!=pz) && den!=RT(0)) //intersection with x=0/x=1 => permutations bisector_plane_intersection_permuteC3(ay,az,ax,ny,nz,nx,py,pz,px, qy,qz,qx,den, y1,z1,x1,y2,z2,x2); else{ - den = RT(2.0) * det2x2_by_formula(qz-pz,qx-px,nz,nx); + den = RT(2.0) * determinant(qz-pz,qx-px,nz,nx); CGAL_assertion((nx!=0 || nz!=0) && (qx!=px || qz!=pz) && den!=RT(0)); //intersection with y=0/y=1 => permutations bisector_plane_intersection_permuteC3(az,ax,ay,nz,nx,ny,pz,px,py, diff --git a/Kernel_23/include/CGAL/Kernel/Wutils.h b/Kernel_23/include/CGAL/Kernel/Wutils.h index ab5c9318537..1a9587dd258 100644 --- a/Kernel_23/include/CGAL/Kernel/Wutils.h +++ b/Kernel_23/include/CGAL/Kernel/Wutils.h @@ -156,7 +156,7 @@ struct wcross_tag_2 const Point_2 &q, const Point_2 &r) const { - return det3x3_by_formula(p.hx(), q.hx(), r.hx(), + return determinant(p.hx(), q.hx(), r.hx(), p.hy(), q.hy(), r.hy(), p.hw(), q.hw(), r.hw()); } diff --git a/Kernel_23/include/CGAL/determinant.h b/Kernel_23/include/CGAL/determinant.h index 7735b31c17e..f378852346d 100644 --- a/Kernel_23/include/CGAL/determinant.h +++ b/Kernel_23/include/CGAL/determinant.h @@ -30,7 +30,7 @@ CGAL_BEGIN_NAMESPACE template inline RT -det2x2_by_formula( +determinant( const RT& a00, const RT& a01, const RT& a10, const RT& a11) { @@ -42,7 +42,7 @@ det2x2_by_formula( template CGAL_KERNEL_MEDIUM_INLINE RT -det3x3_by_formula( +determinant( const RT& a00, const RT& a01, const RT& a02, const RT& a10, const RT& a11, const RT& a12, const RT& a20, const RT& a21, const RT& a22) @@ -59,7 +59,7 @@ det3x3_by_formula( template CGAL_KERNEL_LARGE_INLINE RT -det4x4_by_formula( +determinant( const RT& a00, const RT& a01, const RT& a02, const RT& a03, const RT& a10, const RT& a11, const RT& a12, const RT& a13, const RT& a20, const RT& a21, const RT& a22, const RT& a23, @@ -85,7 +85,7 @@ det4x4_by_formula( template CGAL_KERNEL_LARGE_INLINE RT -det5x5_by_formula( +determinant( const RT& a00, const RT& a01, const RT& a02, const RT& a03, const RT& a04, const RT& a10, const RT& a11, const RT& a12, const RT& a13, const RT& a14, const RT& a20, const RT& a21, const RT& a22, const RT& a23, const RT& a24, @@ -127,7 +127,7 @@ det5x5_by_formula( template RT -det6x6_by_formula( +determinant( const RT& a00, const RT& a01, const RT& a02, const RT& a03, const RT& a04, const RT& a05, const RT& a10, const RT& a11, const RT& a12, const RT& a13, const RT& a14, diff --git a/Kernel_23/include/CGAL/predicates/sign_of_determinant.h b/Kernel_23/include/CGAL/predicates/sign_of_determinant.h index f8ffdc71b79..01609291fd2 100644 --- a/Kernel_23/include/CGAL/predicates/sign_of_determinant.h +++ b/Kernel_23/include/CGAL/predicates/sign_of_determinant.h @@ -45,7 +45,7 @@ sign_of_determinant( const RT& a00, const RT& a01, const RT& a02, const RT& a10, const RT& a11, const RT& a12, const RT& a20, const RT& a21, const RT& a22) { - return CGAL_NTS sign(det3x3_by_formula(a00, a01, a02, + return CGAL_NTS sign(determinant(a00, a01, a02, a10, a11, a12, a20, a21, a22)); } @@ -59,7 +59,7 @@ sign_of_determinant( const RT& a20, const RT& a21, const RT& a22, const RT& a23, const RT& a30, const RT& a31, const RT& a32, const RT& a33) { - return CGAL_NTS sign(det4x4_by_formula(a00, a01, a02, a03, + return CGAL_NTS sign(determinant(a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23, a30, a31, a32, a33)); @@ -75,7 +75,7 @@ sign_of_determinant( const RT& a30, const RT& a31, const RT& a32, const RT& a33, const RT& a34, const RT& a40, const RT& a41, const RT& a42, const RT& a43, const RT& a44) { - return CGAL_NTS sign(det5x5_by_formula(a00, a01, a02, a03, a04, + return CGAL_NTS sign(determinant(a00, a01, a02, a03, a04, a10, a11, a12, a13, a14, a20, a21, a22, a23, a24, a30, a31, a32, a33, a34, @@ -99,7 +99,7 @@ sign_of_determinant( const RT& a50, const RT& a51, const RT& a52, const RT& a53, const RT& a54, const RT& a55) { - return CGAL_NTS sign(det6x6_by_formula(a00, a01, a02, a03, a04, a05, + return CGAL_NTS sign(determinant(a00, a01, a02, a03, a04, a05, a10, a11, a12, a13, a14, a15, a20, a21, a22, a23, a24, a25, a30, a31, a32, a33, a34, a35, diff --git a/Kernel_23/package_info/Kernel_23/changes.txt b/Kernel_23/package_info/Kernel_23/changes.txt index 1e36c22b233..bb5f51e8135 100644 --- a/Kernel_23/package_info/Kernel_23/changes.txt +++ b/Kernel_23/package_info/Kernel_23/changes.txt @@ -2086,7 +2086,7 @@ Version 1.106 (09 February 2004) [rursu] - authors for determinant.h updated 1.2.8 -> 1.2.9 -- det4x4_by_formula improved as suggested by Sylvain and Olivier +- determinant improved as suggested by Sylvain and Olivier 1.2.7 -> 1.2.8 - #define CGAL_KERNEL_INLINE inline added again diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_determinant.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_determinant.h index 4ae2cb9112c..11f75d151a1 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_determinant.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_determinant.h @@ -33,54 +33,54 @@ _test_fct_determinant(const NT&) NT one = NT(1); NT two = NT(2); - // detDxD_by_formula + // determinant() - assert( CGAL::det2x2_by_formula( zero, one, \ + assert( CGAL::determinant( zero, one, \ one, zero) == - one ); - assert( CGAL::det2x2_by_formula( one, one, \ + assert( CGAL::determinant( one, one, \ zero, -one) == - one ); - assert( CGAL::det3x3_by_formula( one, zero, one, \ + assert( CGAL::determinant( one, zero, one, \ zero, one, one, \ -one, -one, zero ) == \ - one * CGAL::det2x2_by_formula( one, one, \ + one * CGAL::determinant( one, one, \ -one, zero ) \ - - one * CGAL::det2x2_by_formula( zero, one, \ + - one * CGAL::determinant( zero, one, \ one, one ) ); - assert( CGAL::det4x4_by_formula( one, zero, one, -one, \ + assert( CGAL::determinant( one, zero, one, -one, \ zero, one, one, -one, \ one, two, zero, one, \ -one, -one, zero, zero ) == \ - one * CGAL::det3x3_by_formula( zero, one, -one, \ + one * CGAL::determinant( zero, one, -one, \ one, one, -one, \ two, zero, one ) \ - - one * CGAL::det3x3_by_formula( one, one, -one, \ + - one * CGAL::determinant( one, one, -one, \ zero, one, -one, \ one, zero, one ) ); - assert( CGAL::det5x5_by_formula( one, zero, one, -one, zero, \ + assert( CGAL::determinant( one, zero, one, -one, zero, \ zero, one, one, -one, zero, \ one, two, zero, one, two, \ one, one, zero, -one, zero, \ -one, -one, zero, zero, one ) == \ - two * CGAL::det4x4_by_formula( one, zero, one, -one, \ + two * CGAL::determinant( one, zero, one, -one, \ zero, one, one, -one, \ one, one, zero, -one, \ -one, -one, zero, zero) \ - + one * CGAL::det4x4_by_formula( one, zero, one, -one, \ + + one * CGAL::determinant( one, zero, one, -one, \ zero, one, one, -one, \ one, two, zero, one, \ one, one, zero, -one) ); - assert( CGAL::det6x6_by_formula( one, zero, zero, zero, zero, zero, \ + assert( CGAL::determinant( one, zero, zero, zero, zero, zero, \ zero, one, zero, one, -one, zero, \ zero, zero, one, one, -one, zero, \ zero, one, two, zero, one, two, \ zero, one, one, zero, -one, zero, \ zero, -one, -one, zero, zero, one ) == \ - CGAL::det5x5_by_formula( one, zero, one, -one, zero, \ + CGAL::determinant( one, zero, one, -one, zero, \ zero, one, one, -one, zero, \ one, two, zero, one, two, \ one, one, zero, -one, zero, \ diff --git a/Kinetic_data_structures/hidden/example/Kinetic_data_structures/update_Delaunay_triangulation_2.cpp b/Kinetic_data_structures/hidden/example/Kinetic_data_structures/update_Delaunay_triangulation_2.cpp index 2969c0af9f7..8370ce378e0 100644 --- a/Kinetic_data_structures/hidden/example/Kinetic_data_structures/update_Delaunay_triangulation_2.cpp +++ b/Kinetic_data_structures/hidden/example/Kinetic_data_structures/update_Delaunay_triangulation_2.cpp @@ -145,7 +145,7 @@ CNT incircle(CNT ax, CNT ay, CNT bx, CNT by, CNT rpy = cy - ay; CNT tpx = dx - ax; CNT tpy = dy - ay; - CNT det=CGAL::det2x2_by_formula(qpx*tpy - qpy*tpx, tpx*(dx - bx) + CNT det=CGAL::determinant(qpx*tpy - qpy*tpx, tpx*(dx - bx) + tpy*(dy - by), qpx*rpy - qpy*rpx, rpx*(cx - bx) + rpy*(cy - by)); diff --git a/Kinetic_data_structures/hidden/include/CGAL/Updatable_Delaunay_triangulation_table_2.h b/Kinetic_data_structures/hidden/include/CGAL/Updatable_Delaunay_triangulation_table_2.h index 56969158f3d..1924cefe17c 100644 --- a/Kinetic_data_structures/hidden/include/CGAL/Updatable_Delaunay_triangulation_table_2.h +++ b/Kinetic_data_structures/hidden/include/CGAL/Updatable_Delaunay_triangulation_table_2.h @@ -1015,7 +1015,7 @@ public: CNT rpy = cy; CNT tpx = dx; CNT tpy = dy; - CNT det=CGAL::det2x2_by_formula(qpx*tpy - qpy*tpx, + CNT det=CGAL::determinant(qpx*tpy - qpy*tpx, tpx*(dx - bx) + tpy*(dy - by), qpx*rpy - qpy*rpx, rpx*(cx - bx) + rpy*(cy - by)); @@ -1032,7 +1032,7 @@ public: CNT rpy = cy - ay; CNT tpx = dx - ax; CNT tpy = dy - ay; - CNT det=CGAL::det2x2_by_formula(qpx*tpy - qpy*tpx, + CNT det=CGAL::determinant(qpx*tpy - qpy*tpx, tpx*(dx - bx) + tpy*(dy - by), qpx*rpy - qpy*rpx, rpx*(cx - bx) + rpy*(cy - by)); diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/cartesian_predicates_3.h b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/cartesian_predicates_3.h index e4a0fcc6135..4ab7fe00872 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/cartesian_predicates_3.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/cartesian_predicates_3.h @@ -64,7 +64,7 @@ struct Cartesian_side_of_oriented_sphere_3 FT dsy = (d.y()) - (e.y()); FT dsz = (d.z()) - (e.z()); FT dst = dsx*dsx + dsy*dsy + dsz*dsz; - FT ret= CGAL::det4x4_by_formula(dpx, dpy, dpz, dpt, + FT ret= CGAL::determinant(dpx, dpy, dpz, dpt, dqx, dqy, dqz, dqt, drx, dry, drz, drt, dsx, dsy, dsz, dst); @@ -127,7 +127,7 @@ struct Cartesian_power_test_3 FT dst = dsx*dsx + dsy*dsy + dsz*dsz - (d.weight()) + (e.weight()); - return ::CGAL::det4x4_by_formula(dpx, dpy, dpz, dpt, + return ::CGAL::determinant(dpx, dpy, dpz, dpt, dqx, dqy, dqz, dqt, drx, dry, drz, drt, dsx, dsy, dsz, dst); @@ -192,7 +192,7 @@ struct Cartesian_lifted_power_test_3 FT dsz = (d.point().z()) - (e.point().z()); FT dst = (d.lifted()) - (e.lifted()); - return CGAL::det4x4_by_formula(dpx, dpy, dpz, dpt, + return CGAL::determinant(dpx, dpy, dpz, dpt, dqx, dqy, dqz, dqt, drx, dry, drz, drt, dsx, dsy, dsz, dst); @@ -244,7 +244,7 @@ struct Cartesian_linear_lifted_power_test_3 FT dsz = (d.point().z()) - (e.point().z()); FT dst = (d.lifted()) - (e.lifted()); - safe_ret = CGAL::det4x4_by_formula(dpx, dpy, dpz, dpt, + safe_ret = CGAL::determinant(dpx, dpy, dpz, dpt, dqx, dqy, dqz, dqt, drx, dry, drz, drt, dsx, dsy, dsz, dst); @@ -354,7 +354,7 @@ typename Pt::Coordinate co3(const Pt &a, const Pt &b, const Pt &c, const Pt &d) RT a20= qz-pz; RT a21= rz-pz; RT a22= sz-pz; - RT ret= CGAL::det3x3_by_formula(a00, a01, a02, + RT ret= CGAL::determinant(a00, a01, a02, a10, a11, a12, a20, a21, a22); /*CGAL_LOG_MAPLE(std::endl << std::endl); @@ -554,7 +554,7 @@ typename CC::result_type co3(const Pt &a, const Pt &b, const Pt &c, const Pt &d, RT a20= qz-pz; RT a21= rz-pz; RT a22= sz-pz; - RT ret= CGAL::det3x3_by_formula(a00, a01, a02, + RT ret= CGAL::determinant(a00, a01, a02, a10, a11, a12, a20, a21, a22); CGAL::Kinetic::log()->stream(CGAL::KDS::Log::MAPLE) << std::endl << std::endl; @@ -600,7 +600,7 @@ typename CC::result_type pt3(const Pt &a, const Pt &b, const Pt &c, const Pt &d, FT dst = dsx*dsx + dsy*dsy + dsz*dsz - cc(d.weight()) + cc(e.weight()); - return CGAL::det4x4_by_formula(dpx, dpy, dpz, dpt, + return CGAL::determinant(dpx, dpy, dpz, dpt, dqx, dqy, dqz, dqt, drx, dry, drz, drt, dsx, dsy, dsz, dst); @@ -633,7 +633,7 @@ typename CC::result_type pt3(const Cartesian_moving_point_3 &a, FT dsy = cc(d.y()) - cc(e.y()); FT dsz = cc(d.z()) - cc(e.z()); FT dst = dsx*dsx + dsy*dsy + dsz*dsz; - FT ret= CGAL::det4x4_by_formula(dpx, dpy, dpz, dpt, + FT ret= CGAL::determinant(dpx, dpy, dpz, dpt, dqx, dqy, dqz, dqt, drx, dry, drz, drt, dsx, dsy, dsz, dst); @@ -728,7 +728,7 @@ typename CC::result_type pt3(Cartesian_moving_lifted_point_3 a, FT dsz = cc(d.point().z()) - cc(e.point().z()); FT dst = cc(d.lifted()) - cc(e.lifted()); - FT ret = CGAL::det4x4_by_formula(dpx, dpy, dpz, dpt, + FT ret = CGAL::determinant(dpx, dpy, dpz, dpt, dqx, dqy, dqz, dqt, drx, dry, drz, drt, dsx, dsy, dsz, dst); diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Are_parallel_C2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Are_parallel_C2.h index afd244ca1ad..1f477bda300 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Are_parallel_C2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Are_parallel_C2.h @@ -61,7 +61,7 @@ private: x4 = s2.target().x(), y4 = s2.target().y(); - FT det = det2x2_by_formula(x2 - x1, x4 - x3, + FT det = determinant(x2 - x1, x4 - x3, y2 - y1, y4 - y3); return ( CGAL::sign(det) == CGAL::ZERO ); diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Arrangement_type_C2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Arrangement_type_C2.h index 5c7cd1128af..b1536c9ca3e 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Arrangement_type_C2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Arrangement_type_C2.h @@ -79,7 +79,7 @@ private: const RT& x3, const RT& y3, const RT& x4, const RT& y4) const { - RT delta = -det2x2_by_formula(x2 - x1, x4 - x3, y2 - y1, y4 - y3); + RT delta = -determinant(x2 - x1, x4 - x3, y2 - y1, y4 - y3); Sign s = CGAL::sign( delta ); if ( s != CGAL::ZERO ) { @@ -94,8 +94,8 @@ private: const RT& x3, const RT& y3, const RT& x4, const RT& y4, const RT& D) const { - RT Dt = -det2x2_by_formula(x3 - x1, x4 - x3, y3 - y1, y4 - y3); - RT Ds = det2x2_by_formula(x2 - x1, x3 - x1, y2 - y1, y3 - y1); + RT Dt = -determinant(x3 - x1, x4 - x3, y3 - y1, y4 - y3); + RT Ds = determinant(x2 - x1, x3 - x1, y2 - y1, y3 - y1); Sign s_D = CGAL::sign( D ); Sign s_Dt = CGAL::sign( Dt ); @@ -164,7 +164,7 @@ private: parallel_C2(const RT& x1, const RT& y1, const RT& x2, const RT& y2, const RT& x3, const RT& y3, const RT& x4, const RT& y4) const { - RT D1 = det2x2_by_formula(x2 - x1, x3 - x1, y2 - y1, y3 - y1); + RT D1 = determinant(x2 - x1, x3 - x1, y2 - y1, y3 - y1); if ( CGAL::sign( D1 ) != CGAL::ZERO ) { return Enum::DISJOINT; diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_site_2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_site_2.h index fc2c9ce01e2..539a97ad97b 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_site_2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_site_2.h @@ -284,8 +284,8 @@ protected: RT x3 = p3.x(), y3 = p3.y(); RT x4 = p4.x(), y4 = p4.y(); - RT D = det2x2_by_formula(x2 - x1, x4 - x3, y2 - y1, y4 - y3); - RT Dt = det2x2_by_formula(x3 - x1, x4 - x3, y3 - y1, y4 - y3); + RT D = determinant(x2 - x1, x4 - x3, y2 - y1, y4 - y3); + RT Dt = determinant(x3 - x1, x4 - x3, y3 - y1, y4 - y3); RT t = Dt / D; diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h index 001012fcd22..29dfc416a69 100644 --- a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h +++ b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h @@ -145,7 +145,7 @@ public: RT determinant() const { - return det3x3_by_formula(r0().x(),r0().y(),r0().z() + return determinant(r0().x(),r0().y(),r0().z() ,r1().x(),r1().y(),r1().z() ,r2().x(),r2().y(),r2().z() ); @@ -189,17 +189,17 @@ MatrixC33 cofactors_matrix ( MatrixC33 const& m ) { typedef typename R::RT RT ; - RT c00 = det2x2_by_formula(m.r1().y(),m.r1().z(),m.r2().y(),m.r2().z()); - RT c01 = -det2x2_by_formula(m.r1().x(),m.r1().z(),m.r2().x(),m.r2().z()); - RT c02 = det2x2_by_formula(m.r1().x(),m.r1().y(),m.r2().x(),m.r2().y()); + RT c00 = determinant(m.r1().y(),m.r1().z(),m.r2().y(),m.r2().z()); + RT c01 = -determinant(m.r1().x(),m.r1().z(),m.r2().x(),m.r2().z()); + RT c02 = determinant(m.r1().x(),m.r1().y(),m.r2().x(),m.r2().y()); - RT c10 = -det2x2_by_formula(m.r0().y(),m.r0().z(),m.r2().y(),m.r2().z()); - RT c11 = det2x2_by_formula(m.r0().x(),m.r0().z(),m.r2().x(),m.r2().z()); - RT c12 = -det2x2_by_formula(m.r0().x(),m.r0().y(),m.r2().x(),m.r2().y()); + RT c10 = -determinant(m.r0().y(),m.r0().z(),m.r2().y(),m.r2().z()); + RT c11 = determinant(m.r0().x(),m.r0().z(),m.r2().x(),m.r2().z()); + RT c12 = -determinant(m.r0().x(),m.r0().y(),m.r2().x(),m.r2().y()); - RT c20 = det2x2_by_formula(m.r0().y(),m.r0().z(),m.r1().y(),m.r1().z()); - RT c21 = -det2x2_by_formula(m.r0().x(),m.r0().z(),m.r1().x(),m.r1().z()); - RT c22 = det2x2_by_formula(m.r0().x(),m.r0().y(),m.r1().x(),m.r1().y()); + RT c20 = determinant(m.r0().y(),m.r0().z(),m.r1().y(),m.r1().z()); + RT c21 = -determinant(m.r0().x(),m.r0().z(),m.r1().x(),m.r1().z()); + RT c22 = determinant(m.r0().x(),m.r0().y(),m.r1().x(),m.r1().y()); return MatrixC33(c00,c01,c02 ,c10,c11,c12 diff --git a/Triangulation_2/include/CGAL/constructions_on_weighted_points_cartesian_2.h b/Triangulation_2/include/CGAL/constructions_on_weighted_points_cartesian_2.h index 9bbefcd9e91..62289524404 100644 --- a/Triangulation_2/include/CGAL/constructions_on_weighted_points_cartesian_2.h +++ b/Triangulation_2/include/CGAL/constructions_on_weighted_points_cartesian_2.h @@ -39,7 +39,7 @@ weighted_circumcenter_translateC2(const RT &dqx, const RT &dqy, const RT &dqw, RT r2 = CGAL_NTS square(drx) + CGAL_NTS square(dry) - drw; RT q2 = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) - dqw; - RT den = RT(2) * det2x2_by_formula(dqx, dqy, drx, dry); + RT den = RT(2) * determinant(dqx, dqy, drx, dry); // The 3 points aren't collinear. // Hopefully, this is already checked at the upper level. @@ -47,8 +47,8 @@ weighted_circumcenter_translateC2(const RT &dqx, const RT &dqy, const RT &dqw, // One possible optimization here is to precompute 1/den, to avoid one // division. However, we loose precision, and it's maybe not worth it (?). - dcx = det2x2_by_formula (dry, dqy, r2, q2) / den; - dcy = - det2x2_by_formula (drx, dqx, r2, q2) / den; + dcx = determinant (dry, dqy, r2, q2) / den; + dcy = - determinant (drx, dqx, r2, q2) / den; } //template < class RT > diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_traits.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_traits.h index 6efed0de802..1f53367ed59 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_traits.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_traits.h @@ -222,7 +222,7 @@ public: RT RT0(0); RT RT1(1); - RT det = CGAL::det4x4_by_formula(px, py, px*px + py*py, RT1, + RT det = CGAL::determinant(px, py, px*px + py*py, RT1, qx, qy, qx*qx + qy*qy, RT1, rx, ry, rx*rx + ry*ry, RT1, tx, ty, tx*tx + ty*ty, RT1); diff --git a/Triangulation_3/include/CGAL/constructions/constructions_on_weighted_points_cartesian_3.h b/Triangulation_3/include/CGAL/constructions/constructions_on_weighted_points_cartesian_3.h index e2fc0ebebd4..3c37942d2d5 100644 --- a/Triangulation_3/include/CGAL/constructions/constructions_on_weighted_points_cartesian_3.h +++ b/Triangulation_3/include/CGAL/constructions/constructions_on_weighted_points_cartesian_3.h @@ -50,16 +50,16 @@ determinants_for_weighted_circumcenterC3( FT sp2 = CGAL_NTS square(spx) + CGAL_NTS square(spy) + CGAL_NTS square(spz) - sw + pw; - num_x = det3x3_by_formula(qpy,qpz,qp2, + num_x = determinant(qpy,qpz,qp2, rpy,rpz,rp2, spy,spz,sp2); - num_y = det3x3_by_formula(qpx,qpz,qp2, + num_y = determinant(qpx,qpz,qp2, rpx,rpz,rp2, spx,spz,sp2); - num_z = det3x3_by_formula(qpx,qpy,qp2, + num_z = determinant(qpx,qpy,qp2, rpx,rpy,rp2, spx,spy,sp2); - den = det3x3_by_formula(qpx,qpy,qpz, + den = determinant(qpx,qpy,qpz, rpx,rpy,rpz, spx,spy,spz); } @@ -182,26 +182,26 @@ determinants_for_weighted_circumcenterC3( // The following determinants can be developped and simplified. // - // FT num_x = det3x3_by_formula(qpy,qpz,qp2, + // FT num_x = determinant(qpy,qpz,qp2, // rpy,rpz,rp2, // sy,sz,FT(0)); - // FT num_y = det3x3_by_formula(qpx,qpz,qp2, + // FT num_y = determinant(qpx,qpz,qp2, // rpx,rpz,rp2, // sx,sz,FT(0)); - // FT num_z = det3x3_by_formula(qpx,qpy,qp2, + // FT num_z = determinant(qpx,qpy,qp2, // rpx,rpy,rp2, // sx,sy,FT(0)); - num_x = qp2 * det2x2_by_formula(rpy,rpz,sy,sz) - - rp2 * det2x2_by_formula(qpy,qpz,sy,sz); + num_x = qp2 * determinant(rpy,rpz,sy,sz) + - rp2 * determinant(qpy,qpz,sy,sz); - num_y = qp2 * det2x2_by_formula(rpx,rpz,sx,sz) - - rp2 * det2x2_by_formula(qpx,qpz,sx,sz); + num_y = qp2 * determinant(rpx,rpz,sx,sz) + - rp2 * determinant(qpx,qpz,sx,sz); - num_z = qp2 * det2x2_by_formula(rpx,rpy,sx,sy) - - rp2 * det2x2_by_formula(qpx,qpy,sx,sy); + num_z = qp2 * determinant(rpx,rpy,sx,sy) + - rp2 * determinant(qpx,qpy,sx,sy); - den = det3x3_by_formula(qpx,qpy,qpz, + den = determinant(qpx,qpy,qpz, rpx,rpy,rpz, sx,sy,sz); } @@ -383,9 +383,9 @@ radical_axisC3(const RT &px, const RT &py, const RT &pz, const We &pw, //il manque des tests... - a= RT(1)*det2x2_by_formula(dqy, dqz, dry, drz); - b= - RT(1)*det2x2_by_formula(dqx, dqz, drx, drz); - c= RT(1)*det2x2_by_formula(dqx, dqy, drx, dry); + a= RT(1)*determinant(dqy, dqz, dry, drz); + b= - RT(1)*determinant(dqx, dqz, drx, drz); + c= RT(1)*determinant(dqx, dqy, drx, dry); } // function used in critical_squared_radiusC3 @@ -423,7 +423,7 @@ power_to_orthogonal_sphereC3( FT dst = CGAL_NTS square(dsx) + CGAL_NTS square(dsy) + CGAL_NTS square(dsz) - sw + tw; - return det4x4_by_formula(dpx, dpy, dpz, dpt, + return determinant(dpx, dpy, dpz, dpt, dqx, dqy, dqz, dqt, drx, dry, drz, drt, dsx, dsy, dsz, dst); diff --git a/Triangulation_3/include/CGAL/predicates/predicates_on_weighted_points_cartesian_3.h b/Triangulation_3/include/CGAL/predicates/predicates_on_weighted_points_cartesian_3.h index f4e9602112c..bc6fc945e2e 100644 --- a/Triangulation_3/include/CGAL/predicates/predicates_on_weighted_points_cartesian_3.h +++ b/Triangulation_3/include/CGAL/predicates/predicates_on_weighted_points_cartesian_3.h @@ -72,11 +72,11 @@ in_smallest_orthogonal_sphereC3( FT qpw = qq - qw + pw ; FT rpw = rr - rw + pw ; - FT den = det2x2_by_formula(qq,qr, + FT den = determinant(qq,qr, qr,rr); - FT detq = det2x2_by_formula(qpw,qr, + FT detq = determinant(qpw,qr, rpw,rr); - FT detr = det2x2_by_formula(qq,qpw, + FT detr = determinant(qq,qpw, qr,rpw); // Smallest smallest orthogonal sphere center @@ -159,16 +159,16 @@ does_simplex_intersect_weighted_dual_supportC3( FT rpw = rr - rw + pw ; FT spw = ss - sw + pw ; - FT den = det3x3_by_formula(qq,qr,qs, + FT den = determinant(qq,qr,qs, qr,rr,rs, qs,rs,ss); - FT detq = det3x3_by_formula(qpw,qr,qs, + FT detq = determinant(qpw,qr,qs, rpw,rr,rs, spw,rs,ss); - FT detr = det3x3_by_formula(qq,qpw,qs, + FT detr = determinant(qq,qpw,qs, qr,rpw,rs, qs,spw,ss); - FT dets = det3x3_by_formula(qq,qr,qpw, + FT dets = determinant(qq,qr,qpw, qr,rr,rpw, qs,rs,spw); CGAL_kernel_assertion( ! CGAL_NTS is_zero(den) ); @@ -222,11 +222,11 @@ does_simplex_intersect_weighted_dual_supportC3( FT qpw = qq - qw + pw ; FT rpw = rr - rw + pw ; - FT den = det2x2_by_formula(qq,qr, + FT den = determinant(qq,qr, qr,rr); - FT detq = det2x2_by_formula(qpw,qr, + FT detq = determinant(qpw,qr, rpw,rr); - FT detr = det2x2_by_formula(qq,qpw, + FT detr = determinant(qq,qpw, qr,rpw); CGAL_kernel_assertion( ! CGAL_NTS is_zero(den) );