- 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.
This commit is contained in:
Sylvain Pion 2002-11-13 13:05:23 +00:00
parent 586287379b
commit 283a3f8cfd
14 changed files with 3116 additions and 3 deletions

View File

@ -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.

View File

@ -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<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<true> approx();} {returns an interval containing the
exact value.}
\ccMethod{Interval_nt<false> interval();} {returns an interval containing the
exact value.}
\ccFunction{std::ostream& operator<<(std::ostream& out,
const Lazy_exact_nt<NT>& m);}
{writes \ccc{m} to ostream \ccc{out} in an interval format.}

View File

@ -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<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<true> approx();} {returns an interval containing the
exact value.}
\ccMethod{Interval_nt<false> interval();} {returns an interval containing the
exact value.}
\ccFunction{std::ostream& operator<<(std::ostream& out,
const Lazy_exact_nt<NT>& m);}
{writes \ccc{m} to ostream \ccc{out} in an interval format.}

View File

@ -26,6 +26,10 @@
#include <CGAL/Profile_counter.h>
CGAL_BEGIN_NAMESPACE
template <class ET> 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<ET> &px,
const Lazy_exact_nt<ET> &py,
const Lazy_exact_nt<ET> &pwt,
const Lazy_exact_nt<ET> &qx,
const Lazy_exact_nt<ET> &qy,
const Lazy_exact_nt<ET> &qwt,
const Lazy_exact_nt<ET> &rx,
const Lazy_exact_nt<ET> &ry,
const Lazy_exact_nt<ET> &rwt,
const Lazy_exact_nt<ET> &tx,
const Lazy_exact_nt<ET> &ty,
const Lazy_exact_nt<ET> &twt)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA power_testC2 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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<ET> &px,
const Lazy_exact_nt<ET> &py,
const Lazy_exact_nt<ET> &pwt,
const Lazy_exact_nt<ET> &qx,
const Lazy_exact_nt<ET> &qy,
const Lazy_exact_nt<ET> &qwt,
const Lazy_exact_nt<ET> &tx,
const Lazy_exact_nt<ET> &ty,
const Lazy_exact_nt<ET> &twt)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA power_testC2 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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

View File

@ -26,6 +26,10 @@
#include <CGAL/Profile_counter.h>
CGAL_BEGIN_NAMESPACE
template <class ET> 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<ET> &px,
const Lazy_exact_nt<ET> &py,
const Lazy_exact_nt<ET> &pz,
const Lazy_exact_nt<ET> &pwt,
const Lazy_exact_nt<ET> &qx,
const Lazy_exact_nt<ET> &qy,
const Lazy_exact_nt<ET> &qz,
const Lazy_exact_nt<ET> &qwt,
const Lazy_exact_nt<ET> &rx,
const Lazy_exact_nt<ET> &ry,
const Lazy_exact_nt<ET> &rz,
const Lazy_exact_nt<ET> &rwt,
const Lazy_exact_nt<ET> &sx,
const Lazy_exact_nt<ET> &sy,
const Lazy_exact_nt<ET> &sz,
const Lazy_exact_nt<ET> &swt,
const Lazy_exact_nt<ET> &tx,
const Lazy_exact_nt<ET> &ty,
const Lazy_exact_nt<ET> &tz,
const Lazy_exact_nt<ET> &twt)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA power_testC3 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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<ET> &px,
const Lazy_exact_nt<ET> &py,
const Lazy_exact_nt<ET> &pz,
const Lazy_exact_nt<ET> &pwt,
const Lazy_exact_nt<ET> &qx,
const Lazy_exact_nt<ET> &qy,
const Lazy_exact_nt<ET> &qz,
const Lazy_exact_nt<ET> &qwt,
const Lazy_exact_nt<ET> &rx,
const Lazy_exact_nt<ET> &ry,
const Lazy_exact_nt<ET> &rz,
const Lazy_exact_nt<ET> &rwt,
const Lazy_exact_nt<ET> &tx,
const Lazy_exact_nt<ET> &ty,
const Lazy_exact_nt<ET> &tz,
const Lazy_exact_nt<ET> &twt)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA power_testC3 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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<ET> &px,
const Lazy_exact_nt<ET> &py,
const Lazy_exact_nt<ET> &pz,
const Lazy_exact_nt<ET> &pwt,
const Lazy_exact_nt<ET> &qx,
const Lazy_exact_nt<ET> &qy,
const Lazy_exact_nt<ET> &qz,
const Lazy_exact_nt<ET> &qwt,
const Lazy_exact_nt<ET> &tx,
const Lazy_exact_nt<ET> &ty,
const Lazy_exact_nt<ET> &tz,
const Lazy_exact_nt<ET> &twt)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA power_testC3 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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

View File

