diff --git a/Packages/Interval_arithmetic/changes.txt b/Packages/Interval_arithmetic/changes.txt index 7160641619a..959fae62760 100644 --- a/Packages/Interval_arithmetic/changes.txt +++ b/Packages/Interval_arithmetic/changes.txt @@ -1,3 +1,7 @@ +Version 4.152 on 13 November 2002 +- The Perl script now overloads predicates also for Lazy_exact_nt, so that you + don't have to wrap it in Filtered_exact to get the maximum performance. + Version 4.151 on 13 November 2002 - Fix Lazy_exact_nt test program. diff --git a/Packages/Interval_arithmetic/doc_tex/NumberTypeSupport_ref/Lazy_exact_nt.tex b/Packages/Interval_arithmetic/doc_tex/NumberTypeSupport_ref/Lazy_exact_nt.tex index a91589c9c4d..f3fb1e51496 100644 --- a/Packages/Interval_arithmetic/doc_tex/NumberTypeSupport_ref/Lazy_exact_nt.tex +++ b/Packages/Interval_arithmetic/doc_tex/NumberTypeSupport_ref/Lazy_exact_nt.tex @@ -16,6 +16,15 @@ that it is faster because it tries to only compute an approximation of the value, and only refers to \ccc{NT} when needed. The goal is to speed up exact computations done by any exact but slow number type \ccc{NT}. +In addition to the filtering at each arithmetic operation, the predicates +are overloaded in the same way as for \ccc{Filtered_exact}, so you get the +additional speed up without requiring to encapsulate \ccc{Lazy_exact_nt} +into \ccc{Filtered_exact}. You still need to include +\ccc{CGAL/Filtered_exact.h} in order to include the overloaded functions. +These overloaded functions do not work if the compiler does not support +partial overloading of function templates, e.g. Visual C++ (so you miss an +additional speed up in this case). + \ccInclude{CGAL/Lazy_exact_nt.h} \ccIsModel @@ -48,6 +57,12 @@ constructor from a double too).} \ccMethod{NT exact();} {returns the corresponding NT value.} +\ccMethod{Interval_nt approx();} {returns an interval containing the +exact value.} + +\ccMethod{Interval_nt interval();} {returns an interval containing the +exact value.} + \ccFunction{std::ostream& operator<<(std::ostream& out, const Lazy_exact_nt& m);} {writes \ccc{m} to ostream \ccc{out} in an interval format.} diff --git a/Packages/Interval_arithmetic/doc_tex/support/NumberTypeSupport_ref/Lazy_exact_nt.tex b/Packages/Interval_arithmetic/doc_tex/support/NumberTypeSupport_ref/Lazy_exact_nt.tex index a91589c9c4d..f3fb1e51496 100644 --- a/Packages/Interval_arithmetic/doc_tex/support/NumberTypeSupport_ref/Lazy_exact_nt.tex +++ b/Packages/Interval_arithmetic/doc_tex/support/NumberTypeSupport_ref/Lazy_exact_nt.tex @@ -16,6 +16,15 @@ that it is faster because it tries to only compute an approximation of the value, and only refers to \ccc{NT} when needed. The goal is to speed up exact computations done by any exact but slow number type \ccc{NT}. +In addition to the filtering at each arithmetic operation, the predicates +are overloaded in the same way as for \ccc{Filtered_exact}, so you get the +additional speed up without requiring to encapsulate \ccc{Lazy_exact_nt} +into \ccc{Filtered_exact}. You still need to include +\ccc{CGAL/Filtered_exact.h} in order to include the overloaded functions. +These overloaded functions do not work if the compiler does not support +partial overloading of function templates, e.g. Visual C++ (so you miss an +additional speed up in this case). + \ccInclude{CGAL/Lazy_exact_nt.h} \ccIsModel @@ -48,6 +57,12 @@ constructor from a double too).} \ccMethod{NT exact();} {returns the corresponding NT value.} +\ccMethod{Interval_nt approx();} {returns an interval containing the +exact value.} + +\ccMethod{Interval_nt interval();} {returns an interval containing the +exact value.} + \ccFunction{std::ostream& operator<<(std::ostream& out, const Lazy_exact_nt& m);} {writes \ccc{m} to ostream \ccc{out} in an interval format.} diff --git a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_ftC2.h b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_ftC2.h index e032a69f544..88bb00ddd1c 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_ftC2.h +++ b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_ftC2.h @@ -26,6 +26,10 @@ #include +CGAL_BEGIN_NAMESPACE +template class Lazy_exact_nt; +CGAL_END_NAMESPACE + CGAL_BEGIN_NAMESPACE #ifndef CGAL_CFG_MATCHING_BUG_2 @@ -94,6 +98,69 @@ power_testC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* */ +Oriented_side +power_testC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pwt, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qwt, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &rwt, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty, + const Lazy_exact_nt &twt) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA power_testC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return power_testC2( + px.interval(), + py.interval(), + pwt.interval(), + qx.interval(), + qy.interval(), + qwt.interval(), + rx.interval(), + ry.interval(), + rwt.interval(), + tx.interval(), + ty.interval(), + twt.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA power_testC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return power_testC2( + px.exact(), + py.exact(), + pwt.exact(), + qx.exact(), + qy.exact(), + qwt.exact(), + rx.exact(), + ry.exact(), + rwt.exact(), + tx.exact(), + ty.exact(), + twt.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -151,6 +218,60 @@ power_testC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* */ +Oriented_side +power_testC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pwt, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qwt, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty, + const Lazy_exact_nt &twt) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA power_testC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return power_testC2( + px.interval(), + py.interval(), + pwt.interval(), + qx.interval(), + qy.interval(), + qwt.interval(), + tx.interval(), + ty.interval(), + twt.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA power_testC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return power_testC2( + px.exact(), + py.exact(), + pwt.exact(), + qx.exact(), + qy.exact(), + qwt.exact(), + tx.exact(), + ty.exact(), + twt.exact()); + } +} +#endif + CGAL_END_NAMESPACE #endif // CGAL_ARITHMETIC_FILTER_REGULAR_TRIANGULATION_FTC2_H diff --git a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_ftC3.h b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_ftC3.h index 0f4608b2f35..dd28bd48019 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_ftC3.h +++ b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_ftC3.h @@ -26,6 +26,10 @@ #include +CGAL_BEGIN_NAMESPACE +template class Lazy_exact_nt; +CGAL_END_NAMESPACE + CGAL_BEGIN_NAMESPACE #ifndef CGAL_CFG_MATCHING_BUG_2 @@ -118,6 +122,93 @@ power_testC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* */ +Oriented_side +power_testC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &pwt, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &qwt, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &rz, + const Lazy_exact_nt &rwt, + const Lazy_exact_nt &sx, + const Lazy_exact_nt &sy, + const Lazy_exact_nt &sz, + const Lazy_exact_nt &swt, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty, + const Lazy_exact_nt &tz, + const Lazy_exact_nt &twt) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA power_testC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return power_testC3( + px.interval(), + py.interval(), + pz.interval(), + pwt.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + qwt.interval(), + rx.interval(), + ry.interval(), + rz.interval(), + rwt.interval(), + sx.interval(), + sy.interval(), + sz.interval(), + swt.interval(), + tx.interval(), + ty.interval(), + tz.interval(), + twt.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA power_testC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return power_testC3( + px.exact(), + py.exact(), + pz.exact(), + pwt.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + qwt.exact(), + rx.exact(), + ry.exact(), + rz.exact(), + rwt.exact(), + sx.exact(), + sy.exact(), + sz.exact(), + swt.exact(), + tx.exact(), + ty.exact(), + tz.exact(), + twt.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -196,6 +287,81 @@ power_testC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* */ +Oriented_side +power_testC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &pwt, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &qwt, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &rz, + const Lazy_exact_nt &rwt, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty, + const Lazy_exact_nt &tz, + const Lazy_exact_nt &twt) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA power_testC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return power_testC3( + px.interval(), + py.interval(), + pz.interval(), + pwt.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + qwt.interval(), + rx.interval(), + ry.interval(), + rz.interval(), + rwt.interval(), + tx.interval(), + ty.interval(), + tz.interval(), + twt.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA power_testC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return power_testC3( + px.exact(), + py.exact(), + pz.exact(), + pwt.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + qwt.exact(), + rx.exact(), + ry.exact(), + rz.exact(), + rwt.exact(), + tx.exact(), + ty.exact(), + tz.exact(), + twt.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -262,6 +428,69 @@ power_testC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* */ +Oriented_side +power_testC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &pwt, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &qwt, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty, + const Lazy_exact_nt &tz, + const Lazy_exact_nt &twt) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA power_testC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return power_testC3( + px.interval(), + py.interval(), + pz.interval(), + pwt.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + qwt.interval(), + tx.interval(), + ty.interval(), + tz.interval(), + twt.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA power_testC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return power_testC3( + px.exact(), + py.exact(), + pz.exact(), + pwt.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + qwt.exact(), + tx.exact(), + ty.exact(), + tz.exact(), + twt.exact()); + } +} +#endif + CGAL_END_NAMESPACE #endif // CGAL_ARITHMETIC_FILTER_REGULAR_TRIANGULATION_FTC3_H diff --git a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_rtH2.h b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_rtH2.h index 6534f1cea12..98c5684571a 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_rtH2.h +++ b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_rtH2.h @@ -26,6 +26,10 @@ #include +CGAL_BEGIN_NAMESPACE +template class Lazy_exact_nt; +CGAL_END_NAMESPACE + CGAL_BEGIN_NAMESPACE #ifndef CGAL_CFG_MATCHING_BUG_2 @@ -106,6 +110,81 @@ power_testH2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* */ +Oriented_side +power_testH2( + const Lazy_exact_nt &phx, + const Lazy_exact_nt &phy, + const Lazy_exact_nt &phw, + const Lazy_exact_nt &pwt, + const Lazy_exact_nt &qhx, + const Lazy_exact_nt &qhy, + const Lazy_exact_nt &qhw, + const Lazy_exact_nt &qwt, + const Lazy_exact_nt &rhx, + const Lazy_exact_nt &rhy, + const Lazy_exact_nt &rhw, + const Lazy_exact_nt &rwt, + const Lazy_exact_nt &thx, + const Lazy_exact_nt &thy, + const Lazy_exact_nt &thw, + const Lazy_exact_nt &twt) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA power_testH2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return power_testH2( + phx.interval(), + phy.interval(), + phw.interval(), + pwt.interval(), + qhx.interval(), + qhy.interval(), + qhw.interval(), + qwt.interval(), + rhx.interval(), + rhy.interval(), + rhw.interval(), + rwt.interval(), + thx.interval(), + thy.interval(), + thw.interval(), + twt.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA power_testH2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return power_testH2( + phx.exact(), + phy.exact(), + phw.exact(), + pwt.exact(), + qhx.exact(), + qhy.exact(), + qhw.exact(), + qwt.exact(), + rhx.exact(), + rhy.exact(), + rhw.exact(), + rwt.exact(), + thx.exact(), + thy.exact(), + thw.exact(), + twt.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -172,6 +251,69 @@ power_testH2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* */ +Oriented_side +power_testH2( + const Lazy_exact_nt &phx, + const Lazy_exact_nt &phy, + const Lazy_exact_nt &phw, + const Lazy_exact_nt &pwt, + const Lazy_exact_nt &qhx, + const Lazy_exact_nt &qhy, + const Lazy_exact_nt &qhw, + const Lazy_exact_nt &qwt, + const Lazy_exact_nt &thx, + const Lazy_exact_nt &thy, + const Lazy_exact_nt &thw, + const Lazy_exact_nt &twt) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA power_testH2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return power_testH2( + phx.interval(), + phy.interval(), + phw.interval(), + pwt.interval(), + qhx.interval(), + qhy.interval(), + qhw.interval(), + qwt.interval(), + thx.interval(), + thy.interval(), + thw.interval(), + twt.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA power_testH2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return power_testH2( + phx.exact(), + phy.exact(), + phw.exact(), + pwt.exact(), + qhx.exact(), + qhy.exact(), + qhw.exact(), + qwt.exact(), + thx.exact(), + thy.exact(), + thw.exact(), + twt.exact()); + } +} +#endif + CGAL_END_NAMESPACE #endif // CGAL_ARITHMETIC_FILTER_REGULAR_TRIANGULATION_RTH2_H diff --git a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_rtH3.h b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_rtH3.h index a4b721b83ea..c8c1e5293cf 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_rtH3.h +++ b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/Regular_triangulation_rtH3.h @@ -26,6 +26,10 @@ #include +CGAL_BEGIN_NAMESPACE +template class Lazy_exact_nt; +CGAL_END_NAMESPACE + CGAL_BEGIN_NAMESPACE #ifndef CGAL_CFG_MATCHING_BUG_2 @@ -133,6 +137,108 @@ power_testH3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* */ +Oriented_side +power_testH3( + const Lazy_exact_nt &phx, + const Lazy_exact_nt &phy, + const Lazy_exact_nt &phz, + const Lazy_exact_nt &phw, + const Lazy_exact_nt &pwt, + const Lazy_exact_nt &qhx, + const Lazy_exact_nt &qhy, + const Lazy_exact_nt &qhz, + const Lazy_exact_nt &qhw, + const Lazy_exact_nt &qwt, + const Lazy_exact_nt &rhx, + const Lazy_exact_nt &rhy, + const Lazy_exact_nt &rhz, + const Lazy_exact_nt &rhw, + const Lazy_exact_nt &rwt, + const Lazy_exact_nt &shx, + const Lazy_exact_nt ­, + const Lazy_exact_nt &shz, + const Lazy_exact_nt &shw, + const Lazy_exact_nt &swt, + const Lazy_exact_nt &thx, + const Lazy_exact_nt &thy, + const Lazy_exact_nt &thz, + const Lazy_exact_nt &thw, + const Lazy_exact_nt &twt) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA power_testH3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return power_testH3( + phx.interval(), + phy.interval(), + phz.interval(), + phw.interval(), + pwt.interval(), + qhx.interval(), + qhy.interval(), + qhz.interval(), + qhw.interval(), + qwt.interval(), + rhx.interval(), + rhy.interval(), + rhz.interval(), + rhw.interval(), + rwt.interval(), + shx.interval(), + shy.interval(), + shz.interval(), + shw.interval(), + swt.interval(), + thx.interval(), + thy.interval(), + thz.interval(), + thw.interval(), + twt.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA power_testH3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return power_testH3( + phx.exact(), + phy.exact(), + phz.exact(), + phw.exact(), + pwt.exact(), + qhx.exact(), + qhy.exact(), + qhz.exact(), + qhw.exact(), + qwt.exact(), + rhx.exact(), + rhy.exact(), + rhz.exact(), + rhw.exact(), + rwt.exact(), + shx.exact(), + shy.exact(), + shz.exact(), + shw.exact(), + swt.exact(), + thx.exact(), + thy.exact(), + thz.exact(), + thw.exact(), + twt.exact()); + } +} +#endif + CGAL_END_NAMESPACE #endif // CGAL_ARITHMETIC_FILTER_REGULAR_TRIANGULATION_RTH3_H diff --git a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/in_smallest_orthogonalcircle_ftC2.h b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/in_smallest_orthogonalcircle_ftC2.h index 4965ee32e01..4a8adca9497 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/in_smallest_orthogonalcircle_ftC2.h +++ b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/in_smallest_orthogonalcircle_ftC2.h @@ -26,6 +26,10 @@ #include +CGAL_BEGIN_NAMESPACE +template class Lazy_exact_nt; +CGAL_END_NAMESPACE + CGAL_BEGIN_NAMESPACE #ifndef CGAL_CFG_MATCHING_BUG_2 @@ -85,6 +89,60 @@ in_smallest_orthogonalcircleC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_MEDIUM_INLINE */ +Bounded_side +in_smallest_orthogonalcircleC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pw, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qw, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty, + const Lazy_exact_nt &tw) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA in_smallest_orthogonalcircleC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return in_smallest_orthogonalcircleC2( + px.interval(), + py.interval(), + pw.interval(), + qx.interval(), + qy.interval(), + qw.interval(), + tx.interval(), + ty.interval(), + tw.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA in_smallest_orthogonalcircleC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return in_smallest_orthogonalcircleC2( + px.exact(), + py.exact(), + pw.exact(), + qx.exact(), + qy.exact(), + qw.exact(), + tx.exact(), + ty.exact(), + tw.exact()); + } +} +#endif + CGAL_END_NAMESPACE #endif // CGAL_ARITHMETIC_FILTER_IN_SMALLEST_ORTHOGONALCIRCLE_FTC2_H diff --git a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/kernel_ftC2.h b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/kernel_ftC2.h index 4cd491224a5..2d53fd68b00 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/kernel_ftC2.h +++ b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/kernel_ftC2.h @@ -26,6 +26,10 @@ #include +CGAL_BEGIN_NAMESPACE +template class Lazy_exact_nt; +CGAL_END_NAMESPACE + CGAL_BEGIN_NAMESPACE #ifndef CGAL_CFG_MATCHING_BUG_2 @@ -76,6 +80,51 @@ equal_lineC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +bool +equal_lineC2( + const Lazy_exact_nt &l1a, + const Lazy_exact_nt &l1b, + const Lazy_exact_nt &l1c, + const Lazy_exact_nt &l2a, + const Lazy_exact_nt &l2b, + const Lazy_exact_nt &l2c) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA equal_lineC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return equal_lineC2( + l1a.interval(), + l1b.interval(), + l1c.interval(), + l2a.interval(), + l2b.interval(), + l2c.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA equal_lineC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return equal_lineC2( + l1a.exact(), + l1b.exact(), + l1c.exact(), + l2a.exact(), + l2b.exact(), + l2c.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -127,6 +176,54 @@ compare_xC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Comparison_result +compare_xC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &la, + const Lazy_exact_nt &lb, + const Lazy_exact_nt &lc, + const Lazy_exact_nt &ha, + const Lazy_exact_nt &hb, + const Lazy_exact_nt &hc) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA compare_xC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return compare_xC2( + px.interval(), + la.interval(), + lb.interval(), + lc.interval(), + ha.interval(), + hb.interval(), + hc.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA compare_xC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return compare_xC2( + px.exact(), + la.exact(), + lb.exact(), + lc.exact(), + ha.exact(), + hb.exact(), + hc.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -184,6 +281,60 @@ compare_xC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Comparison_result +compare_xC2( + const Lazy_exact_nt &la, + const Lazy_exact_nt &lb, + const Lazy_exact_nt &lc, + const Lazy_exact_nt &h1a, + const Lazy_exact_nt &h1b, + const Lazy_exact_nt &h1c, + const Lazy_exact_nt &h2a, + const Lazy_exact_nt &h2b, + const Lazy_exact_nt &h2c) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA compare_xC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return compare_xC2( + la.interval(), + lb.interval(), + lc.interval(), + h1a.interval(), + h1b.interval(), + h1c.interval(), + h2a.interval(), + h2b.interval(), + h2c.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA compare_xC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return compare_xC2( + la.exact(), + lb.exact(), + lc.exact(), + h1a.exact(), + h1b.exact(), + h1c.exact(), + h2a.exact(), + h2b.exact(), + h2c.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -250,6 +401,69 @@ compare_xC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Comparison_result +compare_xC2( + const Lazy_exact_nt &l1a, + const Lazy_exact_nt &l1b, + const Lazy_exact_nt &l1c, + const Lazy_exact_nt &h1a, + const Lazy_exact_nt &h1b, + const Lazy_exact_nt &h1c, + const Lazy_exact_nt &l2a, + const Lazy_exact_nt &l2b, + const Lazy_exact_nt &l2c, + const Lazy_exact_nt &h2a, + const Lazy_exact_nt &h2b, + const Lazy_exact_nt &h2c) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA compare_xC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return compare_xC2( + l1a.interval(), + l1b.interval(), + l1c.interval(), + h1a.interval(), + h1b.interval(), + h1c.interval(), + l2a.interval(), + l2b.interval(), + l2c.interval(), + h2a.interval(), + h2b.interval(), + h2c.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA compare_xC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return compare_xC2( + l1a.exact(), + l1b.exact(), + l1c.exact(), + h1a.exact(), + h1b.exact(), + h1c.exact(), + l2a.exact(), + l2b.exact(), + l2c.exact(), + h2a.exact(), + h2b.exact(), + h2c.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -295,6 +509,48 @@ compare_y_at_xC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Comparison_result +compare_y_at_xC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &la, + const Lazy_exact_nt &lb, + const Lazy_exact_nt &lc) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA compare_y_at_xC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return compare_y_at_xC2( + px.interval(), + py.interval(), + la.interval(), + lb.interval(), + lc.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA compare_y_at_xC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return compare_y_at_xC2( + px.exact(), + py.exact(), + la.exact(), + lb.exact(), + lc.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -346,6 +602,54 @@ compare_y_at_xC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Comparison_result +compare_y_at_xC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &l1a, + const Lazy_exact_nt &l1b, + const Lazy_exact_nt &l1c, + const Lazy_exact_nt &l2a, + const Lazy_exact_nt &l2b, + const Lazy_exact_nt &l2c) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA compare_y_at_xC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return compare_y_at_xC2( + px.interval(), + l1a.interval(), + l1b.interval(), + l1c.interval(), + l2a.interval(), + l2b.interval(), + l2c.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA compare_y_at_xC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return compare_y_at_xC2( + px.exact(), + l1a.exact(), + l1b.exact(), + l1c.exact(), + l2a.exact(), + l2b.exact(), + l2c.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -403,6 +707,60 @@ compare_y_at_xC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_LARGE_INLINE */ +Comparison_result +compare_y_at_xC2( + const Lazy_exact_nt &l1a, + const Lazy_exact_nt &l1b, + const Lazy_exact_nt &l1c, + const Lazy_exact_nt &l2a, + const Lazy_exact_nt &l2b, + const Lazy_exact_nt &l2c, + const Lazy_exact_nt &ha, + const Lazy_exact_nt &hb, + const Lazy_exact_nt &hc) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA compare_y_at_xC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return compare_y_at_xC2( + l1a.interval(), + l1b.interval(), + l1c.interval(), + l2a.interval(), + l2b.interval(), + l2c.interval(), + ha.interval(), + hb.interval(), + hc.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA compare_y_at_xC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return compare_y_at_xC2( + l1a.exact(), + l1b.exact(), + l1c.exact(), + l2a.exact(), + l2b.exact(), + l2c.exact(), + ha.exact(), + hb.exact(), + hc.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -469,6 +827,69 @@ compare_y_at_xC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_LARGE_INLINE */ +Comparison_result +compare_y_at_xC2( + const Lazy_exact_nt &l1a, + const Lazy_exact_nt &l1b, + const Lazy_exact_nt &l1c, + const Lazy_exact_nt &l2a, + const Lazy_exact_nt &l2b, + const Lazy_exact_nt &l2c, + const Lazy_exact_nt &h1a, + const Lazy_exact_nt &h1b, + const Lazy_exact_nt &h1c, + const Lazy_exact_nt &h2a, + const Lazy_exact_nt &h2b, + const Lazy_exact_nt &h2c) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA compare_y_at_xC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return compare_y_at_xC2( + l1a.interval(), + l1b.interval(), + l1c.interval(), + l2a.interval(), + l2b.interval(), + l2c.interval(), + h1a.interval(), + h1b.interval(), + h1c.interval(), + h2a.interval(), + h2b.interval(), + h2c.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA compare_y_at_xC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return compare_y_at_xC2( + l1a.exact(), + l1b.exact(), + l1c.exact(), + l2a.exact(), + l2b.exact(), + l2c.exact(), + h1a.exact(), + h1b.exact(), + h1c.exact(), + h2a.exact(), + h2b.exact(), + h2c.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -526,6 +947,60 @@ compare_y_at_x_segment_C2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_LARGE_INLINE */ +Comparison_result +compare_y_at_x_segment_C2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &s1sx, + const Lazy_exact_nt &s1sy, + const Lazy_exact_nt &s1tx, + const Lazy_exact_nt &s1ty, + const Lazy_exact_nt &s2sx, + const Lazy_exact_nt &s2sy, + const Lazy_exact_nt &s2tx, + const Lazy_exact_nt &s2ty) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA compare_y_at_x_segment_C2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return compare_y_at_x_segment_C2( + px.interval(), + s1sx.interval(), + s1sy.interval(), + s1tx.interval(), + s1ty.interval(), + s2sx.interval(), + s2sy.interval(), + s2tx.interval(), + s2ty.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA compare_y_at_x_segment_C2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return compare_y_at_x_segment_C2( + px.exact(), + s1sx.exact(), + s1sy.exact(), + s1tx.exact(), + s1ty.exact(), + s2sx.exact(), + s2sy.exact(), + s2tx.exact(), + s2ty.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -568,6 +1043,45 @@ equal_directionC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +bool +equal_directionC2( + const Lazy_exact_nt &dx1, + const Lazy_exact_nt &dy1, + const Lazy_exact_nt &dx2, + const Lazy_exact_nt &dy2) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA equal_directionC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return equal_directionC2( + dx1.interval(), + dy1.interval(), + dx2.interval(), + dy2.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA equal_directionC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return equal_directionC2( + dx1.exact(), + dy1.exact(), + dx2.exact(), + dy2.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -610,6 +1124,45 @@ compare_slopesC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Comparison_result +compare_slopesC2( + const Lazy_exact_nt &l1a, + const Lazy_exact_nt &l1b, + const Lazy_exact_nt &l2a, + const Lazy_exact_nt &l2b) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA compare_slopesC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return compare_slopesC2( + l1a.interval(), + l1b.interval(), + l2a.interval(), + l2b.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA compare_slopesC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return compare_slopesC2( + l1a.exact(), + l1b.exact(), + l2a.exact(), + l2b.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -664,6 +1217,57 @@ compare_slopesC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Comparison_result +compare_slopesC2( + const Lazy_exact_nt &s1_src_x, + const Lazy_exact_nt &s1_src_y, + const Lazy_exact_nt &s1_tgt_x, + const Lazy_exact_nt &s1_tgt_y, + const Lazy_exact_nt &s2_src_x, + const Lazy_exact_nt &s2_src_y, + const Lazy_exact_nt &s2_tgt_x, + const Lazy_exact_nt &s2_tgt_y) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA compare_slopesC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return compare_slopesC2( + s1_src_x.interval(), + s1_src_y.interval(), + s1_tgt_x.interval(), + s1_tgt_y.interval(), + s2_src_x.interval(), + s2_src_y.interval(), + s2_tgt_x.interval(), + s2_tgt_y.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA compare_slopesC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return compare_slopesC2( + s1_src_x.exact(), + s1_src_y.exact(), + s1_tgt_x.exact(), + s1_tgt_y.exact(), + s2_src_x.exact(), + s2_src_y.exact(), + s2_tgt_x.exact(), + s2_tgt_y.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -706,6 +1310,45 @@ compare_deltax_deltayC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* inline */ +Comparison_result +compare_deltax_deltayC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &sy) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA compare_deltax_deltayC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return compare_deltax_deltayC2( + px.interval(), + qx.interval(), + ry.interval(), + sy.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA compare_deltax_deltayC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return compare_deltax_deltayC2( + px.exact(), + qx.exact(), + ry.exact(), + sy.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -754,6 +1397,51 @@ orientationC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* inline */ +Orientation +orientationC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA orientationC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return orientationC2( + px.interval(), + py.interval(), + qx.interval(), + qy.interval(), + rx.interval(), + ry.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA orientationC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return orientationC2( + px.exact(), + py.exact(), + qx.exact(), + qy.exact(), + rx.exact(), + ry.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -802,6 +1490,51 @@ angleC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* inline */ +Angle +angleC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA angleC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return angleC2( + px.interval(), + py.interval(), + qx.interval(), + qy.interval(), + rx.interval(), + ry.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA angleC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return angleC2( + px.exact(), + py.exact(), + qx.exact(), + qy.exact(), + rx.exact(), + ry.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -856,6 +1589,57 @@ side_of_oriented_circleC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_LARGE_INLINE */ +Oriented_side +side_of_oriented_circleC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA side_of_oriented_circleC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return side_of_oriented_circleC2( + px.interval(), + py.interval(), + qx.interval(), + qy.interval(), + rx.interval(), + ry.interval(), + tx.interval(), + ty.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA side_of_oriented_circleC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return side_of_oriented_circleC2( + px.exact(), + py.exact(), + qx.exact(), + qy.exact(), + rx.exact(), + ry.exact(), + tx.exact(), + ty.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -910,6 +1694,57 @@ side_of_bounded_circleC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_LARGE_INLINE */ +Bounded_side +side_of_bounded_circleC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA side_of_bounded_circleC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return side_of_bounded_circleC2( + px.interval(), + py.interval(), + qx.interval(), + qy.interval(), + rx.interval(), + ry.interval(), + tx.interval(), + ty.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA side_of_bounded_circleC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return side_of_bounded_circleC2( + px.exact(), + py.exact(), + qx.exact(), + qy.exact(), + rx.exact(), + ry.exact(), + tx.exact(), + ty.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -958,6 +1793,51 @@ side_of_bounded_circleC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_LARGE_INLINE */ +Bounded_side +side_of_bounded_circleC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA side_of_bounded_circleC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return side_of_bounded_circleC2( + px.interval(), + py.interval(), + qx.interval(), + qy.interval(), + tx.interval(), + ty.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA side_of_bounded_circleC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return side_of_bounded_circleC2( + px.exact(), + py.exact(), + qx.exact(), + qy.exact(), + tx.exact(), + ty.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -1006,6 +1886,51 @@ cmp_dist_to_pointC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* inline */ +Comparison_result +cmp_dist_to_pointC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA cmp_dist_to_pointC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return cmp_dist_to_pointC2( + px.interval(), + py.interval(), + qx.interval(), + qy.interval(), + rx.interval(), + ry.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA cmp_dist_to_pointC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return cmp_dist_to_pointC2( + px.exact(), + py.exact(), + qx.exact(), + qy.exact(), + rx.exact(), + ry.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -1054,6 +1979,51 @@ cmp_signed_dist_to_directionC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* inline */ +Comparison_result +cmp_signed_dist_to_directionC2( + const Lazy_exact_nt &la, + const Lazy_exact_nt &lb, + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA cmp_signed_dist_to_directionC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return cmp_signed_dist_to_directionC2( + la.interval(), + lb.interval(), + px.interval(), + py.interval(), + qx.interval(), + qy.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA cmp_signed_dist_to_directionC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return cmp_signed_dist_to_directionC2( + la.exact(), + lb.exact(), + px.exact(), + py.exact(), + qx.exact(), + qy.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -1108,6 +2078,57 @@ cmp_signed_dist_to_lineC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* inline */ +Comparison_result +cmp_signed_dist_to_lineC2( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &sx, + const Lazy_exact_nt &sy) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA cmp_signed_dist_to_lineC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return cmp_signed_dist_to_lineC2( + px.interval(), + py.interval(), + qx.interval(), + qy.interval(), + rx.interval(), + ry.interval(), + sx.interval(), + sy.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA cmp_signed_dist_to_lineC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return cmp_signed_dist_to_lineC2( + px.exact(), + py.exact(), + qx.exact(), + qy.exact(), + rx.exact(), + ry.exact(), + sx.exact(), + sy.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -1153,6 +2174,48 @@ side_of_oriented_lineC2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* inline */ +Oriented_side +side_of_oriented_lineC2( + const Lazy_exact_nt &a, + const Lazy_exact_nt &b, + const Lazy_exact_nt &c, + const Lazy_exact_nt &x, + const Lazy_exact_nt &y) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA side_of_oriented_lineC2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return side_of_oriented_lineC2( + a.interval(), + b.interval(), + c.interval(), + x.interval(), + y.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA side_of_oriented_lineC2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return side_of_oriented_lineC2( + a.exact(), + b.exact(), + c.exact(), + x.exact(), + y.exact()); + } +} +#endif + CGAL_END_NAMESPACE #endif // CGAL_ARITHMETIC_FILTER_PREDICATES_KERNEL_FTC2_H diff --git a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/kernel_ftC3.h b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/kernel_ftC3.h index aa188fc98b9..c6cb873f478 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/kernel_ftC3.h +++ b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/kernel_ftC3.h @@ -26,6 +26,10 @@ #include +CGAL_BEGIN_NAMESPACE +template class Lazy_exact_nt; +CGAL_END_NAMESPACE + CGAL_BEGIN_NAMESPACE #ifndef CGAL_CFG_MATCHING_BUG_2 @@ -76,6 +80,51 @@ strict_dominanceC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +bool +strict_dominanceC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA strict_dominanceC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return strict_dominanceC3( + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA strict_dominanceC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return strict_dominanceC3( + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -124,6 +173,51 @@ dominanceC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +bool +dominanceC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA dominanceC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return dominanceC3( + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA dominanceC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return dominanceC3( + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -181,6 +275,60 @@ collinearC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +bool +collinearC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &rz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA collinearC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return collinearC3( + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + rx.interval(), + ry.interval(), + rz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA collinearC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return collinearC3( + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + rx.exact(), + ry.exact(), + rz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -247,6 +395,69 @@ orientationC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Orientation +orientationC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &rz, + const Lazy_exact_nt &sx, + const Lazy_exact_nt &sy, + const Lazy_exact_nt &sz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA orientationC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return orientationC3( + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + rx.interval(), + ry.interval(), + rz.interval(), + sx.interval(), + sy.interval(), + sz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA orientationC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return orientationC3( + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + rx.exact(), + ry.exact(), + rz.exact(), + sx.exact(), + sy.exact(), + sz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -304,6 +515,60 @@ angleC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* inline */ +Angle +angleC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &rz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA angleC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return angleC3( + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + rx.interval(), + ry.interval(), + rz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA angleC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return angleC3( + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + rx.exact(), + ry.exact(), + rz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -370,6 +635,69 @@ coplanar_side_of_bounded_circleC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_LARGE_INLINE */ +Bounded_side +coplanar_side_of_bounded_circleC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &rz, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty, + const Lazy_exact_nt &tz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA coplanar_side_of_bounded_circleC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return coplanar_side_of_bounded_circleC3( + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + rx.interval(), + ry.interval(), + rz.interval(), + tx.interval(), + ty.interval(), + tz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA coplanar_side_of_bounded_circleC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return coplanar_side_of_bounded_circleC3( + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + rx.exact(), + ry.exact(), + rz.exact(), + tx.exact(), + ty.exact(), + tz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -418,6 +746,51 @@ equal_directionC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +bool +equal_directionC3( + const Lazy_exact_nt &dx1, + const Lazy_exact_nt &dy1, + const Lazy_exact_nt &dz1, + const Lazy_exact_nt &dx2, + const Lazy_exact_nt &dy2, + const Lazy_exact_nt &dz2) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA equal_directionC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return equal_directionC3( + dx1.interval(), + dy1.interval(), + dz1.interval(), + dx2.interval(), + dy2.interval(), + dz2.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA equal_directionC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return equal_directionC3( + dx1.exact(), + dy1.exact(), + dz1.exact(), + dx2.exact(), + dy2.exact(), + dz2.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -472,6 +845,57 @@ equal_planeC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +bool +equal_planeC3( + const Lazy_exact_nt &ha, + const Lazy_exact_nt &hb, + const Lazy_exact_nt &hc, + const Lazy_exact_nt &hd, + const Lazy_exact_nt &pa, + const Lazy_exact_nt &pb, + const Lazy_exact_nt &pc, + const Lazy_exact_nt &pd) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA equal_planeC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return equal_planeC3( + ha.interval(), + hb.interval(), + hc.interval(), + hd.interval(), + pa.interval(), + pb.interval(), + pc.interval(), + pd.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA equal_planeC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return equal_planeC3( + ha.exact(), + hb.exact(), + hc.exact(), + hd.exact(), + pa.exact(), + pb.exact(), + pc.exact(), + pd.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -523,6 +947,54 @@ side_of_oriented_planeC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_LARGE_INLINE */ +Oriented_side +side_of_oriented_planeC3( + const Lazy_exact_nt &a, + const Lazy_exact_nt &b, + const Lazy_exact_nt &c, + const Lazy_exact_nt &d, + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA side_of_oriented_planeC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return side_of_oriented_planeC3( + a.interval(), + b.interval(), + c.interval(), + d.interval(), + px.interval(), + py.interval(), + pz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA side_of_oriented_planeC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return side_of_oriented_planeC3( + a.exact(), + b.exact(), + c.exact(), + d.exact(), + px.exact(), + py.exact(), + pz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -598,6 +1070,78 @@ side_of_oriented_sphereC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_LARGE_INLINE */ +Oriented_side +side_of_oriented_sphereC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &rz, + const Lazy_exact_nt &sx, + const Lazy_exact_nt &sy, + const Lazy_exact_nt &sz, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty, + const Lazy_exact_nt &tz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA side_of_oriented_sphereC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return side_of_oriented_sphereC3( + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + rx.interval(), + ry.interval(), + rz.interval(), + sx.interval(), + sy.interval(), + sz.interval(), + tx.interval(), + ty.interval(), + tz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA side_of_oriented_sphereC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return side_of_oriented_sphereC3( + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + rx.exact(), + ry.exact(), + rz.exact(), + sx.exact(), + sy.exact(), + sz.exact(), + tx.exact(), + ty.exact(), + tz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -673,6 +1217,78 @@ side_of_bounded_sphereC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Bounded_side +side_of_bounded_sphereC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &rz, + const Lazy_exact_nt &sx, + const Lazy_exact_nt &sy, + const Lazy_exact_nt &sz, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty, + const Lazy_exact_nt &tz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA side_of_bounded_sphereC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return side_of_bounded_sphereC3( + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + rx.interval(), + ry.interval(), + rz.interval(), + sx.interval(), + sy.interval(), + sz.interval(), + tx.interval(), + ty.interval(), + tz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA side_of_bounded_sphereC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return side_of_bounded_sphereC3( + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + rx.exact(), + ry.exact(), + rz.exact(), + sx.exact(), + sy.exact(), + sz.exact(), + tx.exact(), + ty.exact(), + tz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -730,6 +1346,60 @@ side_of_bounded_sphereC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Bounded_side +side_of_bounded_sphereC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty, + const Lazy_exact_nt &tz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA side_of_bounded_sphereC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return side_of_bounded_sphereC3( + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + tx.interval(), + ty.interval(), + tz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA side_of_bounded_sphereC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return side_of_bounded_sphereC3( + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + tx.exact(), + ty.exact(), + tz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -787,6 +1457,60 @@ cmp_dist_to_pointC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_INLINE */ +Comparison_result +cmp_dist_to_pointC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &rx, + const Lazy_exact_nt &ry, + const Lazy_exact_nt &rz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA cmp_dist_to_pointC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return cmp_dist_to_pointC3( + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + rx.interval(), + ry.interval(), + rz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA cmp_dist_to_pointC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return cmp_dist_to_pointC3( + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + rx.exact(), + ry.exact(), + rz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -853,6 +1577,69 @@ side_of_bounded_sphereC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Bounded_side +side_of_bounded_sphereC3( + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz, + const Lazy_exact_nt &sx, + const Lazy_exact_nt &sy, + const Lazy_exact_nt &sz, + const Lazy_exact_nt &tx, + const Lazy_exact_nt &ty, + const Lazy_exact_nt &tz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA side_of_bounded_sphereC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return side_of_bounded_sphereC3( + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval(), + sx.interval(), + sy.interval(), + sz.interval(), + tx.interval(), + ty.interval(), + tz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA side_of_bounded_sphereC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return side_of_bounded_sphereC3( + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact(), + sx.exact(), + sy.exact(), + sz.exact(), + tx.exact(), + ty.exact(), + tz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -910,6 +1697,60 @@ cmp_signed_dist_to_directionC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Comparison_result +cmp_signed_dist_to_directionC3( + const Lazy_exact_nt &pa, + const Lazy_exact_nt &pb, + const Lazy_exact_nt &pc, + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA cmp_signed_dist_to_directionC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return cmp_signed_dist_to_directionC3( + pa.interval(), + pb.interval(), + pc.interval(), + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA cmp_signed_dist_to_directionC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return cmp_signed_dist_to_directionC3( + pa.exact(), + pb.exact(), + pc.exact(), + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -985,6 +1826,78 @@ cmp_signed_dist_to_planeC3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_MEDIUM_INLINE */ +Comparison_result +cmp_signed_dist_to_planeC3( + const Lazy_exact_nt &ppx, + const Lazy_exact_nt &ppy, + const Lazy_exact_nt &ppz, + const Lazy_exact_nt &pqx, + const Lazy_exact_nt &pqy, + const Lazy_exact_nt &pqz, + const Lazy_exact_nt &prx, + const Lazy_exact_nt &pry, + const Lazy_exact_nt &prz, + const Lazy_exact_nt &px, + const Lazy_exact_nt &py, + const Lazy_exact_nt &pz, + const Lazy_exact_nt &qx, + const Lazy_exact_nt &qy, + const Lazy_exact_nt &qz) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA cmp_signed_dist_to_planeC3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return cmp_signed_dist_to_planeC3( + ppx.interval(), + ppy.interval(), + ppz.interval(), + pqx.interval(), + pqy.interval(), + pqz.interval(), + prx.interval(), + pry.interval(), + prz.interval(), + px.interval(), + py.interval(), + pz.interval(), + qx.interval(), + qy.interval(), + qz.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA cmp_signed_dist_to_planeC3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return cmp_signed_dist_to_planeC3( + ppx.exact(), + ppy.exact(), + ppz.exact(), + pqx.exact(), + pqy.exact(), + pqz.exact(), + prx.exact(), + pry.exact(), + prz.exact(), + px.exact(), + py.exact(), + pz.exact(), + qx.exact(), + qy.exact(), + qz.exact()); + } +} +#endif + CGAL_END_NAMESPACE #endif // CGAL_ARITHMETIC_FILTER_PREDICATES_KERNEL_FTC3_H diff --git a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/sign_of_determinant.h b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/sign_of_determinant.h index f7a4c880cea..d07d1f62259 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/sign_of_determinant.h +++ b/Packages/Interval_arithmetic/include/CGAL/Arithmetic_filter/predicates/sign_of_determinant.h @@ -26,6 +26,10 @@ #include +CGAL_BEGIN_NAMESPACE +template class Lazy_exact_nt; +CGAL_END_NAMESPACE + CGAL_BEGIN_NAMESPACE #ifndef CGAL_CFG_MATCHING_BUG_2 @@ -70,6 +74,45 @@ sign_of_determinant2x2( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* inline */ +Sign +sign_of_determinant2x2( + const Lazy_exact_nt &a00, + const Lazy_exact_nt &a01, + const Lazy_exact_nt &a10, + const Lazy_exact_nt &a11) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA sign_of_determinant2x2 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return sign_of_determinant2x2( + a00.interval(), + a01.interval(), + a10.interval(), + a11.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA sign_of_determinant2x2 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return sign_of_determinant2x2( + a00.exact(), + a01.exact(), + a10.exact(), + a11.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -127,6 +170,60 @@ sign_of_determinant3x3( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* inline */ +Sign +sign_of_determinant3x3( + const Lazy_exact_nt &a00, + const Lazy_exact_nt &a01, + const Lazy_exact_nt &a02, + const Lazy_exact_nt &a10, + const Lazy_exact_nt &a11, + const Lazy_exact_nt &a12, + const Lazy_exact_nt &a20, + const Lazy_exact_nt &a21, + const Lazy_exact_nt &a22) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA sign_of_determinant3x3 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return sign_of_determinant3x3( + a00.interval(), + a01.interval(), + a02.interval(), + a10.interval(), + a11.interval(), + a12.interval(), + a20.interval(), + a21.interval(), + a22.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA sign_of_determinant3x3 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return sign_of_determinant3x3( + a00.exact(), + a01.exact(), + a02.exact(), + a10.exact(), + a11.exact(), + a12.exact(), + a20.exact(), + a21.exact(), + a22.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -205,6 +302,81 @@ sign_of_determinant4x4( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* inline */ +Sign +sign_of_determinant4x4( + const Lazy_exact_nt &a00, + const Lazy_exact_nt &a01, + const Lazy_exact_nt &a02, + const Lazy_exact_nt &a03, + const Lazy_exact_nt &a10, + const Lazy_exact_nt &a11, + const Lazy_exact_nt &a12, + const Lazy_exact_nt &a13, + const Lazy_exact_nt &a20, + const Lazy_exact_nt &a21, + const Lazy_exact_nt &a22, + const Lazy_exact_nt &a23, + const Lazy_exact_nt &a30, + const Lazy_exact_nt &a31, + const Lazy_exact_nt &a32, + const Lazy_exact_nt &a33) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA sign_of_determinant4x4 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return sign_of_determinant4x4( + a00.interval(), + a01.interval(), + a02.interval(), + a03.interval(), + a10.interval(), + a11.interval(), + a12.interval(), + a13.interval(), + a20.interval(), + a21.interval(), + a22.interval(), + a23.interval(), + a30.interval(), + a31.interval(), + a32.interval(), + a33.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA sign_of_determinant4x4 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return sign_of_determinant4x4( + a00.exact(), + a01.exact(), + a02.exact(), + a03.exact(), + a10.exact(), + a11.exact(), + a12.exact(), + a13.exact(), + a20.exact(), + a21.exact(), + a22.exact(), + a23.exact(), + a30.exact(), + a31.exact(), + a32.exact(), + a33.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -310,6 +482,108 @@ sign_of_determinant5x5( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_LARGE_INLINE */ +Sign +sign_of_determinant5x5( + const Lazy_exact_nt &a00, + const Lazy_exact_nt &a01, + const Lazy_exact_nt &a02, + const Lazy_exact_nt &a03, + const Lazy_exact_nt &a04, + const Lazy_exact_nt &a10, + const Lazy_exact_nt &a11, + const Lazy_exact_nt &a12, + const Lazy_exact_nt &a13, + const Lazy_exact_nt &a14, + const Lazy_exact_nt &a20, + const Lazy_exact_nt &a21, + const Lazy_exact_nt &a22, + const Lazy_exact_nt &a23, + const Lazy_exact_nt &a24, + const Lazy_exact_nt &a30, + const Lazy_exact_nt &a31, + const Lazy_exact_nt &a32, + const Lazy_exact_nt &a33, + const Lazy_exact_nt &a34, + const Lazy_exact_nt &a40, + const Lazy_exact_nt &a41, + const Lazy_exact_nt &a42, + const Lazy_exact_nt &a43, + const Lazy_exact_nt &a44) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA sign_of_determinant5x5 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return sign_of_determinant5x5( + a00.interval(), + a01.interval(), + a02.interval(), + a03.interval(), + a04.interval(), + a10.interval(), + a11.interval(), + a12.interval(), + a13.interval(), + a14.interval(), + a20.interval(), + a21.interval(), + a22.interval(), + a23.interval(), + a24.interval(), + a30.interval(), + a31.interval(), + a32.interval(), + a33.interval(), + a34.interval(), + a40.interval(), + a41.interval(), + a42.interval(), + a43.interval(), + a44.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA sign_of_determinant5x5 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return sign_of_determinant5x5( + a00.exact(), + a01.exact(), + a02.exact(), + a03.exact(), + a04.exact(), + a10.exact(), + a11.exact(), + a12.exact(), + a13.exact(), + a14.exact(), + a20.exact(), + a21.exact(), + a22.exact(), + a23.exact(), + a24.exact(), + a30.exact(), + a31.exact(), + a32.exact(), + a33.exact(), + a34.exact(), + a40.exact(), + a41.exact(), + a42.exact(), + a43.exact(), + a44.exact()); + } +} +#endif + #ifndef CGAL_CFG_MATCHING_BUG_2 template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED, class CGAL_IA_CACHE > @@ -448,6 +722,141 @@ sign_of_determinant6x6( } } +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* CGAL_KERNEL_LARGE_INLINE */ +Sign +sign_of_determinant6x6( + const Lazy_exact_nt &a00, + const Lazy_exact_nt &a01, + const Lazy_exact_nt &a02, + const Lazy_exact_nt &a03, + const Lazy_exact_nt &a04, + const Lazy_exact_nt &a05, + const Lazy_exact_nt &a10, + const Lazy_exact_nt &a11, + const Lazy_exact_nt &a12, + const Lazy_exact_nt &a13, + const Lazy_exact_nt &a14, + const Lazy_exact_nt &a15, + const Lazy_exact_nt &a20, + const Lazy_exact_nt &a21, + const Lazy_exact_nt &a22, + const Lazy_exact_nt &a23, + const Lazy_exact_nt &a24, + const Lazy_exact_nt &a25, + const Lazy_exact_nt &a30, + const Lazy_exact_nt &a31, + const Lazy_exact_nt &a32, + const Lazy_exact_nt &a33, + const Lazy_exact_nt &a34, + const Lazy_exact_nt &a35, + const Lazy_exact_nt &a40, + const Lazy_exact_nt &a41, + const Lazy_exact_nt &a42, + const Lazy_exact_nt &a43, + const Lazy_exact_nt &a44, + const Lazy_exact_nt &a45, + const Lazy_exact_nt &a50, + const Lazy_exact_nt &a51, + const Lazy_exact_nt &a52, + const Lazy_exact_nt &a53, + const Lazy_exact_nt &a54, + const Lazy_exact_nt &a55) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls("Lazy IA sign_of_determinant6x6 calls"); + ++calls; +#endif + Protect_FPU_rounding Protection; + return sign_of_determinant6x6( + a00.interval(), + a01.interval(), + a02.interval(), + a03.interval(), + a04.interval(), + a05.interval(), + a10.interval(), + a11.interval(), + a12.interval(), + a13.interval(), + a14.interval(), + a15.interval(), + a20.interval(), + a21.interval(), + a22.interval(), + a23.interval(), + a24.interval(), + a25.interval(), + a30.interval(), + a31.interval(), + a32.interval(), + a33.interval(), + a34.interval(), + a35.interval(), + a40.interval(), + a41.interval(), + a42.interval(), + a43.interval(), + a44.interval(), + a45.interval(), + a50.interval(), + a51.interval(), + a52.interval(), + a53.interval(), + a54.interval(), + a55.interval()); + } + catch (Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures("Lazy IA sign_of_determinant6x6 failures"); + ++failures; +#endif + Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return sign_of_determinant6x6( + a00.exact(), + a01.exact(), + a02.exact(), + a03.exact(), + a04.exact(), + a05.exact(), + a10.exact(), + a11.exact(), + a12.exact(), + a13.exact(), + a14.exact(), + a15.exact(), + a20.exact(), + a21.exact(), + a22.exact(), + a23.exact(), + a24.exact(), + a25.exact(), + a30.exact(), + a31.exact(), + a32.exact(), + a33.exact(), + a34.exact(), + a35.exact(), + a40.exact(), + a41.exact(), + a42.exact(), + a43.exact(), + a44.exact(), + a45.exact(), + a50.exact(), + a51.exact(), + a52.exact(), + a53.exact(), + a54.exact(), + a55.exact()); + } +} +#endif + CGAL_END_NAMESPACE #endif // CGAL_ARITHMETIC_FILTER_PREDICATES_SIGN_OF_DETERMINANT_H diff --git a/Packages/Interval_arithmetic/include/CGAL/Lazy_exact_nt.h b/Packages/Interval_arithmetic/include/CGAL/Lazy_exact_nt.h index 82897b04f14..f630687e588 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Lazy_exact_nt.h +++ b/Packages/Interval_arithmetic/include/CGAL/Lazy_exact_nt.h @@ -294,7 +294,10 @@ public : Self operator/ (const Self & a) const { return new Lazy_exact_Div(*this, a); } - Interval_nt approx() const // throw() ? + Interval_nt approx() const + { return ptr()->approx(); } + + Interval_nt interval() const { return ptr()->approx(); } Interval_nt_advanced approx_adv() const diff --git a/Packages/Interval_arithmetic/scripts/filtered_predicates_generator.pl b/Packages/Interval_arithmetic/scripts/filtered_predicates_generator.pl index c0b4b1142d0..218e5933d94 100755 --- a/Packages/Interval_arithmetic/scripts/filtered_predicates_generator.pl +++ b/Packages/Interval_arithmetic/scripts/filtered_predicates_generator.pl @@ -112,7 +112,11 @@ sub print_CGAL_header { #ifndef $new_protect_name #define $new_protect_name -#include \n\n"; +#include + +CGAL_BEGIN_NAMESPACE +template class Lazy_exact_nt; +CGAL_END_NAMESPACE\n\n"; } # Print dynamic versions @@ -120,7 +124,9 @@ sub print_dynamic { my ($CGAL, $t, $inline, $ret_type, $fct_name, $e, $b, $n, @args)=@_; my $type = "const ${CGAL}Filtered_exact "; + my $type2 = "const ${CGAL}Lazy_exact_nt"; my $args_call = join ",", map "\n $type &$_", @args; + my $args_call2 = join ",", map "\n $type2 &$_", @args; my $args_inter = join ",", map "\n\t\t$_.interval()", @args; my $args_exact = join ",", map "\n\t\t$_.exact()", @args; @@ -153,7 +159,34 @@ $fct_name($args_call) ${CGAL}Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); return $fct_name($args_exact); } -}\n\n"; +} + +#ifndef CGAL_CFG_MATCHING_BUG_2 +template < class ET > +/* $inline */ +$ret_type +$fct_name($args_call2) +{ + try + { +#ifdef CGAL_PROFILE + static Profile_counter calls(\"Lazy IA $fct_name calls\"); + ++calls; +#endif + ${CGAL}Protect_FPU_rounding Protection; + return $fct_name($args_inter); + } + catch (${CGAL}Interval_nt_advanced::unsafe_comparison) + { +#ifdef CGAL_PROFILE + static Profile_counter failures(\"Lazy IA $fct_name failures\"); + ++failures; +#endif + ${CGAL}Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); + return $fct_name($args_exact); + } +} +#endif\n\n"; } # Print static infos diff --git a/Packages/Interval_arithmetic/test/Interval_arithmetic/Lazy_exact_nt.C b/Packages/Interval_arithmetic/test/Interval_arithmetic/Lazy_exact_nt.C index aa2b3c1bb70..64de35f071b 100644 --- a/Packages/Interval_arithmetic/test/Interval_arithmetic/Lazy_exact_nt.C +++ b/Packages/Interval_arithmetic/test/Interval_arithmetic/Lazy_exact_nt.C @@ -8,6 +8,8 @@ #include #include #include +#include // To bring in the overloaded predicates + // for Lazy_exact_nt #ifdef CGAL_USE_LEDA # include