From c56c5b02419ea8e578cb89f0dee9abe30fe83e26 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Tue, 13 Sep 2016 14:31:58 +0200 Subject: [PATCH 1/6] Derive all NumTraits specializations from GenericNumTraits. --- Number_types/include/CGAL/CORE_BigFloat.h | 2 ++ Number_types/include/CGAL/CORE_BigInt.h | 2 ++ Number_types/include/CGAL/CORE_BigRat.h | 2 ++ Number_types/include/CGAL/CORE_Expr.h | 2 ++ Number_types/include/CGAL/Gmpfi.h | 2 ++ Number_types/include/CGAL/Gmpfr.h | 2 ++ Number_types/include/CGAL/Gmpq.h | 2 ++ Number_types/include/CGAL/Gmpz.h | 2 ++ Number_types/include/CGAL/Interval_nt.h | 2 ++ Number_types/include/CGAL/Lazy_exact_nt.h | 2 ++ Number_types/include/CGAL/MP_Float.h | 2 ++ Number_types/include/CGAL/Mpzf.h | 2 ++ Number_types/include/CGAL/Quotient.h | 2 ++ Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h | 2 ++ 14 files changed, 28 insertions(+) diff --git a/Number_types/include/CGAL/CORE_BigFloat.h b/Number_types/include/CGAL/CORE_BigFloat.h index 2488af7d00d..59530c4faea 100644 --- a/Number_types/include/CGAL/CORE_BigFloat.h +++ b/Number_types/include/CGAL/CORE_BigFloat.h @@ -526,7 +526,9 @@ template <> class Real_embeddable_traits< CORE::BigFloat > namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template<> struct NumTraits + : GenericNumTraits { typedef CORE::BigFloat Real; typedef CORE::BigFloat NonInteger; diff --git a/Number_types/include/CGAL/CORE_BigInt.h b/Number_types/include/CGAL/CORE_BigInt.h index 288ebedbd0b..f3ce522670d 100644 --- a/Number_types/include/CGAL/CORE_BigInt.h +++ b/Number_types/include/CGAL/CORE_BigInt.h @@ -202,7 +202,9 @@ public: namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template<> struct NumTraits + : GenericNumTraits { typedef CORE::BigInt Real; typedef CORE::BigRat NonInteger; diff --git a/Number_types/include/CGAL/CORE_BigRat.h b/Number_types/include/CGAL/CORE_BigRat.h index 0be849bec7e..1895faa3681 100644 --- a/Number_types/include/CGAL/CORE_BigRat.h +++ b/Number_types/include/CGAL/CORE_BigRat.h @@ -236,7 +236,9 @@ public: namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template<> struct NumTraits + : GenericNumTraits { typedef CORE::BigRat Real; typedef CORE::BigRat NonInteger; diff --git a/Number_types/include/CGAL/CORE_Expr.h b/Number_types/include/CGAL/CORE_Expr.h index 579a2090e5a..976393dfaa6 100644 --- a/Number_types/include/CGAL/CORE_Expr.h +++ b/Number_types/include/CGAL/CORE_Expr.h @@ -191,7 +191,9 @@ template <> class Real_embeddable_traits< CORE::Expr > namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template<> struct NumTraits + : GenericNumTraits { typedef CORE::Expr Real; typedef CORE::Expr NonInteger; diff --git a/Number_types/include/CGAL/Gmpfi.h b/Number_types/include/CGAL/Gmpfi.h index 97bb80d8647..073bbf89633 100644 --- a/Number_types/include/CGAL/Gmpfi.h +++ b/Number_types/include/CGAL/Gmpfi.h @@ -337,7 +337,9 @@ public: namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template<> struct NumTraits + : GenericNumTraits { typedef CGAL::Gmpfi Real; typedef CGAL::Gmpfi NonInteger; diff --git a/Number_types/include/CGAL/Gmpfr.h b/Number_types/include/CGAL/Gmpfr.h index 5179425ff19..4607f8e5cbf 100644 --- a/Number_types/include/CGAL/Gmpfr.h +++ b/Number_types/include/CGAL/Gmpfr.h @@ -157,7 +157,9 @@ public INTERN_RET::Real_embeddable_traits_base{ namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template<> struct NumTraits + : GenericNumTraits { typedef CGAL::Gmpfr Real; typedef CGAL::Gmpfr NonInteger; diff --git a/Number_types/include/CGAL/Gmpq.h b/Number_types/include/CGAL/Gmpq.h index 38fd09242c4..08f0fc4db4b 100644 --- a/Number_types/include/CGAL/Gmpq.h +++ b/Number_types/include/CGAL/Gmpq.h @@ -136,7 +136,9 @@ public: namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template<> struct NumTraits + : GenericNumTraits { typedef CGAL::Gmpq Real; typedef CGAL::Gmpq NonInteger; diff --git a/Number_types/include/CGAL/Gmpz.h b/Number_types/include/CGAL/Gmpz.h index b196789c267..69600c43a54 100644 --- a/Number_types/include/CGAL/Gmpz.h +++ b/Number_types/include/CGAL/Gmpz.h @@ -210,7 +210,9 @@ class Modular_traits< Gmpz > { namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template<> struct NumTraits + : GenericNumTraits { typedef CGAL::Gmpz Real; typedef CGAL::Gmpq NonInteger; diff --git a/Number_types/include/CGAL/Interval_nt.h b/Number_types/include/CGAL/Interval_nt.h index e725e74621e..6fa983d6c7a 100644 --- a/Number_types/include/CGAL/Interval_nt.h +++ b/Number_types/include/CGAL/Interval_nt.h @@ -1263,7 +1263,9 @@ public: namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template struct NumTraits > + : GenericNumTraits > { typedef CGAL::Interval_nt Real; typedef CGAL::Interval_nt NonInteger; diff --git a/Number_types/include/CGAL/Lazy_exact_nt.h b/Number_types/include/CGAL/Lazy_exact_nt.h index 4c0678a7976..1d76ce403bc 100644 --- a/Number_types/include/CGAL/Lazy_exact_nt.h +++ b/Number_types/include/CGAL/Lazy_exact_nt.h @@ -1422,7 +1422,9 @@ class Modular_traits > namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template struct NumTraits > + : GenericNumTraits > { typedef CGAL::Lazy_exact_nt Real; // typedef CGAL::Lazy_exact_nt NonInteger; diff --git a/Number_types/include/CGAL/MP_Float.h b/Number_types/include/CGAL/MP_Float.h index 0e1312be337..3103c45944a 100644 --- a/Number_types/include/CGAL/MP_Float.h +++ b/Number_types/include/CGAL/MP_Float.h @@ -883,7 +883,9 @@ CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int, MP_Float) namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template<> struct NumTraits + : GenericNumTraits { typedef CGAL::MP_Float Real; typedef CGAL::Quotient NonInteger; diff --git a/Number_types/include/CGAL/Mpzf.h b/Number_types/include/CGAL/Mpzf.h index 55ceb4ecb61..80f35024936 100644 --- a/Number_types/include/CGAL/Mpzf.h +++ b/Number_types/include/CGAL/Mpzf.h @@ -1129,7 +1129,9 @@ CGAL_DEFINE_COERCION_TRAITS_FROM_TO(mpz_class,Mpzf) */ namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template<> struct NumTraits + : GenericNumTraits { typedef CGAL::Mpzf Real; /* Should this be Quotient? Gmpq? */ diff --git a/Number_types/include/CGAL/Quotient.h b/Number_types/include/CGAL/Quotient.h index a1934fc12ee..548ceb180d0 100644 --- a/Number_types/include/CGAL/Quotient.h +++ b/Number_types/include/CGAL/Quotient.h @@ -854,7 +854,9 @@ public: namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template struct NumTraits > + : GenericNumTraits > { typedef CGAL::Quotient Real; typedef CGAL::Quotient NonInteger; diff --git a/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h b/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h index c9d28d8a993..0f4a524dca2 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h @@ -24,8 +24,10 @@ namespace Eigen { template struct NumTraits; + template struct GenericNumTraits; template struct NumTraits > + : GenericNumTraits > { typedef CGAL::Sqrt_extension Real; typedef Real NonInteger; From ddb5bf91e80922ba9c24e1328e3fc02c2d62bbfe Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Tue, 13 Sep 2016 14:38:47 +0200 Subject: [PATCH 2/6] Optimize NumTraits::Literal for intervals. --- Number_types/include/CGAL/Interval_nt.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Number_types/include/CGAL/Interval_nt.h b/Number_types/include/CGAL/Interval_nt.h index 6fa983d6c7a..eb80c7b0c6f 100644 --- a/Number_types/include/CGAL/Interval_nt.h +++ b/Number_types/include/CGAL/Interval_nt.h @@ -1270,6 +1270,7 @@ namespace Eigen { typedef CGAL::Interval_nt Real; typedef CGAL::Interval_nt NonInteger; typedef CGAL::Interval_nt Nested; + typedef double Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } From c86749ba016f42a9b861e846b154d08a73c17986 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Wed, 14 Sep 2016 13:04:05 +0200 Subject: [PATCH 3/6] Revert "Derive all NumTraits specializations from GenericNumTraits." This reverts commit c56c5b02419ea8e578cb89f0dee9abe30fe83e26. --- Number_types/include/CGAL/CORE_BigFloat.h | 2 -- Number_types/include/CGAL/CORE_BigInt.h | 2 -- Number_types/include/CGAL/CORE_BigRat.h | 2 -- Number_types/include/CGAL/CORE_Expr.h | 2 -- Number_types/include/CGAL/Gmpfi.h | 2 -- Number_types/include/CGAL/Gmpfr.h | 2 -- Number_types/include/CGAL/Gmpq.h | 2 -- Number_types/include/CGAL/Gmpz.h | 2 -- Number_types/include/CGAL/Interval_nt.h | 2 -- Number_types/include/CGAL/Lazy_exact_nt.h | 2 -- Number_types/include/CGAL/MP_Float.h | 2 -- Number_types/include/CGAL/Mpzf.h | 2 -- Number_types/include/CGAL/Quotient.h | 2 -- Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h | 2 -- 14 files changed, 28 deletions(-) diff --git a/Number_types/include/CGAL/CORE_BigFloat.h b/Number_types/include/CGAL/CORE_BigFloat.h index 59530c4faea..2488af7d00d 100644 --- a/Number_types/include/CGAL/CORE_BigFloat.h +++ b/Number_types/include/CGAL/CORE_BigFloat.h @@ -526,9 +526,7 @@ template <> class Real_embeddable_traits< CORE::BigFloat > namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template<> struct NumTraits - : GenericNumTraits { typedef CORE::BigFloat Real; typedef CORE::BigFloat NonInteger; diff --git a/Number_types/include/CGAL/CORE_BigInt.h b/Number_types/include/CGAL/CORE_BigInt.h index f3ce522670d..288ebedbd0b 100644 --- a/Number_types/include/CGAL/CORE_BigInt.h +++ b/Number_types/include/CGAL/CORE_BigInt.h @@ -202,9 +202,7 @@ public: namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template<> struct NumTraits - : GenericNumTraits { typedef CORE::BigInt Real; typedef CORE::BigRat NonInteger; diff --git a/Number_types/include/CGAL/CORE_BigRat.h b/Number_types/include/CGAL/CORE_BigRat.h index 1895faa3681..0be849bec7e 100644 --- a/Number_types/include/CGAL/CORE_BigRat.h +++ b/Number_types/include/CGAL/CORE_BigRat.h @@ -236,9 +236,7 @@ public: namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template<> struct NumTraits - : GenericNumTraits { typedef CORE::BigRat Real; typedef CORE::BigRat NonInteger; diff --git a/Number_types/include/CGAL/CORE_Expr.h b/Number_types/include/CGAL/CORE_Expr.h index 976393dfaa6..579a2090e5a 100644 --- a/Number_types/include/CGAL/CORE_Expr.h +++ b/Number_types/include/CGAL/CORE_Expr.h @@ -191,9 +191,7 @@ template <> class Real_embeddable_traits< CORE::Expr > namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template<> struct NumTraits - : GenericNumTraits { typedef CORE::Expr Real; typedef CORE::Expr NonInteger; diff --git a/Number_types/include/CGAL/Gmpfi.h b/Number_types/include/CGAL/Gmpfi.h index 073bbf89633..97bb80d8647 100644 --- a/Number_types/include/CGAL/Gmpfi.h +++ b/Number_types/include/CGAL/Gmpfi.h @@ -337,9 +337,7 @@ public: namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template<> struct NumTraits - : GenericNumTraits { typedef CGAL::Gmpfi Real; typedef CGAL::Gmpfi NonInteger; diff --git a/Number_types/include/CGAL/Gmpfr.h b/Number_types/include/CGAL/Gmpfr.h index 4607f8e5cbf..5179425ff19 100644 --- a/Number_types/include/CGAL/Gmpfr.h +++ b/Number_types/include/CGAL/Gmpfr.h @@ -157,9 +157,7 @@ public INTERN_RET::Real_embeddable_traits_base{ namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template<> struct NumTraits - : GenericNumTraits { typedef CGAL::Gmpfr Real; typedef CGAL::Gmpfr NonInteger; diff --git a/Number_types/include/CGAL/Gmpq.h b/Number_types/include/CGAL/Gmpq.h index 08f0fc4db4b..38fd09242c4 100644 --- a/Number_types/include/CGAL/Gmpq.h +++ b/Number_types/include/CGAL/Gmpq.h @@ -136,9 +136,7 @@ public: namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template<> struct NumTraits - : GenericNumTraits { typedef CGAL::Gmpq Real; typedef CGAL::Gmpq NonInteger; diff --git a/Number_types/include/CGAL/Gmpz.h b/Number_types/include/CGAL/Gmpz.h index 69600c43a54..b196789c267 100644 --- a/Number_types/include/CGAL/Gmpz.h +++ b/Number_types/include/CGAL/Gmpz.h @@ -210,9 +210,7 @@ class Modular_traits< Gmpz > { namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template<> struct NumTraits - : GenericNumTraits { typedef CGAL::Gmpz Real; typedef CGAL::Gmpq NonInteger; diff --git a/Number_types/include/CGAL/Interval_nt.h b/Number_types/include/CGAL/Interval_nt.h index eb80c7b0c6f..5dfa8b33bc4 100644 --- a/Number_types/include/CGAL/Interval_nt.h +++ b/Number_types/include/CGAL/Interval_nt.h @@ -1263,9 +1263,7 @@ public: namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template struct NumTraits > - : GenericNumTraits > { typedef CGAL::Interval_nt Real; typedef CGAL::Interval_nt NonInteger; diff --git a/Number_types/include/CGAL/Lazy_exact_nt.h b/Number_types/include/CGAL/Lazy_exact_nt.h index 1d76ce403bc..4c0678a7976 100644 --- a/Number_types/include/CGAL/Lazy_exact_nt.h +++ b/Number_types/include/CGAL/Lazy_exact_nt.h @@ -1422,9 +1422,7 @@ class Modular_traits > namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template struct NumTraits > - : GenericNumTraits > { typedef CGAL::Lazy_exact_nt Real; // typedef CGAL::Lazy_exact_nt NonInteger; diff --git a/Number_types/include/CGAL/MP_Float.h b/Number_types/include/CGAL/MP_Float.h index 3103c45944a..0e1312be337 100644 --- a/Number_types/include/CGAL/MP_Float.h +++ b/Number_types/include/CGAL/MP_Float.h @@ -883,9 +883,7 @@ CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int, MP_Float) namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template<> struct NumTraits - : GenericNumTraits { typedef CGAL::MP_Float Real; typedef CGAL::Quotient NonInteger; diff --git a/Number_types/include/CGAL/Mpzf.h b/Number_types/include/CGAL/Mpzf.h index 80f35024936..55ceb4ecb61 100644 --- a/Number_types/include/CGAL/Mpzf.h +++ b/Number_types/include/CGAL/Mpzf.h @@ -1129,9 +1129,7 @@ CGAL_DEFINE_COERCION_TRAITS_FROM_TO(mpz_class,Mpzf) */ namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template<> struct NumTraits - : GenericNumTraits { typedef CGAL::Mpzf Real; /* Should this be Quotient? Gmpq? */ diff --git a/Number_types/include/CGAL/Quotient.h b/Number_types/include/CGAL/Quotient.h index 548ceb180d0..a1934fc12ee 100644 --- a/Number_types/include/CGAL/Quotient.h +++ b/Number_types/include/CGAL/Quotient.h @@ -854,9 +854,7 @@ public: namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template struct NumTraits > - : GenericNumTraits > { typedef CGAL::Quotient Real; typedef CGAL::Quotient NonInteger; diff --git a/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h b/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h index 0f4a524dca2..c9d28d8a993 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h @@ -24,10 +24,8 @@ namespace Eigen { template struct NumTraits; - template struct GenericNumTraits; template struct NumTraits > - : GenericNumTraits > { typedef CGAL::Sqrt_extension Real; typedef Real NonInteger; From b7b492d9c85a1139c95c00464ba2d29b59e781df Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Wed, 14 Sep 2016 13:12:35 +0200 Subject: [PATCH 4/6] Manually define Eigen::NumTraits::Literal for each specialization. Defined to NT, no try is made to optimize for now. --- Number_types/include/CGAL/CORE_BigFloat.h | 1 + Number_types/include/CGAL/CORE_BigInt.h | 1 + Number_types/include/CGAL/CORE_BigRat.h | 1 + Number_types/include/CGAL/CORE_Expr.h | 1 + Number_types/include/CGAL/Gmpfi.h | 1 + Number_types/include/CGAL/Gmpfr.h | 1 + Number_types/include/CGAL/Gmpq.h | 1 + Number_types/include/CGAL/Gmpz.h | 1 + Number_types/include/CGAL/Lazy_exact_nt.h | 1 + Number_types/include/CGAL/MP_Float.h | 1 + Number_types/include/CGAL/Mpzf.h | 1 + Number_types/include/CGAL/Quotient.h | 1 + Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h | 1 + 13 files changed, 13 insertions(+) diff --git a/Number_types/include/CGAL/CORE_BigFloat.h b/Number_types/include/CGAL/CORE_BigFloat.h index 2488af7d00d..09302bcdfa3 100644 --- a/Number_types/include/CGAL/CORE_BigFloat.h +++ b/Number_types/include/CGAL/CORE_BigFloat.h @@ -531,6 +531,7 @@ namespace Eigen { typedef CORE::BigFloat Real; typedef CORE::BigFloat NonInteger; typedef CORE::BigFloat Nested; + typedef CORE::BigFloat Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } diff --git a/Number_types/include/CGAL/CORE_BigInt.h b/Number_types/include/CGAL/CORE_BigInt.h index 288ebedbd0b..a3c18b16101 100644 --- a/Number_types/include/CGAL/CORE_BigInt.h +++ b/Number_types/include/CGAL/CORE_BigInt.h @@ -207,6 +207,7 @@ namespace Eigen { typedef CORE::BigInt Real; typedef CORE::BigRat NonInteger; typedef CORE::BigInt Nested; + typedef CORE::BigInt Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } diff --git a/Number_types/include/CGAL/CORE_BigRat.h b/Number_types/include/CGAL/CORE_BigRat.h index 0be849bec7e..6ab81031299 100644 --- a/Number_types/include/CGAL/CORE_BigRat.h +++ b/Number_types/include/CGAL/CORE_BigRat.h @@ -241,6 +241,7 @@ namespace Eigen { typedef CORE::BigRat Real; typedef CORE::BigRat NonInteger; typedef CORE::BigRat Nested; + typedef CORE::BigRat Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } diff --git a/Number_types/include/CGAL/CORE_Expr.h b/Number_types/include/CGAL/CORE_Expr.h index 579a2090e5a..4bd38945006 100644 --- a/Number_types/include/CGAL/CORE_Expr.h +++ b/Number_types/include/CGAL/CORE_Expr.h @@ -196,6 +196,7 @@ namespace Eigen { typedef CORE::Expr Real; typedef CORE::Expr NonInteger; typedef CORE::Expr Nested; + typedef CORE::Expr Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } diff --git a/Number_types/include/CGAL/Gmpfi.h b/Number_types/include/CGAL/Gmpfi.h index 97bb80d8647..479f1608a4b 100644 --- a/Number_types/include/CGAL/Gmpfi.h +++ b/Number_types/include/CGAL/Gmpfi.h @@ -342,6 +342,7 @@ namespace Eigen { typedef CGAL::Gmpfi Real; typedef CGAL::Gmpfi NonInteger; typedef CGAL::Gmpfi Nested; + typedef CGAL::Gmpfi Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } diff --git a/Number_types/include/CGAL/Gmpfr.h b/Number_types/include/CGAL/Gmpfr.h index 5179425ff19..94bb613b61e 100644 --- a/Number_types/include/CGAL/Gmpfr.h +++ b/Number_types/include/CGAL/Gmpfr.h @@ -162,6 +162,7 @@ namespace Eigen { typedef CGAL::Gmpfr Real; typedef CGAL::Gmpfr NonInteger; typedef CGAL::Gmpfr Nested; + typedef CGAL::Gmpfr Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } diff --git a/Number_types/include/CGAL/Gmpq.h b/Number_types/include/CGAL/Gmpq.h index 38fd09242c4..2fde983a7b3 100644 --- a/Number_types/include/CGAL/Gmpq.h +++ b/Number_types/include/CGAL/Gmpq.h @@ -141,6 +141,7 @@ namespace Eigen { typedef CGAL::Gmpq Real; typedef CGAL::Gmpq NonInteger; typedef CGAL::Gmpq Nested; + typedef CGAL::Gmpq Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } diff --git a/Number_types/include/CGAL/Gmpz.h b/Number_types/include/CGAL/Gmpz.h index b196789c267..5a1b15dbb35 100644 --- a/Number_types/include/CGAL/Gmpz.h +++ b/Number_types/include/CGAL/Gmpz.h @@ -215,6 +215,7 @@ namespace Eigen { typedef CGAL::Gmpz Real; typedef CGAL::Gmpq NonInteger; typedef CGAL::Gmpz Nested; + typedef CGAL::Gmpz Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } diff --git a/Number_types/include/CGAL/Lazy_exact_nt.h b/Number_types/include/CGAL/Lazy_exact_nt.h index 4c0678a7976..77350845ba6 100644 --- a/Number_types/include/CGAL/Lazy_exact_nt.h +++ b/Number_types/include/CGAL/Lazy_exact_nt.h @@ -1428,6 +1428,7 @@ namespace Eigen { // typedef CGAL::Lazy_exact_nt NonInteger; typedef CGAL::Lazy_exact_nt::NonInteger> NonInteger; typedef CGAL::Lazy_exact_nt Nested; + typedef CGAL::Lazy_exact_nt Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } diff --git a/Number_types/include/CGAL/MP_Float.h b/Number_types/include/CGAL/MP_Float.h index 0e1312be337..06436b64731 100644 --- a/Number_types/include/CGAL/MP_Float.h +++ b/Number_types/include/CGAL/MP_Float.h @@ -888,6 +888,7 @@ namespace Eigen { typedef CGAL::MP_Float Real; typedef CGAL::Quotient NonInteger; typedef CGAL::MP_Float Nested; + typedef CGAL::MP_Float Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } diff --git a/Number_types/include/CGAL/Mpzf.h b/Number_types/include/CGAL/Mpzf.h index 55ceb4ecb61..930f6bdea40 100644 --- a/Number_types/include/CGAL/Mpzf.h +++ b/Number_types/include/CGAL/Mpzf.h @@ -1135,6 +1135,7 @@ namespace Eigen { /* Should this be Quotient? Gmpq? */ typedef CGAL::Mpzf NonInteger; typedef CGAL::Mpzf Nested; + typedef CGAL::Mpzf Literal; static inline Real epsilon() { return 0; } static inline Real dummy_precision() { return 0; } diff --git a/Number_types/include/CGAL/Quotient.h b/Number_types/include/CGAL/Quotient.h index a1934fc12ee..2617ac92dd8 100644 --- a/Number_types/include/CGAL/Quotient.h +++ b/Number_types/include/CGAL/Quotient.h @@ -859,6 +859,7 @@ namespace Eigen { typedef CGAL::Quotient Real; typedef CGAL::Quotient NonInteger; typedef CGAL::Quotient Nested; + typedef CGAL::Quotient Literal; static inline Real epsilon() { return NumTraits::epsilon(); } static inline Real dummy_precision() { return NumTraits::dummy_precision(); } diff --git a/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h b/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h index c9d28d8a993..725e8b177e2 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Eigen_NumTraits.h @@ -30,6 +30,7 @@ namespace Eigen { typedef CGAL::Sqrt_extension Real; typedef Real NonInteger; typedef Real Nested; + typedef Real Literal; static inline Real epsilon() { return NumTraits::epsilon(); } From 147ebae4d6ba604a1f1be5b942007ebcbdc7492a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 31 Aug 2016 09:13:38 +0200 Subject: [PATCH 5/6] Fix bug in polyline simplification: We had hardwired that we use Exact_predicates_tag which is slow for EPEC in particular with Quotient or leda::real We determine the appropriate tag using Algebraic_structure_traits::Is_exact --- .../CGAL/Polyline_simplification_2/simplify.h | 4 ++-- .../include/CGAL/Constrained_triangulation_2.h | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h index 9f0f46f38e5..9b6a4002b39 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h @@ -339,7 +339,7 @@ template typedef Vertex_base_2< K > Vb; typedef CGAL::Constrained_triangulation_face_base_2 Fb; typedef CGAL::Triangulation_data_structure_2 TDS; - typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; + typedef CGAL::Constrained_Delaunay_triangulation_2::type> CDT; typedef CGAL::Constrained_triangulation_plus_2 PCT; typedef typename PCT::Constraint_id Constraint_id; typedef typename PCT::Vertices_in_constraint_iterator Vertices_in_constraint_iterator; @@ -387,7 +387,7 @@ Simplifies an open or closed polyline given as an iterator range of 2D \cgal poi typedef Vertex_base_2< K > Vb; typedef CGAL::Constrained_triangulation_face_base_2 Fb; typedef CGAL::Triangulation_data_structure_2 TDS; - typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; + typedef CGAL::Constrained_Delaunay_triangulation_2::type > CDT; typedef CGAL::Constrained_triangulation_plus_2 PCT; typedef typename PCT::Constraint_id Constraint_id; typedef typename PCT::Vertices_in_constraint_iterator Vertices_in_constraint_iterator; diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h index 4ffa91894a0..46c422d016e 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h @@ -32,12 +32,24 @@ #include #include +#include + namespace CGAL { struct No_intersection_tag{}; struct Exact_intersections_tag{}; // to be used with an exact number type struct Exact_predicates_tag{}; // to be used with filtered exact number +namespace internal { + +template +struct Itag { + typedef typename boost::mpl::if_::Is_exact, + Exact_intersections_tag, + Exact_predicates_tag>::type type; +}; + +} // namespace internal template < class Gt, class Tds = Triangulation_data_structure_2 < From 343fb726fa8a19666a6c18c44ed30250d17f362e Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Thu, 15 Sep 2016 15:52:47 +0200 Subject: [PATCH 6/6] Add missing include directive --- .../CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h index 7ab4762e60f..5b9a0299b62 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h @@ -25,6 +25,7 @@ #include #include #include +#include #include namespace CGAL