@ -26,6 +26,10 @@
#include <CGAL/Profile_counter.h>
CGAL_BEGIN_NAMESPACE
template <class ET> 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<ET> &phx,
const Lazy_exact_nt<ET> &phy,
const Lazy_exact_nt<ET> &phw,
const Lazy_exact_nt<ET> &pwt,
const Lazy_exact_nt<ET> &qhx,
const Lazy_exact_nt<ET> &qhy,
const Lazy_exact_nt<ET> &qhw,
const Lazy_exact_nt<ET> &qwt,
const Lazy_exact_nt<ET> &rhx,
const Lazy_exact_nt<ET> &rhy,
const Lazy_exact_nt<ET> &rhw,
const Lazy_exact_nt<ET> &rwt,
const Lazy_exact_nt<ET> &thx,
const Lazy_exact_nt<ET> &thy,
const Lazy_exact_nt<ET> &thw,
const Lazy_exact_nt<ET> &twt)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA power_testH2 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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<ET> &phx,
const Lazy_exact_nt<ET> &phy,
const Lazy_exact_nt<ET> &phw,
const Lazy_exact_nt<ET> &pwt,
const Lazy_exact_nt<ET> &qhx,
const Lazy_exact_nt<ET> &qhy,
const Lazy_exact_nt<ET> &qhw,
const Lazy_exact_nt<ET> &qwt,
const Lazy_exact_nt<ET> &thx,
const Lazy_exact_nt<ET> &thy,
const Lazy_exact_nt<ET> &thw,
const Lazy_exact_nt<ET> &twt)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA power_testH2 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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

View File

@ -26,6 +26,10 @@
#include <CGAL/Profile_counter.h>
CGAL_BEGIN_NAMESPACE
template <class ET> 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<ET> &phx,
const Lazy_exact_nt<ET> &phy,
const Lazy_exact_nt<ET> &phz,
const Lazy_exact_nt<ET> &phw,
const Lazy_exact_nt<ET> &pwt,
const Lazy_exact_nt<ET> &qhx,
const Lazy_exact_nt<ET> &qhy,
const Lazy_exact_nt<ET> &qhz,
const Lazy_exact_nt<ET> &qhw,
const Lazy_exact_nt<ET> &qwt,
const Lazy_exact_nt<ET> &rhx,
const Lazy_exact_nt<ET> &rhy,
const Lazy_exact_nt<ET> &rhz,
const Lazy_exact_nt<ET> &rhw,
const Lazy_exact_nt<ET> &rwt,
const Lazy_exact_nt<ET> &shx,
const Lazy_exact_nt<ET> &shy,
const Lazy_exact_nt<ET> &shz,
const Lazy_exact_nt<ET> &shw,
const Lazy_exact_nt<ET> &swt,
const Lazy_exact_nt<ET> &thx,
const Lazy_exact_nt<ET> &thy,
const Lazy_exact_nt<ET> &thz,
const Lazy_exact_nt<ET> &thw,
const Lazy_exact_nt<ET> &twt)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA power_testH3 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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

View File

@ -26,6 +26,10 @@
#include <CGAL/Profile_counter.h>
CGAL_BEGIN_NAMESPACE
template <class ET> 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<ET> &px,
const Lazy_exact_nt<ET> &py,
const Lazy_exact_nt<ET> &pw,
const Lazy_exact_nt<ET> &qx,
const Lazy_exact_nt<ET> &qy,
const Lazy_exact_nt<ET> &qw,
const Lazy_exact_nt<ET> &tx,
const Lazy_exact_nt<ET> &ty,
const Lazy_exact_nt<ET> &tw)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA in_smallest_orthogonalcircleC2 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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

View File

