From 02bb200fe518e3f1c52e17bb5e1199d20eb9d569 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 15 Mar 2013 14:11:34 +0100 Subject: [PATCH 01/31] Add a CMake variable that allows to disable GMP/MPFR --- Documentation/doc/Installation.txt | 4 +++- Installation/CMakeLists.txt | 4 +++- Installation/cmake/modules/CGAL_Macros.cmake | 10 ++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Documentation/doc/Installation.txt b/Documentation/doc/Installation.txt index 1169b6f5037..415d36559f1 100644 --- a/Documentation/doc/Installation.txt +++ b/Documentation/doc/Installation.txt @@ -1501,13 +1501,15 @@ usage of \sc{Gmp} and of \sc{Mpfr} will be disabled. Description Type + -`WITH_GMP` +`CGAL_DISABLE_GMP` Indicates whether to search and use \sc{Gmp}/\sc{Mpfr} or not CMake + `GMP_DIR` diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 6b665e216dd..af858037be1 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -523,7 +523,9 @@ set_special_prefix(QGLViewer QGLVIEWER) set_special_prefix(Coin3D COIN3D) # some libraries are essential (stl and Boost.Thread are treated in another way) -list (INSERT CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES 0 GMP MPFR) +if(NOT CGAL_DISABLE_GMP) + list (INSERT CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES 0 GMP MPFR) +endif() hide_variable(CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES) foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}) diff --git a/Installation/cmake/modules/CGAL_Macros.cmake b/Installation/cmake/modules/CGAL_Macros.cmake index afed6aee4b4..e7cc01e9d60 100644 --- a/Installation/cmake/modules/CGAL_Macros.cmake +++ b/Installation/cmake/modules/CGAL_Macros.cmake @@ -369,11 +369,17 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) use_component( MPFI ) endif() - use_component( MPFR ) + if(MPFR_FOUND) + use_component( MPFR ) + endif() + if (GMPXX_FOUND) use_component( GMPXX ) endif() - use_component( GMP ) + + if(GMP_FOUND) + use_component( GMP ) + endif() if(LEDA_FOUND) use_component( LEDA ) From fc6fed9ee1839a76feab4fb2a584c9446ffaba65 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 15 Mar 2013 14:46:20 +0100 Subject: [PATCH 02/31] Add the use of LEDA as exact type in case we do not use GMP --- .../CGAL/Exact_predicates_exact_constructions_kernel.h | 2 +- Number_types/include/CGAL/internal/Exact_type_selector.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Kernel_23/include/CGAL/Exact_predicates_exact_constructions_kernel.h b/Kernel_23/include/CGAL/Exact_predicates_exact_constructions_kernel.h index 87208dbe19b..6425745eda1 100644 --- a/Kernel_23/include/CGAL/Exact_predicates_exact_constructions_kernel.h +++ b/Kernel_23/include/CGAL/Exact_predicates_exact_constructions_kernel.h @@ -37,7 +37,7 @@ namespace CGAL { -// Epeck_ft is either Gmpq of Quotient +// Epeck_ft is either Gmpq, or leda_rational, or Quotient typedef internal::Exact_type_selector::Type Epeck_ft; // The following are redefined kernels instead of simple typedefs in order to shorten diff --git a/Number_types/include/CGAL/internal/Exact_type_selector.h b/Number_types/include/CGAL/internal/Exact_type_selector.h index d5c57e350ff..a5a6f2fc620 100644 --- a/Number_types/include/CGAL/internal/Exact_type_selector.h +++ b/Number_types/include/CGAL/internal/Exact_type_selector.h @@ -55,12 +55,14 @@ namespace CGAL { namespace internal { // A class which tells the prefered "exact number type" corresponding to a type. -// The default template chooses Gmpq or Quotient. +// The default template chooses Gmpq, or leda_rational, or Quotient. // It should support the built-in types. template < typename > struct Exact_type_selector #ifdef CGAL_USE_GMP { typedef Gmpq Type; }; +#elif defined(CGAL_USE_LEDA) +{ typedef leda_rational Type; }; #else { typedef Quotient Type; }; #endif From 67226de0832b32e1b29f2577089b63cc4c5ec451 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 15 Mar 2013 16:25:05 +0100 Subject: [PATCH 03/31] use CGAL::compare instead of compare to avoid Koenig lookup --- .../include/CGAL/Regular_triangulation_euclidean_traits_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation_2/include/CGAL/Regular_triangulation_euclidean_traits_2.h b/Triangulation_2/include/CGAL/Regular_triangulation_euclidean_traits_2.h index 5a7a98976ca..97ca91cea3f 100644 --- a/Triangulation_2/include/CGAL/Regular_triangulation_euclidean_traits_2.h +++ b/Triangulation_2/include/CGAL/Regular_triangulation_euclidean_traits_2.h @@ -306,7 +306,7 @@ typename Kernel_traits::Kernel::Oriented_side power_test_2(const Weighted_point &p, const Weighted_point &t) { - Comparison_result r = compare(p.weight(), t.weight()); + Comparison_result r = CGAL::compare(p.weight(), t.weight()); if(r == LARGER) return ON_NEGATIVE_SIDE; else if (r == SMALLER) return ON_POSITIVE_SIDE; return ON_ORIENTED_BOUNDARY; From 92f464232a95fd2b0fcdd27d81ada6da8d939b96 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 15 Mar 2013 16:39:39 +0100 Subject: [PATCH 04/31] Allow to add CGAL_DISABLE_GMP lately in the cache --- Installation/CMakeLists.txt | 24 +++++++++++++++++-- .../modules/CGAL_SetupDependencies.cmake | 2 +- Installation/src/CMakeLists.txt | 3 +-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index af858037be1..d958e9c3998 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -523,8 +523,28 @@ set_special_prefix(QGLViewer QGLVIEWER) set_special_prefix(Coin3D COIN3D) # some libraries are essential (stl and Boost.Thread are treated in another way) -if(NOT CGAL_DISABLE_GMP) - list (INSERT CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES 0 GMP MPFR) +if(CGAL_DISABLE_GMP) + list(REMOVE_ITEM CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES GMP MPFR) + unset(CGAL_CONFIGURED_LIBRARIES) + unset(CGAL_CONFIGURED_LIBRARIES CACHE) + unset(GMP_FOUND) + unset(GMP_FOUND CACHE) + unset(GMPXX_FOUND) + unset(GMPXX_FOUND CACHE) + unset(MPFR_FOUND) + unset(MPFR_FOUND CACHE) + unset(WITH_CGAL_Core) + unset(WITH_CGAL_Core CACHE) + unset(WITH_GMP) + unset(WITH_GMP CACHE) + unset(WITH_GMPXX) + unset(WITH_GMPXX CACHE) + unset(WITH_MPFR) + unset(WITH_MPFR CACHE) +else() + list(APPEND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES GMP MPFR) + # Where CMake is run several times, to avoid duplicates + list (REMOVE_DUPLICATES CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES) endif() hide_variable(CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES) diff --git a/Installation/cmake/modules/CGAL_SetupDependencies.cmake b/Installation/cmake/modules/CGAL_SetupDependencies.cmake index f179f4ad7e3..f4697fc332f 100644 --- a/Installation/cmake/modules/CGAL_SetupDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupDependencies.cmake @@ -56,7 +56,7 @@ foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}) if (${lib} STREQUAL "LEDA") # special case for LEDA - add a flag - message( STATUS "$LEDA cxx flags: ${LEDA_CXX_FLAGS}" ) + message( STATUS "LEDA cxx flags: ${LEDA_CXX_FLAGS}" ) uniquely_add_flags( CMAKE_CXX_FLAGS ${LEDA_CXX_FLAGS} ) endif() diff --git a/Installation/src/CMakeLists.txt b/Installation/src/CMakeLists.txt index 6caf13a6e13..b384261e951 100644 --- a/Installation/src/CMakeLists.txt +++ b/Installation/src/CMakeLists.txt @@ -128,8 +128,7 @@ foreach(package ${CGAL_CONFIGURED_PACKAGES}) cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_INCLUDE_DIRS "" ) cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES "" ) cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES_DIRS "" ) - - if (${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "Core") + if (${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "CGAL_Core") if (NOT CGAL_NO_CORE) configure_component( ${package}/src/${CGAL_CONFIGURED_LIBRARY_NAME} ${CGAL_CONFIGURED_LIBRARY_NAME}) else(NOT CGAL_NO_CORE) From 7bd3e3698e2da46ec11edb82847c41b4e97e7754 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 15 Mar 2013 17:34:53 +0100 Subject: [PATCH 05/31] use CGAL::compare instead of compare to avoid Koenig lookup --- .../CGAL/Regular_triangulation_euclidean_traits_3.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_euclidean_traits_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_euclidean_traits_3.h index a6b20f7900a..a2aae5a00bc 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_euclidean_traits_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_euclidean_traits_3.h @@ -398,7 +398,7 @@ public: const Weighted_point_3 & s, const FT& w) const { - return compare( + return CGAL::compare( squared_radius_orthogonal_sphereC3( p.x(),p.y(),p.z(),p.weight(), q.x(),q.y(),q.z(),q.weight(), @@ -413,7 +413,7 @@ public: const Weighted_point_3 & r, const FT& w) const { - return compare( + return CGAL::compare( squared_radius_smallest_orthogonal_sphereC3( p.x(),p.y(),p.z(),p.weight(), q.x(),q.y(),q.z(),q.weight(), @@ -426,7 +426,7 @@ public: const Weighted_point_3 & q, const FT& w) const { - return compare( + return CGAL::compare( squared_radius_smallest_orthogonal_sphereC3( p.x(),p.y(),p.z(),p.weight(), q.x(),q.y(),q.z(),q.weight() ), @@ -437,7 +437,7 @@ public: const Weighted_point_3 & p, const FT& w) const { - return compare(-p.weight(),w); + return CGAL::compare(-p.weight(),w); } }; From d1d70fdce73a7c15219bb881a024a90b651c81bd Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 15 Mar 2013 18:23:52 +0100 Subject: [PATCH 06/31] CGAL_DISABLE_GMP can be set in the environment variables --- Installation/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index d958e9c3998..888722191db 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -523,7 +523,7 @@ set_special_prefix(QGLViewer QGLVIEWER) set_special_prefix(Coin3D COIN3D) # some libraries are essential (stl and Boost.Thread are treated in another way) -if(CGAL_DISABLE_GMP) +if("$ENV{CGAL_DISABLE_GMP}" OR CGAL_DISABLE_GMP) list(REMOVE_ITEM CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES GMP MPFR) unset(CGAL_CONFIGURED_LIBRARIES) unset(CGAL_CONFIGURED_LIBRARIES CACHE) From 2edb2bdfe724cbe0d0387fc9eb131fbad88275e7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sun, 17 Mar 2013 15:21:18 +0100 Subject: [PATCH 07/31] REMOVE_ITEM does not work with an empty list --- Installation/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 888722191db..57b24fce8a7 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -524,7 +524,10 @@ set_special_prefix(Coin3D COIN3D) # some libraries are essential (stl and Boost.Thread are treated in another way) if("$ENV{CGAL_DISABLE_GMP}" OR CGAL_DISABLE_GMP) - list(REMOVE_ITEM CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES GMP MPFR) + list(LENGTH CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES CGAL_ESSENTIAL_LENGTH) + if(NOT CGAL_ESSENTIAL_LENGTH EQUAL 0) + list(REMOVE_ITEM CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES GMP MPFR) + endif() unset(CGAL_CONFIGURED_LIBRARIES) unset(CGAL_CONFIGURED_LIBRARIES CACHE) unset(GMP_FOUND) From 18dc806094e12c3a987740b3a2747aa560f8467e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 19 Mar 2013 08:31:32 +0100 Subject: [PATCH 08/31] qualify compare with CGAL:: to avoid Koenig lookup --- .../include/CGAL/Cartesian/function_objects.h | 46 +++++++-------- .../CGAL/Homogeneous/function_objects.h | 58 +++++++++---------- .../include/CGAL/Kernel/function_objects.h | 36 ++++++------ 3 files changed, 70 insertions(+), 70 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index e0dbe23b017..fbcf19bcb85 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -167,8 +167,8 @@ namespace CartesianKernelFunctors { operator()( const Circle_2& c, const Point_2& p) const { typename K::Compute_squared_distance_2 squared_distance; - return enum_cast(CGAL_NTS compare(c.squared_radius(), - squared_distance(c.center(),p))); + return enum_cast(CGAL::compare(c.squared_radius(), + squared_distance(c.center(),p))); } result_type @@ -430,14 +430,14 @@ namespace CartesianKernelFunctors { result_type operator()(const T1& p, const T2& q, const T3& r) const { - return CGAL_NTS compare(squared_distance(p, q), squared_distance(p, r)); + return CGAL::compare(squared_distance(p, q), squared_distance(p, r)); } template result_type operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { - return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); + return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); } }; @@ -460,14 +460,14 @@ namespace CartesianKernelFunctors { result_type operator()(const T1& p, const T2& q, const T3& r) const { - return CGAL_NTS compare(squared_distance(p, q), squared_distance(p, r)); + return CGAL::compare(squared_distance(p, q), squared_distance(p, r)); } template result_type operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { - return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); + return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); } }; @@ -482,28 +482,28 @@ namespace CartesianKernelFunctors { result_type operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s, const FT& ft) const { - return CGAL_NTS compare(squared_radiusC3(p.x(), p.y(), p.z(), - q.x(), q.y(), q.z(), - r.x(), r.y(), r.z(), - s.x(), s.y(), s.z() ), - ft); + return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(), + q.x(), q.y(), q.z(), + r.x(), r.y(), r.z(), + s.x(), s.y(), s.z() ), + ft); } result_type operator()(const Point_3& p, const Point_3& q, const Point_3& r, const FT& ft) const { - return CGAL_NTS compare(squared_radiusC3(p.x(), p.y(), p.z(), - q.x(), q.y(), q.z(), - r.x(), r.y(), r.z()), - ft); + return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(), + q.x(), q.y(), q.z(), + r.x(), r.y(), r.z()), + ft); } result_type operator()(const Point_3& p, const Point_3& q, const FT& ft) const { - return CGAL_NTS compare(squared_radiusC3(p.x(), p.y(), p.z(), - q.x(), q.y(), q.z() ), - ft); + return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(), + q.x(), q.y(), q.z() ), + ft); } result_type @@ -623,7 +623,7 @@ namespace CartesianKernelFunctors { result_type operator()( const Point_2& p, const Point_2& q) const - { return CGAL_NTS compare(p.x(), q.x()); } + { return CGAL::compare(p.x(), q.x()); } result_type operator()( const Point_2& p, const Line_2& l, const Line_2& h) const @@ -654,7 +654,7 @@ namespace CartesianKernelFunctors { result_type operator()( const Point_3& p, const Point_3& q) const - { return CGAL_NTS compare(p.x(), q.x()); } + { return CGAL::compare(p.x(), q.x()); } }; template @@ -734,7 +734,7 @@ namespace CartesianKernelFunctors { result_type operator()( const Point_2& p, const Point_2& q) const - { return CGAL_NTS compare(p.y(), q.y()); } + { return CGAL::compare(p.y(), q.y()); } result_type operator()( const Point_2& p, const Line_2& l1, const Line_2& l2) const @@ -769,7 +769,7 @@ namespace CartesianKernelFunctors { result_type operator()( const Point_3& p, const Point_3& q) const - { return CGAL_NTS compare(p.y(), q.y()); } + { return CGAL::compare(p.y(), q.y()); } }; template @@ -781,7 +781,7 @@ namespace CartesianKernelFunctors { result_type operator()( const Point_3& p, const Point_3& q) const - { return CGAL_NTS compare(p.z(), q.z()); } + { return CGAL::compare(p.z(), q.z()); } }; template diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h index b9dc6e940ed..fa8e2671791 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h @@ -115,8 +115,8 @@ namespace HomogeneousKernelFunctors { operator()( const Circle_2& c, const Point_2& p) const { typename K::Compute_squared_distance_2 squared_distance; - return enum_cast(CGAL_NTS compare(c.squared_radius(), - squared_distance(c.center(),p))); + return enum_cast(CGAL::compare(c.squared_radius(), + squared_distance(c.center(),p))); } result_type @@ -664,14 +664,14 @@ namespace HomogeneousKernelFunctors { result_type operator()(const T1& p, const T2& q, const T3& r) const { - return CGAL_NTS compare(squared_distance(p, q), squared_distance(p, r)); + return CGAL::compare(squared_distance(p, q), squared_distance(p, r)); } template result_type operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { - return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); + return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); } }; @@ -717,14 +717,14 @@ namespace HomogeneousKernelFunctors { result_type operator()(const T1& p, const T2& q, const T3& r) const { - return CGAL_NTS compare(squared_distance(p, q), squared_distance(p, r)); + return CGAL::compare(squared_distance(p, q), squared_distance(p, r)); } template result_type operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { - return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); + return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); } }; @@ -754,11 +754,11 @@ namespace HomogeneousKernelFunctors { if (l1_sign > l2_sign) return LARGER; if (l1_sign > 0) - return CGAL_NTS compare( CGAL_NTS abs(l1.a() * l2.b()), - CGAL_NTS abs(l2.a() * l1.b()) ); + return CGAL::compare( CGAL::abs(l1.a() * l2.b()), + CGAL::abs(l2.a() * l1.b()) ); - return CGAL_NTS compare( CGAL_NTS abs(l2.a() * l1.b()), - CGAL_NTS abs(l1.a() * l2.b()) ); + return CGAL::compare( CGAL::abs(l2.a() * l1.b()), + CGAL::abs(l1.a() * l2.b()) ); } // FIXME result_type @@ -843,7 +843,7 @@ namespace HomogeneousKernelFunctors { result_type operator()( const Point_2& p, const Line_2& h1, const Line_2& h2) const - { return CGAL_NTS compare(h1.x_at_y( p.y() ), h2.x_at_y( p.y() )); } + { return CGAL::compare(h1.x_at_y( p.y() ), h2.x_at_y( p.y() )); } // FIXME result_type @@ -893,7 +893,7 @@ namespace HomogeneousKernelFunctors { // same x and y pV = p.hz()*q.hw(); qV = q.hz()*p.hw(); - return CGAL_NTS compare(pV, qV); + return CGAL::compare(pV, qV); } }; @@ -923,7 +923,7 @@ namespace HomogeneousKernelFunctors { pV = phy*qhw; qV = qhy*phw; } - return CGAL_NTS compare(pV, qV); + return CGAL::compare(pV, qV); } }; @@ -953,7 +953,7 @@ namespace HomogeneousKernelFunctors { pV = phx*qhw; qV = qhx*phw; } - return CGAL_NTS compare(pV, qV); + return CGAL::compare(pV, qV); } }; @@ -981,7 +981,7 @@ namespace HomogeneousKernelFunctors { // same x pV = p.hy()*q.hw(); qV = q.hy()*p.hw(); - return CGAL_NTS compare(pV, qV); + return CGAL::compare(pV, qV); } }; @@ -996,7 +996,7 @@ namespace HomogeneousKernelFunctors { result_type operator()( const Point_2& p, const Point_2& q) const { - return CGAL_NTS compare(p.hx()*q.hw(), q.hx()*p.hw()); + return CGAL::compare(p.hx()*q.hw(), q.hx()*p.hw()); } result_type @@ -1031,7 +1031,7 @@ namespace HomogeneousKernelFunctors { result_type operator()( const Point_3& p, const Point_3& q) const - { return CGAL_NTS compare(p.hx() * q.hw(), q.hx() * p.hw() ); } + { return CGAL::compare(p.hx() * q.hw(), q.hx() * p.hw() ); } }; template @@ -1055,7 +1055,7 @@ namespace HomogeneousKernelFunctors { result_type operator()( const Point_2& p, const Line_2& h1, const Line_2& h2) const - { return CGAL_NTS compare(h1.y_at_x( p.x() ), h2.y_at_x( p.x() )); } + { return CGAL::compare(h1.y_at_x( p.x() ), h2.y_at_x( p.x() )); } // FIXME result_type @@ -1128,11 +1128,11 @@ namespace HomogeneousKernelFunctors { FT s1stx = s1sx-s1tx; FT s2stx = s2sx-s2tx; - return CGAL_NTS compare(s1sx, s1tx) * - CGAL_NTS compare(s2sx, s2tx) * - CGAL_NTS compare(-(s1sx-px)*(s1sy-s1ty)*s2stx, - (s2sy-s1sy)*s2stx*s1stx - -(s2sx-px)*(s2sy-s2ty)*s1stx); + return CGAL::compare(s1sx, s1tx) * + CGAL::compare(s2sx, s2tx) * + CGAL::compare(-(s1sx-px)*(s1sy-s1ty)*s2stx, + (s2sy-s1sy)*s2stx*s1stx + -(s2sx-px)*(s2sy-s2ty)*s1stx); } else { if (s1sx == s1tx) { // s1 is vertical @@ -1171,7 +1171,7 @@ namespace HomogeneousKernelFunctors { const RT& phw = p.hw(); const RT& qhy = q.hy(); const RT& qhw = q.hw(); - return CGAL_NTS compare(phy * qhw, qhy * phw); + return CGAL::compare(phy * qhw, qhy * phw); } result_type @@ -1206,7 +1206,7 @@ namespace HomogeneousKernelFunctors { result_type operator()( const Point_3& p, const Point_3& q) const - { return CGAL_NTS compare(p.hy() * q.hw(), q.hy() * p.hw() ); } + { return CGAL::compare(p.hy() * q.hw(), q.hy() * p.hw() ); } }; template @@ -1218,7 +1218,7 @@ namespace HomogeneousKernelFunctors { result_type operator()( const Point_3& p, const Point_3& q) const - { return CGAL_NTS compare(p.hz() * q.hw(), q.hz() * p.hw() ); } + { return CGAL::compare(p.hz() * q.hw(), q.hz() * p.hw() ); } }; template @@ -4185,7 +4185,7 @@ namespace HomogeneousKernelFunctors { RT C = qhx*rhw - qhw*rhx; RT D = qhy*rhw - qhw*rhy; - return CGAL_NTS compare(A*D, B*C); + return CGAL::compare(A*D, B*C); } result_type @@ -4318,8 +4318,8 @@ namespace HomogeneousKernelFunctors { const RT& thw = t.hw(); return enum_cast( - CGAL_NTS compare((thx*phw-phx*thw)*(qhx*thw-thx*qhw), - (thy*phw-phy*thw)*(thy*qhw-qhy*thw)) ); + CGAL::compare((thx*phw-phx*thw)*(qhx*thw-thx*qhw), + (thy*phw-phy*thw)*(thy*qhw-qhy*thw)) ); } result_type diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index ec304568b2c..b8ebb47d329 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -223,9 +223,9 @@ namespace CommonKernelFunctors { if(sc_prod_1 >= 0 ) { if(cosine >= 0) { // the two cosine are >= 0, cosine is decreasing on [0,1] - return compare(CGAL::square(cosine)* - abac1.squared_length()*abad1.squared_length(), - CGAL::square(sc_prod_1)); + return CGAL::compare(CGAL::square(cosine)* + abac1.squared_length()*abad1.squared_length(), + CGAL::square(sc_prod_1)); } else { return SMALLER; @@ -234,9 +234,9 @@ namespace CommonKernelFunctors { else { if(cosine < 0) { // the two cosine are < 0, cosine is increasing on [-1,0] - return compare(CGAL::square(sc_prod_1), - CGAL::square(cosine)* - abac1.squared_length()*abad1.squared_length()); + return CGAL::compare(CGAL::square(sc_prod_1), + CGAL::square(cosine)* + abac1.squared_length()*abad1.squared_length()); } else return LARGER; @@ -272,10 +272,10 @@ namespace CommonKernelFunctors { if(sc_prod_1 >= 0 ) { if(sc_prod_2 >= 0) { // the two cosine are >= 0, cosine is decreasing on [0,1] - return compare(CGAL::square(sc_prod_2)* - abac1.squared_length()*abad1.squared_length(), - CGAL::square(sc_prod_1)* - abac2.squared_length()*abad2.squared_length()); + return CGAL::compare(CGAL::square(sc_prod_2)* + abac1.squared_length()*abad1.squared_length(), + CGAL::square(sc_prod_1)* + abac2.squared_length()*abad2.squared_length()); } else { return SMALLER; @@ -284,10 +284,10 @@ namespace CommonKernelFunctors { else { if(sc_prod_2 < 0) { // the two cosine are < 0, cosine is increasing on [-1,0] - return compare(CGAL::square(sc_prod_1)* - abac2.squared_length()*abad2.squared_length(), - CGAL::square(sc_prod_2)* - abac1.squared_length()*abad1.squared_length()); + return CGAL::compare(CGAL::square(sc_prod_1)* + abac2.squared_length()*abad2.squared_length(), + CGAL::square(sc_prod_2)* + abac1.squared_length()*abad1.squared_length()); } else return LARGER; @@ -306,14 +306,14 @@ namespace CommonKernelFunctors { result_type operator()(const T1& p, const T2& q, const FT& d2) const { - return CGAL_NTS compare(squared_distance(p, q), d2); + return CGAL::compare(squared_distance(p, q), d2); } template result_type operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { - return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); + return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); } }; @@ -328,14 +328,14 @@ namespace CommonKernelFunctors { result_type operator()(const T1& p, const T2& q, const FT& d2) const { - return CGAL_NTS compare(squared_distance(p, q), d2); + return CGAL::compare(squared_distance(p, q), d2); } template result_type operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { - return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); + return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); } }; From 7e7ff495bf37973387eff9f95c6b9b27c0b3df18 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 22 Mar 2013 13:55:00 +0100 Subject: [PATCH 09/31] use Arithmetic_kernel (only in testsuite as undocumented to not explicitely write leda_rational/Gmpq/Quotient --- .../construction_test_suite_generator.cpp | 7 ++----- .../ex_kernel_point.cpp | 5 +++-- .../ex_kernel_segment.cpp | 5 +++-- .../test_construction.cpp | 18 +++-------------- .../Arrangement_on_surface_2/test_dual.cpp | 20 ++++--------------- 5 files changed, 15 insertions(+), 40 deletions(-) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/construction_test_suite_generator.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/construction_test_suite_generator.cpp index 044943df185..958120ccae1 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/construction_test_suite_generator.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/construction_test_suite_generator.cpp @@ -1,9 +1,6 @@ - +#include #include -#include -#include -#include #include #include @@ -17,7 +14,7 @@ #include "utils.h" -typedef CGAL::Gmpq Number_type; +typedef CGAL::Arithmetic_kernel::Rational Number_type; typedef CGAL::Simple_cartesian Kernel; typedef CGAL::Arr_segment_traits_2 Base_traits_2; typedef Base_traits_2::Curve_2 Base_curve_2; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/ex_kernel_point.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/ex_kernel_point.cpp index acf5eb3bc8b..cbf6ee7cfe2 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/ex_kernel_point.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/ex_kernel_point.cpp @@ -2,7 +2,7 @@ * kernel-object. */ #include -#include +#include #include #include #include @@ -116,7 +116,8 @@ struct Ext_seg_kernel : {}; // The remaining types: -typedef CGAL::Gmpq Number_type; +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Number_type; typedef Ext_seg_kernel Kernel; typedef CGAL::Arr_non_caching_segment_traits_2 Traits; typedef Traits::Point_2 Point_2; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/ex_kernel_segment.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/ex_kernel_segment.cpp index f035167c5b3..c63d6427f76 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/ex_kernel_segment.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/ex_kernel_segment.cpp @@ -2,7 +2,7 @@ * kernel-object. */ #include -#include +#include #include #include #include @@ -93,7 +93,8 @@ struct Ext_seg_kernel : {}; // The remaining types: -typedef CGAL::Gmpq Number_type; + +typedef CGAL::Arithmetic_kernel::Rational Number_type; typedef Ext_seg_kernel Kernel; typedef CGAL::Arr_non_caching_segment_traits_2 Traits; typedef Traits::Point_2 Point_2; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp index 62c03bf7394..16741b6f28c 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp @@ -1,19 +1,5 @@ -#include - -#ifdef CGAL_USE_GMP - - #include - - typedef CGAL::Gmpq Number_type; - -#else - #include - #include - - typedef CGAL::Quotient Number_type; - -#endif +#include #include #include #include @@ -107,6 +93,8 @@ are_same_results(Arrangement& arr, return true; } +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Number_type; typedef CGAL::Simple_cartesian Kernel; typedef CGAL::Arr_segment_traits_2 Base_traits_2; typedef Base_traits_2::Point_2 Base_point_2; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_dual.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_dual.cpp index 9cb13e98626..7fcd23eef91 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_dual.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_dual.cpp @@ -1,3 +1,5 @@ + +#include #include #include #include @@ -8,22 +10,8 @@ #include -#ifdef CGAL_USE_GMP - - // GMP is installed. Use the GMP rational number-type. - #include - - typedef CGAL::Gmpq Number_type; - -#else - - // GMP is not installed. Use CGAL's exact rational number-type. - #include - #include - - typedef CGAL::Quotient Number_type; - -#endif +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Number_type; typedef CGAL::Cartesian Kernel; typedef CGAL::Arr_segment_traits_2 Traits_2; From 4d2f9280e8348a4b0e5e25573ef2867f749c9782 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 22 Mar 2013 15:00:04 +0100 Subject: [PATCH 10/31] Write an eol --- Kernel_23/test/Kernel_23/include/CGAL/_test_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_io.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_io.h index fdb913e2084..2ec2cd10cff 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_io.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_io.h @@ -31,7 +31,7 @@ _test_io_for(const T& t) { { std::ofstream oFile("Test_IO.out", std::ios::out); - oFile << t; + oFile << t << std::endl; } std::ifstream iFile("Test_IO.out", std::ios::in); From 37533355fe87d01ea502ffa9fc1b53b9d96c824b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 22 Mar 2013 16:05:46 +0100 Subject: [PATCH 11/31] also test leda if it is available --- .../Segment_Delaunay_graph_2/test_sdg_2_et.cpp | 16 +++++++++++++++- .../test_sdg_hierarchy_2_et.cpp | 14 +++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_2_et.cpp b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_2_et.cpp index 13b1668d707..322f9d468f2 100644 --- a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_2_et.cpp +++ b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_2_et.cpp @@ -5,7 +5,21 @@ #include // choose number type -#ifdef CGAL_USE_GMP + +// choose number type +#ifdef CGAL_USE_LEDA + +# include +typedef leda_rational exact_ring_t; +typedef leda_rational exact_field_t; + +namespace CGAL { +// needed for the drawing methods +leda_rational sqrt(const leda_rational& x) { + return leda_rational( CGAL::sqrt( CGAL::to_double(x) ) ); +} +} +#elif defined( CGAL_USE_GMP ) # include typedef CGAL::Gmpq exact_ring_t; diff --git a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_hierarchy_2_et.cpp b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_hierarchy_2_et.cpp index 30cf2507dce..b872a1261b3 100644 --- a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_hierarchy_2_et.cpp +++ b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_hierarchy_2_et.cpp @@ -5,7 +5,19 @@ #include // choose number type -#ifdef CGAL_USE_GMP +#ifdef CGAL_USE_LEDA + +# include +typedef leda_rational exact_ring_t; +typedef leda_rational exact_field_t; + +namespace CGAL { +// needed for the drawing methods +leda_rational sqrt(const leda_rational& x) { + return leda_rational( CGAL::sqrt( CGAL::to_double(x) ) ); +} +} +#elif defined( CGAL_USE_GMP ) # include typedef CGAL::Gmpq exact_ring_t; From 16806b0c4418d564eb210782dfded1ab44239749 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 22 Mar 2013 16:14:07 +0100 Subject: [PATCH 12/31] also test leda if it is available --- .../test/Minkowski_sum_2/test_Minkowski_sum.cpp | 14 +++----------- .../test/Minkowski_sum_2/test_approx_offset.cpp | 14 +++----------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/Minkowski_sum_2/test/Minkowski_sum_2/test_Minkowski_sum.cpp b/Minkowski_sum_2/test/Minkowski_sum_2/test_Minkowski_sum.cpp index 94ebc923ecc..4ae728bbef2 100644 --- a/Minkowski_sum_2/test/Minkowski_sum_2/test_Minkowski_sum.cpp +++ b/Minkowski_sum_2/test/Minkowski_sum_2/test_Minkowski_sum.cpp @@ -1,15 +1,7 @@ -#include +#include -#ifdef CGAL_USE_GMP - // GMP is installed. Use the GMP rational number-type. - #include - typedef CGAL::Gmpq Rational; -#else - // GMP is not installed. Use CGAL's exact rational number-type. - #include - #include - typedef CGAL::Quotient Rational; -#endif +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Rational; #include #include diff --git a/Minkowski_sum_2/test/Minkowski_sum_2/test_approx_offset.cpp b/Minkowski_sum_2/test/Minkowski_sum_2/test_approx_offset.cpp index d378a271366..44ec37f8f78 100644 --- a/Minkowski_sum_2/test/Minkowski_sum_2/test_approx_offset.cpp +++ b/Minkowski_sum_2/test/Minkowski_sum_2/test_approx_offset.cpp @@ -1,15 +1,7 @@ -#include +#include -#ifdef CGAL_USE_GMP - // GMP is installed. Use the GMP rational number-type. - #include - typedef CGAL::Gmpq Rational; -#else - // GMP is not installed. Use CGAL's exact rational number-type. - #include - #include - typedef CGAL::Quotient Rational; -#endif +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Rational; #include #include From e370c5eaa54fd7946b8cabf721a0c10ced6c08b4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 22 Mar 2013 16:24:47 +0100 Subject: [PATCH 13/31] also test leda if it is available --- .../test/Envelope_2/test_envelope_segments.cpp | 17 +++-------------- Envelope_3/test/Envelope_3/triangles_test.cpp | 6 +++--- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Envelope_2/test/Envelope_2/test_envelope_segments.cpp b/Envelope_2/test/Envelope_2/test_envelope_segments.cpp index db3eb41389f..fb1ea263ff5 100644 --- a/Envelope_2/test/Envelope_2/test_envelope_segments.cpp +++ b/Envelope_2/test/Envelope_2/test_envelope_segments.cpp @@ -1,16 +1,4 @@ -#include - -#ifdef CGAL_USE_GMP - // GMP is installed. Use the GMP rational number-type. - #include - typedef CGAL::Gmpq NT; -#else - // GMP is not installed. Use CGAL's exact rational number-type. - #include - #include - typedef CGAL::Quotient NT; -#endif - +#include #include #include #include @@ -23,7 +11,8 @@ using std::strcmp; -typedef CGAL::Gmpq NT; +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational NT; typedef CGAL::Cartesian Kernel; typedef CGAL::Arr_segment_traits_2 Segment_traits_2; typedef CGAL::Arr_curve_data_traits_2 #include -#include #include #include @@ -14,7 +13,8 @@ #include #include -typedef CGAL::Gmpq NT; +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational NT; typedef CGAL::Cartesian Kernel; typedef Kernel::Point_3 Point_3; From 5cc398f7fe779ce692f41c7444f7b5d3cb595cad Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 22 Mar 2013 16:41:54 +0100 Subject: [PATCH 14/31] also test leda if it is available --- .../bbox_other_do_intersect_test.cpp | 5 +++-- .../triangle_3_triangle_3_intersection.cpp | 21 +++++++------------ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp index 64e2042b7fd..8d2574c0584 100644 --- a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp +++ b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp @@ -678,10 +678,11 @@ int main() std::cout << std::endl << "Testing with Simple_cartesian..." << std::endl ; b &= test_kernel >(true); - + +#ifdef CGAL_USE_GMP std::cout << std::endl << "Testing with Simple_cartesian..." << std::endl ; b &= test_kernel >(true); - +#endif std::cout << std::endl << "Testing with Cartesian..." << std::endl ; b &= test_kernel >(false); diff --git a/Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection.cpp b/Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection.cpp index 2e576c43233..9e45a29a493 100644 --- a/Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection.cpp +++ b/Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection.cpp @@ -1,18 +1,13 @@ #include -#ifdef CGAL_USE_GMP -#include -typedef CGAL::Gmpq NT; -#else -#include -#include -typedef CGAL::Quotient NT; -#endif +#include -typedef CGAL::Cartesian Kernel; -typedef Kernel::Triangle_3 Triangle; -typedef Kernel::Point_3 Point; -typedef Kernel::Segment_3 Segment; -typedef std::vector Polygon2; +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational NT; +typedef CGAL::Cartesian Kernel; +typedef Kernel::Triangle_3 Triangle; +typedef Kernel::Point_3 Point; +typedef Kernel::Segment_3 Segment; +typedef std::vector Polygon2; void test_coplanar_triangles(){ CGAL::Object obj; From d2574f044d473893d61c165838c1db84ba3706b2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 22 Mar 2013 16:44:02 +0100 Subject: [PATCH 15/31] also test leda if it is available --- .../Intersections_3/bbox_other_do_intersect_test.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp index 8d2574c0584..f59bb46f311 100644 --- a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp +++ b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp @@ -26,7 +26,10 @@ #if defined(BOOST_MSVC) # pragma warning(disable:4244) // int to float conversion warning #endif +#include +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Rational; #include #include #include @@ -679,10 +682,9 @@ int main() std::cout << std::endl << "Testing with Simple_cartesian..." << std::endl ; b &= test_kernel >(true); -#ifdef CGAL_USE_GMP - std::cout << std::endl << "Testing with Simple_cartesian..." << std::endl ; - b &= test_kernel >(true); -#endif + std::cout << std::endl << "Testing with Simple_cartesian..." << std::endl ; + b &= test_kernel >(true); + std::cout << std::endl << "Testing with Cartesian..." << std::endl ; b &= test_kernel >(false); From 368a32190103226dd62da5d0d0be0836bc78fecb Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 22 Mar 2013 17:00:05 +0100 Subject: [PATCH 16/31] also test leda if it is available --- .../agg_op_test_suite_generator.cpp | 22 ++++-------------- .../bop_test_suite_generator.cpp | 22 ++++-------------- .../Boolean_set_operations_2/test_agg_op.cpp | 21 ++++------------- .../Boolean_set_operations_2/test_bop.cpp | 23 +++++-------------- .../test_connect_holes.cpp | 15 +++--------- .../test_polygon_validation.cpp | 19 ++++----------- 6 files changed, 28 insertions(+), 94 deletions(-) diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/agg_op_test_suite_generator.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/agg_op_test_suite_generator.cpp index ca296612d82..d922f6a1b04 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/agg_op_test_suite_generator.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/agg_op_test_suite_generator.cpp @@ -1,20 +1,4 @@ -#include - -#ifdef CGAL_USE_GMP - - #include - - typedef CGAL::Gmpq Number_type; - -#else - - #include - #include - - typedef CGAL::Quotient Number_type; - -#endif - +#include #include #include #include @@ -28,6 +12,10 @@ #include #include + +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Number_type; + // instead of //typedef CGAL::Simple_cartesian Kernel; // workaround for VC++ diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/bop_test_suite_generator.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/bop_test_suite_generator.cpp index 54a5c741a92..d7bcb9c3878 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/bop_test_suite_generator.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/bop_test_suite_generator.cpp @@ -1,20 +1,4 @@ -#include - -#ifdef CGAL_USE_GMP - - #include - - typedef CGAL::Gmpq Number_type; - -#else - - #include - #include - - typedef CGAL::Quotient Number_type; - -#endif - +#include #include #include #include @@ -28,6 +12,10 @@ #include #include + +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Number_type; + // instead of //typedef CGAL::Simple_cartesian Kernel; // workaround for VC++ diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_agg_op.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_agg_op.cpp index 24c83a445d8..d453b7befe3 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_agg_op.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_agg_op.cpp @@ -1,21 +1,6 @@ -#include - -#ifdef CGAL_USE_GMP - - #include - - typedef CGAL::Gmpq Number_type; - -#else - - #include - #include - - typedef CGAL::Quotient Number_type; - -#endif - #include + +#include #include #include #include @@ -29,6 +14,8 @@ #include #include +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Number_type; // instead of //typedef CGAL::Simple_cartesian Kernel; diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_bop.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_bop.cpp index e4e420178b5..d8636b4c51e 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_bop.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_bop.cpp @@ -1,21 +1,6 @@ -#include - -#ifdef CGAL_USE_GMP - - #include - - typedef CGAL::Gmpq Number_type; - -#else - - #include - #include - - typedef CGAL::Quotient Number_type; - -#endif - #include + +#include #include #include #include @@ -29,6 +14,10 @@ #include #include + +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Number_type; + // instead of //typedef CGAL::Simple_cartesian Kernel; // workaround for VC++ diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_connect_holes.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_connect_holes.cpp index e155fe33d47..a97c95b7c8a 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_connect_holes.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_connect_holes.cpp @@ -5,18 +5,9 @@ #ifndef CGAL_BSO_RATIONAL_NT_H #define CGAL_BSO_RATIONAL_NT_H -#include - -#ifdef CGAL_USE_GMP - // GMP is installed. Use the GMP rational number-type. - #include - typedef CGAL::Gmpq Number_type; -#else - // GMP is not installed. Use CGAL's exact rational number-type. - #include - #include - typedef CGAL::Quotient Number_type; -#endif +#include +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Number_type; #endif #include diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_polygon_validation.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_polygon_validation.cpp index e3217b7e954..f24820ef72a 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_polygon_validation.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_polygon_validation.cpp @@ -3,18 +3,7 @@ #include #include -#ifdef CGAL_USE_GMP - // GMP is installed. Use the GMP rational number-type. - #include - typedef CGAL::Gmpq Number_type; -#else - // GMP is not installed. Use CGAL's exact rational number-type. - #include - #include - typedef CGAL::Quotient Number_type; -#endif - - +#include #include #include #include @@ -24,8 +13,10 @@ #include #include +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational Number_type; typedef CGAL::Cartesian Kernel; -typedef CGAL::Gps_segment_traits_2 Traits_2; +typedef CGAL::Gps_segment_traits_2 Traits_2; typedef Traits_2::Polygon_2 Polygon_2; typedef Traits_2::Polygon_with_holes_2 Polygon_with_holes_2; @@ -99,7 +90,7 @@ special_warnings(const char *, << std::endl; } -int main (int argc, char * argv[]) +int main() { std::cerr << "Modify the w-a-r-n-i-n-g-s handler...\n"; CGAL::set_warning_handler(special_warnings); From 464c42cb3d20414a7f7e6913c4d8403bc993ed7c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 22 Mar 2013 20:54:53 +0100 Subject: [PATCH 17/31] also test leda if it is available --- .../test/Bounding_volumes/interface_check.cpp | 6 +++--- .../test/Bounding_volumes/lp-alg-exact.cpp | 11 ++++++----- .../test/Bounding_volumes/min_sphere_test.cpp | 5 +++-- .../Bounding_volumes/min_sphere_traits_2_test.cpp | 5 +++-- .../Bounding_volumes/min_sphere_traits_3_test.cpp | 13 +++++-------- .../test/Bounding_volumes/test_Min_circle.cpp | 12 +++--------- .../test/Bounding_volumes/test_Min_ellipse_2.cpp | 15 ++++++--------- 7 files changed, 29 insertions(+), 38 deletions(-) diff --git a/Bounding_volumes/test/Bounding_volumes/interface_check.cpp b/Bounding_volumes/test/Bounding_volumes/interface_check.cpp index 634f9ad7175..745e8165f74 100644 --- a/Bounding_volumes/test/Bounding_volumes/interface_check.cpp +++ b/Bounding_volumes/test/Bounding_volumes/interface_check.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -13,8 +13,8 @@ #include // The program will work with numbers of type FieldType. -// You can change FieldType to leda_real, for instance. -typedef CGAL::Gmpq FieldType; +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational FieldType; template CGAL::Tag_true get_is_exact_tag(const FT&) { diff --git a/Bounding_volumes/test/Bounding_volumes/lp-alg-exact.cpp b/Bounding_volumes/test/Bounding_volumes/lp-alg-exact.cpp index 2535034ab95..835e321e7d8 100644 --- a/Bounding_volumes/test/Bounding_volumes/lp-alg-exact.cpp +++ b/Bounding_volumes/test/Bounding_volumes/lp-alg-exact.cpp @@ -10,15 +10,16 @@ #include #include #include -#include +#include #include #include #include // The program will work with numbers of type FieldType. -// You can change FieldType to leda_real, for instance. -typedef CGAL::Gmpq FieldType; + +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational FieldType; class Ball { private: // representation: @@ -60,8 +61,8 @@ struct BallTraits { }; double to_double(const std::pair& p,const FieldType& disc) { - return to_double(p.first)+to_double(p.second)* - std::sqrt(to_double(disc)); + return CGAL::to_double(p.first)+CGAL::to_double(p.second)* + std::sqrt(CGAL::to_double(disc)); } double uniform() { // a (platform independent) random number generator diff --git a/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp b/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp index 213ad9cb431..aa69c71f504 100644 --- a/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp +++ b/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp @@ -30,6 +30,7 @@ #include +#include #include #include #include @@ -37,11 +38,11 @@ #include #include #include -#include using namespace CGAL; -typedef Gmpq NT; +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational NT; typedef NT FT; typedef NT RT; typedef Cartesian_d C; diff --git a/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_2_test.cpp b/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_2_test.cpp index 97d33a05742..071d2d5b85d 100644 --- a/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_2_test.cpp +++ b/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_2_test.cpp @@ -39,11 +39,12 @@ #include #include #include //why is this not in Min_circle_2.h -#include +#include using namespace CGAL; -typedef Gmpq NT; +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational NT; typedef NT FT; typedef NT RT; typedef Cartesian C; diff --git a/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_3_test.cpp b/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_3_test.cpp index 1602cf77d11..f7bb4c42d7f 100644 --- a/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_3_test.cpp +++ b/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_3_test.cpp @@ -25,23 +25,20 @@ // implementation: dD Smallest Enclosing Sphere // ============================================================================ -// hack to overcome external linkage conflict warning in MIPS -#define __SGI_STL_INTERNAL_RELOPS - #include - -// only do something if LEDA available -#include +#include #include #include #include #include #include -#include + +#include using namespace CGAL; -typedef Gmpq NT; +// leda_rational, or Gmpq, or Quotient +typedef CGAL::Arithmetic_kernel::Rational NT; typedef NT FT; typedef NT RT; typedef Cartesian C; diff --git a/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp b/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp index 94895d6cb42..600423c3dd5 100644 --- a/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp +++ b/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp @@ -25,6 +25,7 @@ // implementation: test program for 2D Smallest Enclosing Circle // ============================================================================ +#include #include #include #include @@ -37,15 +38,8 @@ #include #include -#ifdef CGAL_USE_LEDA_FOR_OPTIMISATION_TEST -# include - typedef leda_integer Rt; - typedef CGAL::Quotient< leda_integer > Ft; -#else -# include - typedef CGAL::Gmpz Rt; - typedef CGAL::Quotient< CGAL::Gmpz > Ft; -#endif +typedef CGAL::Arithmetic_kernel::Integer Rt; +typedef CGAL::Quotient< Rt > Ft; typedef CGAL::Cartesian< Ft > KerC; typedef CGAL::Homogeneous< Rt > KerH; diff --git a/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp b/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp index 323c08789b2..ea1da135c73 100644 --- a/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp +++ b/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp @@ -25,6 +25,7 @@ // implementation: test program for 2D Smallest Enclosing Ellipse // ============================================================================ +#include #include #include #include @@ -37,15 +38,11 @@ #include #include -#ifdef CGAL_USE_LEDA_FOR_OPTIMISATION_TEST -# include - typedef leda_integer Rt; - typedef CGAL::Quotient< leda_integer > Ft; -#else -# include - typedef CGAL::Gmpz Rt; - typedef CGAL::Quotient< CGAL::Gmpz > Ft; -#endif + +typedef CGAL::Arithmetic_kernel::Integer Rt; +typedef CGAL::Quotient< Rt > Ft; + + #ifdef CGAL_USE_CORE #include From 4b91ac49af221f9f3724eb789fff8096b1c06511 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 22 Mar 2013 21:39:51 +0100 Subject: [PATCH 18/31] also test leda if it is available --- Nef_2/include/CGAL/Nef_2/PM_overlayer.h | 2 +- Nef_2/include/CGAL/Nef_2/PM_point_locator.h | 2 +- .../CGAL/Nef_2/Segment_overlay_traits.h | 27 +++++-------------- Nef_2/test/Nef_2/Nef_polyhedron_2-test.cpp | 17 ++++-------- Nef_2/test/Nef_2/nef_2_point_location.cpp | 5 ++-- 5 files changed, 17 insertions(+), 36 deletions(-) diff --git a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h index cd0241279ef..83e6b9ebe79 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h +++ b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h @@ -39,7 +39,7 @@ #include -#ifndef CGAL_USE_LEDA +#ifndef CGAL_USE_LEDA_LIBRARY #define LEDA_MEMORY(t) #endif diff --git a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h index 27a4615789b..45b8710a0f7 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h @@ -35,7 +35,7 @@ #include #endif -#ifdef CGAL_USE_LEDA +#ifdef CGAL_USE_LEDA_LIBRARY #include # if __LEDA__ > 410 && __LEDA__ < 441 # define CGAL_USING_PPL diff --git a/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h b/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h index fab931c5c3d..7a77f26b023 100644 --- a/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h +++ b/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h @@ -24,22 +24,9 @@ #define CGAL_NEF_DEBUG 23 #include -#if defined(CGAL_USE_LEDA) +#if defined(CGAL_USE_LEDA_LIBRARY) #include -#if CGAL_LEDA_VERSION < 500 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#else + #include #include #include @@ -52,7 +39,7 @@ #include #include #include -#endif + #include #include @@ -444,8 +431,8 @@ public: } // namespace CGAL -#endif // defined(CGAL_USE_LEDA) -#if !defined(CGAL_USE_LEDA) +#endif // defined(CGAL_USE_LEDA_LIBRARY) +#if !defined(CGAL_USE_LEDA_LIBRARY) #include #include #include @@ -1123,10 +1110,10 @@ public: } // namespace CGAL -#endif // !defined(CGAL_USE_LEDA) +#endif // !defined(CGAL_USE_LEDA_LIBRARY) namespace CGAL { -#if defined(CGAL_USE_LEDA) +#if defined(CGAL_USE_LEDA_LIBRARY) #define Segment_overlay_traits leda_seg_overlay_traits static const char* const sweepversion = "LEDA segment overlay sweep"; #else diff --git a/Nef_2/test/Nef_2/Nef_polyhedron_2-test.cpp b/Nef_2/test/Nef_2/Nef_polyhedron_2-test.cpp index 9cee14926c5..2aed27842a2 100644 --- a/Nef_2/test/Nef_2/Nef_polyhedron_2-test.cpp +++ b/Nef_2/test/Nef_2/Nef_polyhedron_2-test.cpp @@ -4,23 +4,16 @@ #include #include #include +#include -#ifdef CGAL_USE_LEDA -#include -#include -typedef leda_integer Integer; -typedef leda_rational Rational; -#else -#ifdef CGAL_USE_GMP -#include -#include -typedef CGAL::Gmpz Integer; -typedef CGAL::Gmpq Rational; +#if defined (CGAL_USE_LEDA) || defined (CGAL_USE_GMP) + +typedef CGAL::Arithmetic_kernel::Integer Integer; +typedef CGAL::Arithmetic_kernel::Rational Rational; #else typedef long Integer; typedef double Rational; #endif -#endif diff --git a/Nef_2/test/Nef_2/nef_2_point_location.cpp b/Nef_2/test/Nef_2/nef_2_point_location.cpp index f584334c52e..2a79154d722 100644 --- a/Nef_2/test/Nef_2/nef_2_point_location.cpp +++ b/Nef_2/test/Nef_2/nef_2_point_location.cpp @@ -1,6 +1,7 @@ // file : examples/Nef_2/point_location.C -#include + +#include #include #include #include @@ -51,7 +52,7 @@ void test() { int main() { - typedef CGAL::Gmpz RT; + typedef CGAL::Arithmetic_kernel::Integer RT; typedef CGAL::Filtered_extended_homogeneous EKernel; typedef CGAL::Homogeneous HOM; typedef CGAL::Bounded_kernel BKernel; From 577bd4cf7ff3dd57d5c9f4b317a5d9d4c50fd60e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 23 Mar 2013 08:15:08 +0100 Subject: [PATCH 19/31] use leda_ratioanal if available --- Polygon/test/Polygon/SimplicityTest.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Polygon/test/Polygon/SimplicityTest.cpp b/Polygon/test/Polygon/SimplicityTest.cpp index 28a8be947e0..eb3f32f26f0 100644 --- a/Polygon/test/Polygon/SimplicityTest.cpp +++ b/Polygon/test/Polygon/SimplicityTest.cpp @@ -1,14 +1,8 @@ #define CGAL_POLYGON_DEBUG 1 #include -#include -#ifdef CGAL_USE_GMP -#include -typedef CGAL::Quotient NT; -#else -#include -typedef CGAL::Quotient NT; -#endif +#include + #include #include @@ -23,6 +17,7 @@ using std::endl; bool TestSimplicity(const char* FileName) // tests the simplicity of the polygon in the file FileName { + typedef Arithmetic_kernel::Rational NT; typedef CGAL::Cartesian K; typedef CGAL::Point_2 Point; From 6be99fb05ef07a20e87f5cb132ba9cee1d3a46a2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 23 Mar 2013 09:06:16 +0100 Subject: [PATCH 20/31] As leda_rational only reads num/den from streams and as we want test data that are at the same time usable for a test with an Epic kernel, we read doubles from the stream. --- .../test/Skin_surface_3/degenerate_test_exact.cpp | 6 ++++-- Skin_surface_3/test/Skin_surface_3/subdivision_test.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Skin_surface_3/test/Skin_surface_3/degenerate_test_exact.cpp b/Skin_surface_3/test/Skin_surface_3/degenerate_test_exact.cpp index 281294e5db4..28ad202293e 100644 --- a/Skin_surface_3/test/Skin_surface_3/degenerate_test_exact.cpp +++ b/Skin_surface_3/test/Skin_surface_3/degenerate_test_exact.cpp @@ -1,4 +1,3 @@ -// examples/Skin_surface_3/skin_surface_simple.C #include #include #include @@ -31,7 +30,10 @@ public: std::ifstream in(filename.c_str()); CGAL_assertion(in.is_open()); Weighted_point wp; - while (in >> wp) l.push_front(wp); + double x, y, z, w; + while (in >> x >> y >> z >> w ) { + l.push_front(Weighted_point(Bare_point(x,y,z),w)); + } Skin_surface_3 skin_surface(l.begin(), l.end(), s); diff --git a/Skin_surface_3/test/Skin_surface_3/subdivision_test.cpp b/Skin_surface_3/test/Skin_surface_3/subdivision_test.cpp index 36a4c8283d5..dfcecac3a8b 100644 --- a/Skin_surface_3/test/Skin_surface_3/subdivision_test.cpp +++ b/Skin_surface_3/test/Skin_surface_3/subdivision_test.cpp @@ -1,4 +1,4 @@ -// test/Skin_surface_3/subdivision_test.C +// test/Skin_surface_3/subdivision_test.cpp #include #include #include From ae58f3896a747dce27075c3b21e897405e53284c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sun, 24 Mar 2013 17:48:33 +0100 Subject: [PATCH 21/31] also use leda if it is installed --- .../check_decomposition.cpp | 4 ++-- .../Convex_decomposition_3/edge_sorter.cpp | 4 ++-- .../Convex_decomposition_3/reflex_sedge.cpp | 5 +++-- .../quick_hull_default_traits.cpp | 16 ++++---------- .../quickhull_degenerate_test_3.cpp | 16 ++------------ .../test/Convex_hull_3/quickhull_test_3.cpp | 16 ++------------ .../test/Kernel_d/Linear_algebra-test.cpp | 15 ++++--------- Kernel_d/test/Kernel_d/afftrafo-test.cpp | 21 ++++--------------- .../gaussian_map_conversion.cpp | 4 ++-- Nef_2/test/Nef_2/nef_2_point_location.cpp | 2 +- .../Nef_3/test_with_extended_homogeneous.cpp | 10 ++------- Nef_3/test/Nef_3/test_with_homogeneous.cpp | 10 ++------- Nef_3/test/Nef_3/test_with_lazy.cpp | 4 ++-- .../include/CGAL/_test_cls_delaunay_3.h | 6 +++--- .../include/CGAL/_test_cls_tds_3.h | 2 +- .../include/CGAL/_test_cls_triangulation_3.h | 2 +- 16 files changed, 37 insertions(+), 100 deletions(-) diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/check_decomposition.cpp b/Convex_decomposition_3/test/Convex_decomposition_3/check_decomposition.cpp index 4e094c50b5e..a2a7c792d06 100644 --- a/Convex_decomposition_3/test/Convex_decomposition_3/check_decomposition.cpp +++ b/Convex_decomposition_3/test/Convex_decomposition_3/check_decomposition.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -8,7 +8,7 @@ #include #include -typedef CGAL::Gmpz RT; +typedef CGAL::Arithmetic_kernel::Integer RT; typedef CGAL::Homogeneous Kernel; typedef CGAL::Nef_polyhedron_3 Nef_polyhedron_3; //typedef CGAL::Nef_polyhedron_3 Nef_polyhedron_3; diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/edge_sorter.cpp b/Convex_decomposition_3/test/Convex_decomposition_3/edge_sorter.cpp index 9c8f8357875..38fb035b14b 100644 --- a/Convex_decomposition_3/test/Convex_decomposition_3/edge_sorter.cpp +++ b/Convex_decomposition_3/test/Convex_decomposition_3/edge_sorter.cpp @@ -1,8 +1,8 @@ -#include +#include #include #include -typedef CGAL::Gmpz RT; +typedef CGAL::Arithmetic_kernel::Integer RT; typedef CGAL::Homogeneous Kernel; typedef Kernel::Point_3 Point_3; typedef Kernel::FT FT; diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/reflex_sedge.cpp b/Convex_decomposition_3/test/Convex_decomposition_3/reflex_sedge.cpp index 762c87400ef..b631ae947c3 100644 --- a/Convex_decomposition_3/test/Convex_decomposition_3/reflex_sedge.cpp +++ b/Convex_decomposition_3/test/Convex_decomposition_3/reflex_sedge.cpp @@ -1,5 +1,5 @@ +#include #include -#include #include #include #include @@ -60,7 +60,8 @@ int main() // CGAL_NEF_SETDTHREAD(239); - typedef CGAL::Homogeneous Kernel; + typedef CGAL::Arithmetic_kernel::Integer RT; + typedef CGAL::Homogeneous Kernel; typedef Test_SNC SNC; typedef SNC::Point_3 Point_3; typedef SNC::Sphere_point Sphere_point; diff --git a/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp b/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp index 22fa1ba2cbe..e97b539a1b8 100644 --- a/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp +++ b/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -7,18 +8,9 @@ #include #include -#ifdef CGAL_USE_LEDA -# include -typedef leda_rational Precise_rational; -#elif defined CGAL_USE_GMP -# include -# include -typedef CGAL::Quotient Precise_rational; -#else -# include -# include -typedef CGAL::Quotient Precise_rational; -#endif + +typedef CGAL::Arithmetic_kernel::Rational Precise_rational; + typedef CGAL::Exact_predicates_exact_constructions_kernel EPEC; typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC; diff --git a/Convex_hull_3/test/Convex_hull_3/quickhull_degenerate_test_3.cpp b/Convex_hull_3/test/Convex_hull_3/quickhull_degenerate_test_3.cpp index 3dabc736824..86738076da7 100644 --- a/Convex_hull_3/test/Convex_hull_3/quickhull_degenerate_test_3.cpp +++ b/Convex_hull_3/test/Convex_hull_3/quickhull_degenerate_test_3.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -9,20 +9,8 @@ #include #include -#ifdef CGAL_USE_LEDA -# include -typedef leda_rational Precise_rational; -#elif defined CGAL_USE_GMP -# include -# include -typedef CGAL::Quotient Precise_rational; -#else -# include -# include -typedef CGAL::Quotient Precise_rational; -#endif - +typedef CGAL::Arithmetic_kernel::Rational Precise_rational; typedef CGAL::Cartesian< Precise_rational > R; typedef CGAL::Convex_hull_traits_3 Traits; typedef Traits::Polyhedron_3 Polyhedron_3; diff --git a/Convex_hull_3/test/Convex_hull_3/quickhull_test_3.cpp b/Convex_hull_3/test/Convex_hull_3/quickhull_test_3.cpp index 2ef447b9d55..99c7b1e775d 100644 --- a/Convex_hull_3/test/Convex_hull_3/quickhull_test_3.cpp +++ b/Convex_hull_3/test/Convex_hull_3/quickhull_test_3.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -6,21 +7,8 @@ #include #include #include -#ifdef CGAL_USE_LEDA -# include -typedef leda_rational Precise_rational; -#elif defined CGAL_USE_GMP -# include -# include -typedef CGAL::Quotient Precise_rational; -#else -# include -# include -typedef CGAL::Quotient Precise_rational; -#endif - -typedef Precise_rational NT; +typedef CGAL::Arithmetic_kernel::Rational NT; typedef CGAL::Cartesian K; typedef CGAL::Convex_hull_traits_3 Traits; typedef Traits::Polyhedron_3 Polyhedron_3; diff --git a/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp b/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp index 5e128e4e499..a449e1d76cd 100644 --- a/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp +++ b/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp @@ -8,19 +8,12 @@ #define VEC_DIM 10 #define MAT_DIM 10 -#ifdef CGAL_USE_LEDA +#include -#include -#include -typedef leda_integer RT; -typedef leda_rational FT; +#if defined( CGAL_USE_LEDA) || defined ( CGAL_USE_GMP ) -#elif defined CGAL_USE_GMP - -#include -#include -typedef CGAL::Gmpz RT; -typedef CGAL::Gmpq FT; +typedef CGAL::Arithmetic_kernel::Integer RT; +typedef CGAL::Arithmetic_kernel::Rational FT; #else diff --git a/Kernel_d/test/Kernel_d/afftrafo-test.cpp b/Kernel_d/test/Kernel_d/afftrafo-test.cpp index ee2eda23c69..12a19bcb543 100644 --- a/Kernel_d/test/Kernel_d/afftrafo-test.cpp +++ b/Kernel_d/test/Kernel_d/afftrafo-test.cpp @@ -9,25 +9,12 @@ #include #include #include +#include -#ifdef CGAL_USE_LEDA -#include -#include -typedef leda_integer RT_; + +typedef CGAL::Arithmetic_kernel::Integer RT_; +typedef CGAL::Arithmetic_kernel::Rational FT_; typedef leda_rational FT_; -#else -#ifdef CGAL_USE_GMP -#include -#include -typedef CGAL::Gmpz RT_; -typedef CGAL::Quotient FT_; -#else -#include -#include -typedef CGAL::MP_Float RT_; -typedef CGAL::Quotient FT_; -#endif -#endif int main() diff --git a/Minkowski_sum_3/test/Minkowski_sum_3/gaussian_map_conversion.cpp b/Minkowski_sum_3/test/Minkowski_sum_3/gaussian_map_conversion.cpp index 05754b5608a..be3bb78dba5 100644 --- a/Minkowski_sum_3/test/Minkowski_sum_3/gaussian_map_conversion.cpp +++ b/Minkowski_sum_3/test/Minkowski_sum_3/gaussian_map_conversion.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -11,7 +11,7 @@ #include #include -typedef CGAL::Gmpz RT; +typedef CGAL::Arithmetic_kernel::Integer RT; typedef CGAL::Homogeneous Kernel; typedef CGAL::Nef_polyhedron_3 Nef_polyhedron_3; typedef CGAL::Polyhedron_3 Polyhedron_3; diff --git a/Nef_2/test/Nef_2/nef_2_point_location.cpp b/Nef_2/test/Nef_2/nef_2_point_location.cpp index 2a79154d722..bc600bb9ef7 100644 --- a/Nef_2/test/Nef_2/nef_2_point_location.cpp +++ b/Nef_2/test/Nef_2/nef_2_point_location.cpp @@ -1,4 +1,4 @@ -// file : examples/Nef_2/point_location.C +// file : examples/Nef_2/point_location.cpp #include diff --git a/Nef_3/test/Nef_3/test_with_extended_homogeneous.cpp b/Nef_3/test/Nef_3/test_with_extended_homogeneous.cpp index 5b502fca5a3..6241d7d958c 100644 --- a/Nef_3/test/Nef_3/test_with_extended_homogeneous.cpp +++ b/Nef_3/test/Nef_3/test_with_extended_homogeneous.cpp @@ -26,19 +26,13 @@ #define CGAL_NEF3_SORT_OUTPUT 1 -#include -#ifdef CGAL_USE_LEDA -#include -typedef leda_integer NT; -#else -#include -typedef CGAL::Gmpz NT; -#endif +#include #include #include #include int main() { + typedef CGAL::Arithmetic_kernel::Integer NT; typedef CGAL::Extended_homogeneous EH_kernel; #ifdef CGAL_CFG_ISTREAM_INT_BUG diff --git a/Nef_3/test/Nef_3/test_with_homogeneous.cpp b/Nef_3/test/Nef_3/test_with_homogeneous.cpp index 25e102fb6ae..d457013c4e7 100644 --- a/Nef_3/test/Nef_3/test_with_homogeneous.cpp +++ b/Nef_3/test/Nef_3/test_with_homogeneous.cpp @@ -26,19 +26,13 @@ #define CGAL_NEF3_SORT_OUTPUT 1 -#include -#ifdef CGAL_USE_LEDA -#include -typedef leda_integer NT; -#else -#include -typedef CGAL::Gmpz NT; -#endif +#include #include #include #include int main() { + typedef CGAL::Arithmetic_kernel::Integer NT; typedef CGAL::Homogeneous H_kernel; #ifdef CGAL_CFG_ISTREAM_INT_BUG diff --git a/Nef_3/test/Nef_3/test_with_lazy.cpp b/Nef_3/test/Nef_3/test_with_lazy.cpp index 1c439a729c8..cfb2a7ac7b0 100644 --- a/Nef_3/test/Nef_3/test_with_lazy.cpp +++ b/Nef_3/test/Nef_3/test_with_lazy.cpp @@ -26,8 +26,8 @@ #define CGAL_NEF3_SORT_OUTPUT 1 -#include -typedef CGAL::Gmpq NT; +#include +typedef CGAL::Arithmetic_kernel::Rational NT; #include #include #include diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h index fe509f306a1..52d94fd8ec0 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h @@ -295,7 +295,7 @@ _test_cls_delaunay_3(const Triangulation &) std::cout << " I/O" << std::endl; { std::ofstream oFileT1("Test1_triangulation_IO_3",std::ios::out); - oFileT1 << T0; + oFileT1 << T0 << std::endl; } std::ifstream iFileT1("Test1_triangulation_IO_3",std::ios::in); iFileT1 >> Tfromfile; @@ -316,7 +316,7 @@ _test_cls_delaunay_3(const Triangulation &) std::cout << " I/O" << std::endl; { std::ofstream oFileT2("Test2_triangulation_IO_3",std::ios::out); - oFileT2 << T0; + oFileT2 << T0 << std::endl; } std::ifstream iFileT2("Test2_triangulation_IO_3",std::ios::in); iFileT2 >> Tfromfile; @@ -338,7 +338,7 @@ _test_cls_delaunay_3(const Triangulation &) std::cout << " I/O" << std::endl; { std::ofstream oFileT3("Test3_triangulation_IO_3",std::ios::out); - oFileT3 << T0; + oFileT3 << T0 << std::endl; } std::ifstream iFileT3("Test3_triangulation_IO_3",std::ios::in); iFileT3 >> Tfromfile; diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_tds_3.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_tds_3.h index 05ff2cb3700..c7ffd63bf9e 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_tds_3.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_tds_3.h @@ -85,7 +85,7 @@ _test_cls_tds_3( const Tds &) std::cout << " I/O" << std::endl; { std::ofstream oFileT("Test_tds_IO_3", std::ios::out); - oFileT << tds1; + oFileT << tds1 << std::endl; } std::ifstream iFileT("Test_tds_IO_3", std::ios::in); iFileT >> tdsfromfile; diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h index 2b7e089767a..0531fc5c48f 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h @@ -52,7 +52,7 @@ _test_cls_triangulation_3_input_output(const Triangulation & T, std::cout << " I/O" << std::endl; { std::ofstream oFile(filename, std::ios::out); - oFile << T; + oFile << T << std::endl; } std::ifstream iFile(filename, std::ios::in); Triangulation Tfromfile; From 56d0a8a7fbd60b5124ca1161e1a0510d0e1ac11a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 25 Mar 2013 08:36:32 +0100 Subject: [PATCH 22/31] prefix namespace --- Polygon/test/Polygon/SimplicityTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon/test/Polygon/SimplicityTest.cpp b/Polygon/test/Polygon/SimplicityTest.cpp index eb3f32f26f0..f85e7fa3a5f 100644 --- a/Polygon/test/Polygon/SimplicityTest.cpp +++ b/Polygon/test/Polygon/SimplicityTest.cpp @@ -17,7 +17,7 @@ using std::endl; bool TestSimplicity(const char* FileName) // tests the simplicity of the polygon in the file FileName { - typedef Arithmetic_kernel::Rational NT; + typedef CGAL::Arithmetic_kernel::Rational NT; typedef CGAL::Cartesian K; typedef CGAL::Point_2 Point; From 069d618eb6537c1f209c44957953a5eb8963e185 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 25 Mar 2013 08:38:40 +0100 Subject: [PATCH 23/31] remove a typedef --- Kernel_d/test/Kernel_d/afftrafo-test.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Kernel_d/test/Kernel_d/afftrafo-test.cpp b/Kernel_d/test/Kernel_d/afftrafo-test.cpp index 12a19bcb543..1a42cdc8824 100644 --- a/Kernel_d/test/Kernel_d/afftrafo-test.cpp +++ b/Kernel_d/test/Kernel_d/afftrafo-test.cpp @@ -1,9 +1,3 @@ -//--------------------------------------------------------------------- -// file generated by notangle from noweb/Kernel_d-tests.lw -// please debug or modify noweb file -// coding: M. Seel -//--------------------------------------------------------------------- - #include #include #include @@ -14,7 +8,6 @@ typedef CGAL::Arithmetic_kernel::Integer RT_; typedef CGAL::Arithmetic_kernel::Rational FT_; -typedef leda_rational FT_; int main() From b29fdaeddff34ec9bb22c03f85284df7960b1589 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 25 Mar 2013 09:37:16 +0100 Subject: [PATCH 24/31] don't use GMP if it is not installed --- Nef_3/include/CGAL/OFF_to_nef_3.h | 20 +++--- .../Nef_3/Nef_3_problematic_construction.cpp | 61 ++++++------------- 2 files changed, 29 insertions(+), 52 deletions(-) diff --git a/Nef_3/include/CGAL/OFF_to_nef_3.h b/Nef_3/include/CGAL/OFF_to_nef_3.h index f2d562ed0e4..62509d80f47 100644 --- a/Nef_3/include/CGAL/OFF_to_nef_3.h +++ b/Nef_3/include/CGAL/OFF_to_nef_3.h @@ -23,26 +23,26 @@ #include + + // --- begin preliminary number type converter ----------------- #ifndef CGAL_NUMBER_TYPE_CONVERTER_NEF_3_H #define CGAL_NUMBER_TYPE_CONVERTER_NEF_3_H #include -#include -#include +#include #include #include #include #include -#ifdef CGAL_USE_LEDA -#include -#include -#endif // CGAL_USE_LEDA - namespace CGAL { + +typedef CGAL::Arithmetic_kernel::Integer Integer; +typedef CGAL::Arithmetic_kernel::Rational Rational; + class Homogeneous_tag; class Cartesian_tag; template class number_type_converter_nef_3; @@ -56,10 +56,10 @@ class number_type_converter_nef_3 { typedef typename Kernel::Point_3 Point_3; typedef typename Kernel::RT RT; - CGAL::Gmpq x(d.x()), y(d.y()), z(d.z()); + Rational x(d.x()), y(d.y()), z(d.z()); - CGAL::Homogeneous::Point_3 b = - normalized ( CGAL::Homogeneous::Point_3 ( + CGAL::Homogeneous::Point_3 b = + normalized ( CGAL::Homogeneous::Point_3 ( x.numerator() * y.denominator() * z.denominator(), x.denominator() * y.numerator() * z.denominator(), x.denominator() * y.denominator() * z.numerator(), diff --git a/Nef_3/test/Nef_3/Nef_3_problematic_construction.cpp b/Nef_3/test/Nef_3/Nef_3_problematic_construction.cpp index 0aa9ba3ecad..1b88a1ac2d9 100644 --- a/Nef_3/test/Nef_3/Nef_3_problematic_construction.cpp +++ b/Nef_3/test/Nef_3/Nef_3_problematic_construction.cpp @@ -28,23 +28,9 @@ #define CGAL_NEF3_SORT_OUTPUT 1 -#include -#include -#include +#include #include #include -typedef CGAL::Gmpz NT; -typedef CGAL::Gmpq FNT; -typedef CGAL::Quotient FNT2; - -#ifdef CGAL_USE_LEDA -#include -#include -typedef leda_integer LNT; -typedef leda_rational LFNT; -typedef CGAL::Quotient LFNT2; -#endif - #include #include #include @@ -52,6 +38,11 @@ typedef CGAL::Quotient LFNT2; #include #include + +typedef CGAL::Arithmetic_kernel::Integer NT; +typedef CGAL::Arithmetic_kernel::Rational FNT; + + template class test { @@ -135,36 +126,22 @@ int main() { CGAL::Timer t; t.start(); -#ifndef CGAL_USE_LEDA - { typedef CGAL::Homogeneous H_kernel; - typedef CGAL::Cartesian C_kernel; - // typedef CGAL::Cartesian Q_kernel; +#if defined( CGAL_USE_LEDA ) || defined ( CGAL_USE_GMP ) + typedef CGAL::Homogeneous H_kernel; + typedef CGAL::Cartesian C_kernel; + + test test_H; + test test_C; - test test_H; - test test_C; - // test test_Q; - - test_H.run_test(true,".H"); - test_C.run_test(false,".C"); - // test_Q.run_test(); - } - -#else - { typedef CGAL::Homogeneous LH_kernel; - typedef CGAL::Cartesian LC_kernel; - // typedef CGAL::Cartesian LQ_kernel; - - test test_LH; - test test_LC; - // test test_LQ; - - test_LH.run_test(true,".H"); - test_LC.run_test(false,".LC"); - // test_LQ.run_test(); - } + test_H.run_test(true,".H"); +# ifdef CGAL_USE_GMP + test_C.run_test(false,".C"); +# else + test_C.run_test(false,".LC"); +# endif #endif - t.stop(); std::cout << "Time " << t.time() << std::endl; + return 0; } From 11e1a6d48110c88dd0382fc7da30a1e08dec9ba9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 25 Mar 2013 10:48:20 +0100 Subject: [PATCH 25/31] only compile if GMP is installed --- Number_types/test/Number_types/Gmpz.cpp | 3 +-- Number_types/test/Number_types/Gmpzf_new.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Number_types/test/Number_types/Gmpz.cpp b/Number_types/test/Number_types/Gmpz.cpp index b1ea7405ce1..845eb26d780 100644 --- a/Number_types/test/Number_types/Gmpz.cpp +++ b/Number_types/test/Number_types/Gmpz.cpp @@ -1,6 +1,5 @@ - -#include +#include #ifdef CGAL_USE_GMP diff --git a/Number_types/test/Number_types/Gmpzf_new.cpp b/Number_types/test/Number_types/Gmpzf_new.cpp index a99c54ab2fd..02736e39bcc 100644 --- a/Number_types/test/Number_types/Gmpzf_new.cpp +++ b/Number_types/test/Number_types/Gmpzf_new.cpp @@ -1,3 +1,8 @@ + +#include + +#ifdef CGAL_USE_GMP + #include #include #include @@ -31,3 +36,10 @@ int main() { } return 0; } + +#else + +int main() +{ + return 0; +} From b5e5e14abae725d5a9627b9b6ee16bfd91e0822f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 26 Mar 2013 11:31:56 +0100 Subject: [PATCH 26/31] Use Decompose instead of numerator()/denominator() --- Nef_3/include/CGAL/OFF_to_nef_3.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Nef_3/include/CGAL/OFF_to_nef_3.h b/Nef_3/include/CGAL/OFF_to_nef_3.h index 62509d80f47..37e8340d8e3 100644 --- a/Nef_3/include/CGAL/OFF_to_nef_3.h +++ b/Nef_3/include/CGAL/OFF_to_nef_3.h @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -55,15 +56,21 @@ class number_type_converter_nef_3 { { typedef typename Kernel::Point_3 Point_3; typedef typename Kernel::RT RT; - + + typedef Fraction_traits F_traits; + Rational x(d.x()), y(d.y()), z(d.z()); - + Integer xn, xd, yn, yd, zn, zd; + typename F_traits::Decompose decompose; + decompose(x, xn, xd); + decompose(y, yn, yd); + decompose(z, zn, zd); CGAL::Homogeneous::Point_3 b = normalized ( CGAL::Homogeneous::Point_3 ( - x.numerator() * y.denominator() * z.denominator(), - x.denominator() * y.numerator() * z.denominator(), - x.denominator() * y.denominator() * z.numerator(), - x.denominator() * y.denominator() * z.denominator() ) ); + xn * yd * zd, + xd * yn * zd, + xd * yd * zn, + xd * yd * zd ) ); std::ostringstream outx, outy, outz, outw; outx << b.hx(); From 0756c808ff0dd0cdd54f985b9c4306ff29a5c0a7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 29 Mar 2013 14:02:11 +0100 Subject: [PATCH 27/31] Add missing #endif --- Number_types/test/Number_types/Gmpzf_new.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Number_types/test/Number_types/Gmpzf_new.cpp b/Number_types/test/Number_types/Gmpzf_new.cpp index 02736e39bcc..bb650b25d88 100644 --- a/Number_types/test/Number_types/Gmpzf_new.cpp +++ b/Number_types/test/Number_types/Gmpzf_new.cpp @@ -43,3 +43,5 @@ int main() { return 0; } + +#endif From a25077bf90e3ac367e616af82b1d762d35d9317a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 29 Mar 2013 14:54:11 +0100 Subject: [PATCH 28/31] Add Leda --- .../Triangulation_benchmark_3.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp b/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp index 7ca9ebbbf7a..fb82d8b1c6d 100644 --- a/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp +++ b/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp @@ -62,13 +62,23 @@ using namespace CGAL; // - or EPIC (the default) #ifdef SC_DOUBLE typedef Simple_cartesian K; +#elif C_LEDA +#include +#include +typedef Cartesian K; #elif defined(ONLY_STATIC_FILTERS) typedef CGAL::internal::Static_filters > K; #elif defined(EPEC) # ifdef CGAL_DONT_USE_LAZY_KERNEL typedef Epeck K; # else +#ifdef CGAL_USE_LEDA +#include +#include +typedef Cartesian SK; +#else typedef Simple_cartesian SK; +#endif typedef Lazy_kernel K; # endif #else // EPIC @@ -104,9 +114,11 @@ Point rnd_point() void generate_points() { if (input_file_selected) { - Point p; - while (input_file >> p) - pts.push_back(p); + Point p; + while (input_file >> p){ + + pts.push_back(p); + } cout << " [ Read " << pts.size() << " points from file ] " << endl; min_pts = max_pts = pts.size(); } From 8eb51bee7ab9ecea693a386ed1cbfa2ff063f00f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 16 Apr 2013 16:08:33 +0200 Subject: [PATCH 29/31] Reformat the long list of #ifdef/#else And display the typeid of the kernel, for checking. --- .../Triangulation_benchmark_3.cpp | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp b/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp index fb82d8b1c6d..32738a4fec1 100644 --- a/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp +++ b/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp @@ -61,29 +61,29 @@ using namespace CGAL; // - EPEC, // - or EPIC (the default) #ifdef SC_DOUBLE -typedef Simple_cartesian K; + typedef Simple_cartesian K; #elif C_LEDA -#include -#include -typedef Cartesian K; +# include +# include + typedef Cartesian K; #elif defined(ONLY_STATIC_FILTERS) -typedef CGAL::internal::Static_filters > K; + typedef CGAL::internal::Static_filters > K; #elif defined(EPEC) # ifdef CGAL_DONT_USE_LAZY_KERNEL -typedef Epeck K; -# else -#ifdef CGAL_USE_LEDA -#include -#include -typedef Cartesian SK; -#else -typedef Simple_cartesian SK; -#endif -typedef Lazy_kernel K; -# endif + typedef Epeck K; +# else // not CGAL_DONT_USE_LAZY_KERNEL +# ifdef CGAL_USE_LEDA +# include +# include + typedef Cartesian SK; +# else // not CGAL_USE_LEDA + typedef Simple_cartesian SK; +# endif // not CGAL_USE_LEDA + typedef Lazy_kernel K; +# endif // not CGAL_DONT_USE_LAZY_KERNEL #else // EPIC -typedef Exact_predicates_inexact_constructions_kernel K; -#endif + typedef Exact_predicates_inexact_constructions_kernel K; +#endif // EPIC typedef Regular_triangulation_euclidean_traits_3 WK; typedef K::Point_3 Point; @@ -252,7 +252,7 @@ int main(int argc, char **argv) cout << "\nProcessor : " << ((sizeof(void*)==4) ? 32 : (sizeof(void*)==8) ? 64 : -1) << " bits\n"; - // cout << "Kernel : EPICK\n"; + cout << "Kernel typeid: " << typeid(K).name() << "\n"; do_benchmarks >("Delaunay [Compact_location]"); if (input_file_selected) From 76da6cf570ceaf7731bf7ea34454943a45e7a16c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 24 Apr 2013 12:57:57 +0200 Subject: [PATCH 30/31] Add missing #include That fixes the compilation when no header is included. --- .../include/CGAL/predicates/Regular_triangulation_ftC3.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Triangulation_3/include/CGAL/predicates/Regular_triangulation_ftC3.h b/Triangulation_3/include/CGAL/predicates/Regular_triangulation_ftC3.h index b9f726d795d..45da290d28c 100644 --- a/Triangulation_3/include/CGAL/predicates/Regular_triangulation_ftC3.h +++ b/Triangulation_3/include/CGAL/predicates/Regular_triangulation_ftC3.h @@ -21,6 +21,9 @@ #ifndef CGAL_REGULAR_TRIANGULATION_FTC3_H #define CGAL_REGULAR_TRIANGULATION_FTC3_H +#include +#include + // This file contains the low level cartesian predicates // used by the 3D regular triangulation. From bf39cc5e7c23b08ee7221f570f1d61e20d0af7b2 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 25 Apr 2013 11:01:45 +0200 Subject: [PATCH 31/31] Add new names for leda libraries in FindLEDA.cmake Under Windows, the libraries can be named leda_md and leda_mdd (debug). --- Installation/cmake/modules/FindLEDA.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Installation/cmake/modules/FindLEDA.cmake b/Installation/cmake/modules/FindLEDA.cmake index f65cbe38ad0..762ae5d5385 100644 --- a/Installation/cmake/modules/FindLEDA.cmake +++ b/Installation/cmake/modules/FindLEDA.cmake @@ -12,14 +12,14 @@ else() DOC "The directory containing the LEDA header files WITHOUT the LEDA prefix" ) - find_library(LEDA_LIBRARY_RELEASE NAMES "leda" + find_library(LEDA_LIBRARY_RELEASE NAMES "leda_md" "leda" HINTS ENV LEDA_LIB_DIR ENV LEDA_DIR # PATH_SUFFIXES lib DOC "Path to the LEDA library" ) - find_library(LEDA_LIBRARY_DEBUG NAMES "ledaD" + find_library(LEDA_LIBRARY_DEBUG NAMES "leda_mdd" "ledaD" HINTS ENV LEDA_LIB_DIR ENV LEDA_DIR # PATH_SUFFIXES lib