@ -26,6 +26,10 @@
#include <CGAL/Profile_counter.h>
CGAL_BEGIN_NAMESPACE
template <class ET> 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<ET> &a00,
const Lazy_exact_nt<ET> &a01,
const Lazy_exact_nt<ET> &a10,
const Lazy_exact_nt<ET> &a11)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA sign_of_determinant2x2 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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<ET> &a00,
const Lazy_exact_nt<ET> &a01,
const Lazy_exact_nt<ET> &a02,
const Lazy_exact_nt<ET> &a10,
const Lazy_exact_nt<ET> &a11,
const Lazy_exact_nt<ET> &a12,
const Lazy_exact_nt<ET> &a20,
const Lazy_exact_nt<ET> &a21,
const Lazy_exact_nt<ET> &a22)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA sign_of_determinant3x3 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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<ET> &a00,
const Lazy_exact_nt<ET> &a01,
const Lazy_exact_nt<ET> &a02,
const Lazy_exact_nt<ET> &a03,
const Lazy_exact_nt<ET> &a10,
const Lazy_exact_nt<ET> &a11,
const Lazy_exact_nt<ET> &a12,
const Lazy_exact_nt<ET> &a13,
const Lazy_exact_nt<ET> &a20,
const Lazy_exact_nt<ET> &a21,
const Lazy_exact_nt<ET> &a22,
const Lazy_exact_nt<ET> &a23,
const Lazy_exact_nt<ET> &a30,
const Lazy_exact_nt<ET> &a31,
const Lazy_exact_nt<ET> &a32,
const Lazy_exact_nt<ET> &a33)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA sign_of_determinant4x4 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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<ET> &a00,
const Lazy_exact_nt<ET> &a01,
const Lazy_exact_nt<ET> &a02,
const Lazy_exact_nt<ET> &a03,
const Lazy_exact_nt<ET> &a04,
const Lazy_exact_nt<ET> &a10,
const Lazy_exact_nt<ET> &a11,
const Lazy_exact_nt<ET> &a12,
const Lazy_exact_nt<ET> &a13,
const Lazy_exact_nt<ET> &a14,
const Lazy_exact_nt<ET> &a20,
const Lazy_exact_nt<ET> &a21,
const Lazy_exact_nt<ET> &a22,
const Lazy_exact_nt<ET> &a23,
const Lazy_exact_nt<ET> &a24,
const Lazy_exact_nt<ET> &a30,
const Lazy_exact_nt<ET> &a31,
const Lazy_exact_nt<ET> &a32,
const Lazy_exact_nt<ET> &a33,
const Lazy_exact_nt<ET> &a34,
const Lazy_exact_nt<ET> &a40,
const Lazy_exact_nt<ET> &a41,
const Lazy_exact_nt<ET> &a42,
const Lazy_exact_nt<ET> &a43,
const Lazy_exact_nt<ET> &a44)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA sign_of_determinant5x5 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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<ET> &a00,
const Lazy_exact_nt<ET> &a01,
const Lazy_exact_nt<ET> &a02,
const Lazy_exact_nt<ET> &a03,
const Lazy_exact_nt<ET> &a04,
const Lazy_exact_nt<ET> &a05,
const Lazy_exact_nt<ET> &a10,
const Lazy_exact_nt<ET> &a11,
const Lazy_exact_nt<ET> &a12,
const Lazy_exact_nt<ET> &a13,
const Lazy_exact_nt<ET> &a14,
const Lazy_exact_nt<ET> &a15,
const Lazy_exact_nt<ET> &a20,
const Lazy_exact_nt<ET> &a21,
const Lazy_exact_nt<ET> &a22,
const Lazy_exact_nt<ET> &a23,
const Lazy_exact_nt<ET> &a24,
const Lazy_exact_nt<ET> &a25,
const Lazy_exact_nt<ET> &a30,
const Lazy_exact_nt<ET> &a31,
const Lazy_exact_nt<ET> &a32,
const Lazy_exact_nt<ET> &a33,
const Lazy_exact_nt<ET> &a34,
const Lazy_exact_nt<ET> &a35,
const Lazy_exact_nt<ET> &a40,
const Lazy_exact_nt<ET> &a41,
const Lazy_exact_nt<ET> &a42,
const Lazy_exact_nt<ET> &a43,
const Lazy_exact_nt<ET> &a44,
const Lazy_exact_nt<ET> &a45,
const Lazy_exact_nt<ET> &a50,
const Lazy_exact_nt<ET> &a51,
const Lazy_exact_nt<ET> &a52,
const Lazy_exact_nt<ET> &a53,
const Lazy_exact_nt<ET> &a54,
const Lazy_exact_nt<ET> &a55)
{
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("Lazy IA sign_of_determinant6x6 calls");
++calls;
#endif
Protect_FPU_rounding<false> 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<true> 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

View File

@ -294,7 +294,10 @@ public :
Self operator/ (const Self & a) const
{ return new Lazy_exact_Div<ET>(*this, a); }
Interval_nt<true> approx() const // throw() ?
Interval_nt<true> approx() const
{ return ptr()->approx(); }
Interval_nt<false> interval() const
{ return ptr()->approx(); }
Interval_nt_advanced approx_adv() const

View File

@ -112,7 +112,11 @@ sub print_CGAL_header {
#ifndef $new_protect_name
#define $new_protect_name
#include <CGAL/Profile_counter.h>\n\n";
#include <CGAL/Profile_counter.h>
CGAL_BEGIN_NAMESPACE
template <class ET> 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 <CGAL_IA_CT, CGAL_IA_ET, ${CGAL}Dynamic,"
." CGAL_IA_PROTECTED, CGAL_IA_CACHE>";
my $type2 = "const ${CGAL}Lazy_exact_nt<ET>";
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<!CGAL_IA_PROTECTED> 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<false> 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<true> Protection(CGAL_FE_TONEAREST);
return $fct_name($args_exact);
}
}
#endif\n\n";
}
# Print static infos

View File

@ -8,6 +8,8 @@
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Filtered_exact.h> // To bring in the overloaded predicates
// for Lazy_exact_nt
#ifdef CGAL_USE_LEDA
# include <CGAL/leda_real.h>