- Remove the static adaptative filters generation from the

scripts/filtered_predicate_generator.pl (option -s to activate them again).
This commit is contained in:
Sylvain Pion 2002-01-28 17:34:20 +00:00
parent 12dbdb8ab3
commit 84a80a14a7
10 changed files with 25 additions and 13682 deletions

View File

@ -1,6 +1,8 @@
Version 4.129 on 28 January 2002
- Fix bug reported by Tamal : Static_filters<>'s functors copy ctors and
assignment operators were empty, while they should copy the data members.
- Remove the static adaptative filters generation from the
scripts/filtered_predicate_generator.pl (option -s to activate them again).
Version 4.128 on 10 January 2002
- std::abort -> CGAL_CLIB_STD::abort().

View File

@ -94,287 +94,6 @@ power_testC2(
}
}
#ifdef CGAL_IA_NEW_FILTERS
struct Static_Filtered_power_testC2_12
{
static double _bound;
static double _epsilon_0;
static Oriented_side update_epsilon(
const Static_filter_error &px,
const Static_filter_error &py,
const Static_filter_error &pwt,
const Static_filter_error &qx,
const Static_filter_error &qy,
const Static_filter_error &qwt,
const Static_filter_error &rx,
const Static_filter_error &ry,
const Static_filter_error &rwt,
const Static_filter_error &tx,
const Static_filter_error &ty,
const Static_filter_error &twt,
double & epsilon_0)
{
typedef Static_filter_error FT;
FT dpx = px - tx;
FT dpy = py - ty;
FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) - pwt + twt;
FT dqx = qx - tx;
FT dqy = qy - ty;
FT dqz = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) - qwt + twt;
FT drx = rx - tx;
FT dry = ry - ty;
FT drz = CGAL_NTS square(drx) + CGAL_NTS square(dry) - rwt + twt;
return Oriented_side(Static_Filtered_sign_of_determinant3x3_9::update_epsilon(dpx, dpy, dpz,
dqx, dqy, dqz,
drx, dry, drz,
epsilon_0));
}
// Call this function from the outside to update the context.
static void new_bound (const double b) // , const double error = 0)
{
_bound = b;
// recompute the epsilons: "just" call it over Static_filter_error.
// That's the tricky part that might not work for everything.
(void) update_epsilon(b,b,b,b,b,b,b,b,b,b,b,b,_epsilon_0);
// TODO: We should verify that all epsilons have really been updated.
}
static Oriented_side epsilon_variant(
const Restricted_double &px,
const Restricted_double &py,
const Restricted_double &pwt,
const Restricted_double &qx,
const Restricted_double &qy,
const Restricted_double &qwt,
const Restricted_double &rx,
const Restricted_double &ry,
const Restricted_double &rwt,
const Restricted_double &tx,
const Restricted_double &ty,
const Restricted_double &twt,
const double & epsilon_0)
{
typedef Restricted_double FT;
FT dpx = px - tx;
FT dpy = py - ty;
FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) - pwt + twt;
FT dqx = qx - tx;
FT dqy = qy - ty;
FT dqz = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) - qwt + twt;
FT drx = rx - tx;
FT dry = ry - ty;
FT drz = CGAL_NTS square(drx) + CGAL_NTS square(dry) - rwt + twt;
return Oriented_side(Static_Filtered_sign_of_determinant3x3_9::epsilon_variant(dpx, dpy, dpz,
dqx, dqy, dqz,
drx, dry, drz,
epsilon_0));
}
};
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* */
Oriented_side
power_testC2(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &px,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &py,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &pwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &rx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &ry,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &rwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &tx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &ty,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &twt)
{
// bool re_adjusted = false;
const double SAF_bound = Static_Filtered_power_testC2_12::_bound;
// Check the bounds. All arguments must be <= SAF_bound.
if (
fabs(px.to_double()) > SAF_bound ||
fabs(py.to_double()) > SAF_bound ||
fabs(pwt.to_double()) > SAF_bound ||
fabs(qx.to_double()) > SAF_bound ||
fabs(qy.to_double()) > SAF_bound ||
fabs(qwt.to_double()) > SAF_bound ||
fabs(rx.to_double()) > SAF_bound ||
fabs(ry.to_double()) > SAF_bound ||
fabs(rwt.to_double()) > SAF_bound ||
fabs(tx.to_double()) > SAF_bound ||
fabs(ty.to_double()) > SAF_bound ||
fabs(twt.to_double()) > SAF_bound)
{
// re_adjust:
// Compute the new bound.
double NEW_bound = 0.0;
NEW_bound = max(NEW_bound, fabs(px.to_double()));
NEW_bound = max(NEW_bound, fabs(py.to_double()));
NEW_bound = max(NEW_bound, fabs(pwt.to_double()));
NEW_bound = max(NEW_bound, fabs(qx.to_double()));
NEW_bound = max(NEW_bound, fabs(qy.to_double()));
NEW_bound = max(NEW_bound, fabs(qwt.to_double()));
NEW_bound = max(NEW_bound, fabs(rx.to_double()));
NEW_bound = max(NEW_bound, fabs(ry.to_double()));
NEW_bound = max(NEW_bound, fabs(rwt.to_double()));
NEW_bound = max(NEW_bound, fabs(tx.to_double()));
NEW_bound = max(NEW_bound, fabs(ty.to_double()));
NEW_bound = max(NEW_bound, fabs(twt.to_double()));
// Re-adjust the context.
#ifdef CGAL_PROFILE
static Profile_counter updates("SA power_testC2 updates");
++updates;
#endif
Static_Filtered_power_testC2_12::new_bound(NEW_bound);
}
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("SA power_testC2 calls");
++calls;
#endif
return Static_Filtered_power_testC2_12::epsilon_variant(
px.dbl(),
py.dbl(),
pwt.dbl(),
qx.dbl(),
qy.dbl(),
qwt.dbl(),
rx.dbl(),
ry.dbl(),
rwt.dbl(),
tx.dbl(),
ty.dbl(),
twt.dbl(),
Static_Filtered_power_testC2_12::_epsilon_0);
}
catch (...)
{
// if (!re_adjusted) { // It failed, we re-adjust once.
// re_adjusted = true;
// goto re_adjust;
// }
#ifdef CGAL_PROFILE
static Profile_counter failures("SA power_testC2 failures");
++failures;
#endif
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());
}
}
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* */
Oriented_side
power_testC2(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &px,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &py,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &pwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &rx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &ry,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &rwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &tx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &ty,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &twt)
{
CGAL_assertion_code(
const double SAF_bound = Static_Filtered_power_testC2_12::_bound; )
CGAL_assertion(!(
fabs(px.to_double()) > SAF_bound ||
fabs(py.to_double()) > SAF_bound ||
fabs(pwt.to_double()) > SAF_bound ||
fabs(qx.to_double()) > SAF_bound ||
fabs(qy.to_double()) > SAF_bound ||
fabs(qwt.to_double()) > SAF_bound ||
fabs(rx.to_double()) > SAF_bound ||
fabs(ry.to_double()) > SAF_bound ||
fabs(rwt.to_double()) > SAF_bound ||
fabs(tx.to_double()) > SAF_bound ||
fabs(ty.to_double()) > SAF_bound ||
fabs(twt.to_double()) > SAF_bound));
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("ST power_testC2 calls");
++calls;
#endif
return Static_Filtered_power_testC2_12::epsilon_variant(
px.dbl(),
py.dbl(),
pwt.dbl(),
qx.dbl(),
qy.dbl(),
qwt.dbl(),
rx.dbl(),
ry.dbl(),
rwt.dbl(),
tx.dbl(),
ty.dbl(),
twt.dbl(),
Static_Filtered_power_testC2_12::_epsilon_0);
}
catch (...)
{
#ifdef CGAL_PROFILE
static Profile_counter failures("ST power_testC2 failures");
++failures;
#endif
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 // CGAL_IA_NEW_FILTERS
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED,
class CGAL_IA_CACHE >
@ -432,272 +151,6 @@ power_testC2(
}
}
#ifdef CGAL_IA_NEW_FILTERS
struct Static_Filtered_power_testC2_9
{
static double _bound;
static double _epsilon_0,_epsilon_1,_epsilon_2,_epsilon_3;
static Oriented_side update_epsilon(
const Static_filter_error &px,
const Static_filter_error &py,
const Static_filter_error &pwt,
const Static_filter_error &qx,
const Static_filter_error &qy,
const Static_filter_error &qwt,
const Static_filter_error &tx,
const Static_filter_error &ty,
const Static_filter_error &twt,
double & epsilon_0,
double & epsilon_1,
double & epsilon_2,
double & epsilon_3)
{
typedef Static_filter_error FT;
FT dpx = px - tx;
FT dpy = py - ty;
FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) - pwt + twt;
FT dqx = qx - tx;
FT dqy = qy - ty;
FT dqz = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) - qwt + twt;
Comparison_result cmpx = CGAL_NTS Static_Filtered_compare_2::update_epsilon(px, qx,
epsilon_0);
if (cmpx != EQUAL)
return Oriented_side(cmpx * Static_Filtered_sign_of_determinant2x2_4::update_epsilon(dpx, dpz, dqx, dqz,
epsilon_1));
Comparison_result cmpy = CGAL_NTS Static_Filtered_compare_2::update_epsilon(py, qy,
epsilon_2);
return Oriented_side(cmpy * Static_Filtered_sign_of_determinant2x2_4::update_epsilon(dpy, dpz, dqy, dqz,
epsilon_3));
}
// Call this function from the outside to update the context.
static void new_bound (const double b) // , const double error = 0)
{
_bound = b;
// recompute the epsilons: "just" call it over Static_filter_error.
// That's the tricky part that might not work for everything.
(void) update_epsilon(b,b,b,b,b,b,b,b,b,_epsilon_0,_epsilon_1,_epsilon_2,_epsilon_3);
// TODO: We should verify that all epsilons have really been updated.
}
static Oriented_side epsilon_variant(
const Restricted_double &px,
const Restricted_double &py,
const Restricted_double &pwt,
const Restricted_double &qx,
const Restricted_double &qy,
const Restricted_double &qwt,
const Restricted_double &tx,
const Restricted_double &ty,
const Restricted_double &twt,
const double & epsilon_0,
const double & epsilon_1,
const double & epsilon_2,
const double & epsilon_3)
{
typedef Restricted_double FT;
FT dpx = px - tx;
FT dpy = py - ty;
FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) - pwt + twt;
FT dqx = qx - tx;
FT dqy = qy - ty;
FT dqz = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) - qwt + twt;
Comparison_result cmpx = CGAL_NTS Static_Filtered_compare_2::epsilon_variant(px, qx,
epsilon_0);
if (cmpx != EQUAL)
return Oriented_side(cmpx * Static_Filtered_sign_of_determinant2x2_4::epsilon_variant(dpx, dpz, dqx, dqz,
epsilon_1));
Comparison_result cmpy = CGAL_NTS Static_Filtered_compare_2::epsilon_variant(py, qy,
epsilon_2);
return Oriented_side(cmpy * Static_Filtered_sign_of_determinant2x2_4::epsilon_variant(dpy, dpz, dqy, dqz,
epsilon_3));
}
};
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* */
Oriented_side
power_testC2(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &px,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &py,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &pwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &tx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &ty,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &twt)
{
// bool re_adjusted = false;
const double SAF_bound = Static_Filtered_power_testC2_9::_bound;
// Check the bounds. All arguments must be <= SAF_bound.
if (
fabs(px.to_double()) > SAF_bound ||
fabs(py.to_double()) > SAF_bound ||
fabs(pwt.to_double()) > SAF_bound ||
fabs(qx.to_double()) > SAF_bound ||
fabs(qy.to_double()) > SAF_bound ||
fabs(qwt.to_double()) > SAF_bound ||
fabs(tx.to_double()) > SAF_bound ||
fabs(ty.to_double()) > SAF_bound ||
fabs(twt.to_double()) > SAF_bound)
{
// re_adjust:
// Compute the new bound.
double NEW_bound = 0.0;
NEW_bound = max(NEW_bound, fabs(px.to_double()));
NEW_bound = max(NEW_bound, fabs(py.to_double()));
NEW_bound = max(NEW_bound, fabs(pwt.to_double()));
NEW_bound = max(NEW_bound, fabs(qx.to_double()));
NEW_bound = max(NEW_bound, fabs(qy.to_double()));
NEW_bound = max(NEW_bound, fabs(qwt.to_double()));
NEW_bound = max(NEW_bound, fabs(tx.to_double()));
NEW_bound = max(NEW_bound, fabs(ty.to_double()));
NEW_bound = max(NEW_bound, fabs(twt.to_double()));
// Re-adjust the context.
#ifdef CGAL_PROFILE
static Profile_counter updates("SA power_testC2 updates");
++updates;
#endif
Static_Filtered_power_testC2_9::new_bound(NEW_bound);
}
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("SA power_testC2 calls");
++calls;
#endif
return Static_Filtered_power_testC2_9::epsilon_variant(
px.dbl(),
py.dbl(),
pwt.dbl(),
qx.dbl(),
qy.dbl(),
qwt.dbl(),
tx.dbl(),
ty.dbl(),
twt.dbl(),
Static_Filtered_power_testC2_9::_epsilon_0,
Static_Filtered_power_testC2_9::_epsilon_1,
Static_Filtered_power_testC2_9::_epsilon_2,
Static_Filtered_power_testC2_9::_epsilon_3);
}
catch (...)
{
// if (!re_adjusted) { // It failed, we re-adjust once.
// re_adjusted = true;
// goto re_adjust;
// }
#ifdef CGAL_PROFILE
static Profile_counter failures("SA power_testC2 failures");
++failures;
#endif
return power_testC2(
px.exact(),
py.exact(),
pwt.exact(),
qx.exact(),
qy.exact(),
qwt.exact(),
tx.exact(),
ty.exact(),
twt.exact());
}
}
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* */
Oriented_side
power_testC2(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &px,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &py,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &pwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &tx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &ty,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &twt)
{
CGAL_assertion_code(
const double SAF_bound = Static_Filtered_power_testC2_9::_bound; )
CGAL_assertion(!(
fabs(px.to_double()) > SAF_bound ||
fabs(py.to_double()) > SAF_bound ||
fabs(pwt.to_double()) > SAF_bound ||
fabs(qx.to_double()) > SAF_bound ||
fabs(qy.to_double()) > SAF_bound ||
fabs(qwt.to_double()) > SAF_bound ||
fabs(tx.to_double()) > SAF_bound ||
fabs(ty.to_double()) > SAF_bound ||
fabs(twt.to_double()) > SAF_bound));
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("ST power_testC2 calls");
++calls;
#endif
return Static_Filtered_power_testC2_9::epsilon_variant(
px.dbl(),
py.dbl(),
pwt.dbl(),
qx.dbl(),
qy.dbl(),
qwt.dbl(),
tx.dbl(),
ty.dbl(),
twt.dbl(),
Static_Filtered_power_testC2_9::_epsilon_0,
Static_Filtered_power_testC2_9::_epsilon_1,
Static_Filtered_power_testC2_9::_epsilon_2,
Static_Filtered_power_testC2_9::_epsilon_3);
}
catch (...)
{
#ifdef CGAL_PROFILE
static Profile_counter failures("ST power_testC2 failures");
++failures;
#endif
return power_testC2(
px.exact(),
py.exact(),
pwt.exact(),
qx.exact(),
qy.exact(),
qwt.exact(),
tx.exact(),
ty.exact(),
twt.exact());
}
}
#endif // CGAL_IA_NEW_FILTERS
CGAL_END_NAMESPACE
#endif // CGAL_ARITHMETIC_FILTER_REGULAR_TRIANGULATION_FTC2_H

View File

@ -106,347 +106,6 @@ power_testH2(
}
}
#ifdef CGAL_IA_NEW_FILTERS
struct Static_Filtered_power_testH2_16
{
static double _bound;
static double _epsilon_0;
static Oriented_side update_epsilon(
const Static_filter_error &phx,
const Static_filter_error &phy,
const Static_filter_error &phw,
const Static_filter_error &pwt,
const Static_filter_error &qhx,
const Static_filter_error &qhy,
const Static_filter_error &qhw,
const Static_filter_error &qwt,
const Static_filter_error &rhx,
const Static_filter_error &rhy,
const Static_filter_error &rhw,
const Static_filter_error &rwt,
const Static_filter_error &thx,
const Static_filter_error &thy,
const Static_filter_error &thw,
const Static_filter_error &twt,
double & epsilon_0)
{
typedef Static_filter_error RT;
RT dphx = phx*phw;
RT dphy = phy*phw;
RT dphw = CGAL_NTS square(phw);
RT dpz = CGAL_NTS square(phx) + CGAL_NTS square(phy) - pwt*dphw;
RT dqhx = qhx*qhw;
RT dqhy = qhy*qhw;
RT dqhw = CGAL_NTS square(qhw);
RT dqz = CGAL_NTS square(qhx) + CGAL_NTS square(qhy) - qwt*dqhw;
RT drhx = rhx*rhw;
RT drhy = rhy*rhw;
RT drhw = CGAL_NTS square(rhw);
RT drz = CGAL_NTS square(rhx) + CGAL_NTS square(rhy) - rwt*drhw;
RT dthx = thx*thw;
RT dthy = thy*thw;
RT dthw = CGAL_NTS square(thw);
RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) - twt*dthw;
return Oriented_side(Static_Filtered_sign_of_determinant4x4_16::update_epsilon(dphx, dphy, dpz, dphw,
dqhx, dqhy, dqz, dqhw,
drhx, drhy, drz, drhw,
dthx, dthy, dtz, dthw,
epsilon_0));
}
// Call this function from the outside to update the context.
static void new_bound (const double b) // , const double error = 0)
{
_bound = b;
// recompute the epsilons: "just" call it over Static_filter_error.
// That's the tricky part that might not work for everything.
(void) update_epsilon(b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,_epsilon_0);
// TODO: We should verify that all epsilons have really been updated.
}
static Oriented_side epsilon_variant(
const Restricted_double &phx,
const Restricted_double &phy,
const Restricted_double &phw,
const Restricted_double &pwt,
const Restricted_double &qhx,
const Restricted_double &qhy,
const Restricted_double &qhw,
const Restricted_double &qwt,
const Restricted_double &rhx,
const Restricted_double &rhy,
const Restricted_double &rhw,
const Restricted_double &rwt,
const Restricted_double &thx,
const Restricted_double &thy,
const Restricted_double &thw,
const Restricted_double &twt,
const double & epsilon_0)
{
typedef Restricted_double RT;
RT dphx = phx*phw;
RT dphy = phy*phw;
RT dphw = CGAL_NTS square(phw);
RT dpz = CGAL_NTS square(phx) + CGAL_NTS square(phy) - pwt*dphw;
RT dqhx = qhx*qhw;
RT dqhy = qhy*qhw;
RT dqhw = CGAL_NTS square(qhw);
RT dqz = CGAL_NTS square(qhx) + CGAL_NTS square(qhy) - qwt*dqhw;
RT drhx = rhx*rhw;
RT drhy = rhy*rhw;
RT drhw = CGAL_NTS square(rhw);
RT drz = CGAL_NTS square(rhx) + CGAL_NTS square(rhy) - rwt*drhw;
RT dthx = thx*thw;
RT dthy = thy*thw;
RT dthw = CGAL_NTS square(thw);
RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) - twt*dthw;
return Oriented_side(Static_Filtered_sign_of_determinant4x4_16::epsilon_variant(dphx, dphy, dpz, dphw,
dqhx, dqhy, dqz, dqhw,
drhx, drhy, drz, drhw,
dthx, dthy, dtz, dthw,
epsilon_0));
}
};
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* */
Oriented_side
power_testH2(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &phx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &phy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &phw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &pwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qhx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qhy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qhw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &rhx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &rhy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &rhw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &rwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &thx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &thy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &thw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &twt)
{
// bool re_adjusted = false;
const double SAF_bound = Static_Filtered_power_testH2_16::_bound;
// Check the bounds. All arguments must be <= SAF_bound.
if (
fabs(phx.to_double()) > SAF_bound ||
fabs(phy.to_double()) > SAF_bound ||
fabs(phw.to_double()) > SAF_bound ||
fabs(pwt.to_double()) > SAF_bound ||
fabs(qhx.to_double()) > SAF_bound ||
fabs(qhy.to_double()) > SAF_bound ||
fabs(qhw.to_double()) > SAF_bound ||
fabs(qwt.to_double()) > SAF_bound ||
fabs(rhx.to_double()) > SAF_bound ||
fabs(rhy.to_double()) > SAF_bound ||
fabs(rhw.to_double()) > SAF_bound ||
fabs(rwt.to_double()) > SAF_bound ||
fabs(thx.to_double()) > SAF_bound ||
fabs(thy.to_double()) > SAF_bound ||
fabs(thw.to_double()) > SAF_bound ||
fabs(twt.to_double()) > SAF_bound)
{
// re_adjust:
// Compute the new bound.
double NEW_bound = 0.0;
NEW_bound = max(NEW_bound, fabs(phx.to_double()));
NEW_bound = max(NEW_bound, fabs(phy.to_double()));
NEW_bound = max(NEW_bound, fabs(phw.to_double()));
NEW_bound = max(NEW_bound, fabs(pwt.to_double()));
NEW_bound = max(NEW_bound, fabs(qhx.to_double()));
NEW_bound = max(NEW_bound, fabs(qhy.to_double()));
NEW_bound = max(NEW_bound, fabs(qhw.to_double()));
NEW_bound = max(NEW_bound, fabs(qwt.to_double()));
NEW_bound = max(NEW_bound, fabs(rhx.to_double()));
NEW_bound = max(NEW_bound, fabs(rhy.to_double()));
NEW_bound = max(NEW_bound, fabs(rhw.to_double()));
NEW_bound = max(NEW_bound, fabs(rwt.to_double()));
NEW_bound = max(NEW_bound, fabs(thx.to_double()));
NEW_bound = max(NEW_bound, fabs(thy.to_double()));
NEW_bound = max(NEW_bound, fabs(thw.to_double()));
NEW_bound = max(NEW_bound, fabs(twt.to_double()));
// Re-adjust the context.
#ifdef CGAL_PROFILE
static Profile_counter updates("SA power_testH2 updates");
++updates;
#endif
Static_Filtered_power_testH2_16::new_bound(NEW_bound);
}
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("SA power_testH2 calls");
++calls;
#endif
return Static_Filtered_power_testH2_16::epsilon_variant(
phx.dbl(),
phy.dbl(),
phw.dbl(),
pwt.dbl(),
qhx.dbl(),
qhy.dbl(),
qhw.dbl(),
qwt.dbl(),
rhx.dbl(),
rhy.dbl(),
rhw.dbl(),
rwt.dbl(),
thx.dbl(),
thy.dbl(),
thw.dbl(),
twt.dbl(),
Static_Filtered_power_testH2_16::_epsilon_0);
}
catch (...)
{
// if (!re_adjusted) { // It failed, we re-adjust once.
// re_adjusted = true;
// goto re_adjust;
// }
#ifdef CGAL_PROFILE
static Profile_counter failures("SA power_testH2 failures");
++failures;
#endif
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());
}
}
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* */
Oriented_side
power_testH2(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &phx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &phy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &phw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &pwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qhx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qhy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qhw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &rhx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &rhy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &rhw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &rwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &thx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &thy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &thw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &twt)
{
CGAL_assertion_code(
const double SAF_bound = Static_Filtered_power_testH2_16::_bound; )
CGAL_assertion(!(
fabs(phx.to_double()) > SAF_bound ||
fabs(phy.to_double()) > SAF_bound ||
fabs(phw.to_double()) > SAF_bound ||
fabs(pwt.to_double()) > SAF_bound ||
fabs(qhx.to_double()) > SAF_bound ||
fabs(qhy.to_double()) > SAF_bound ||
fabs(qhw.to_double()) > SAF_bound ||
fabs(qwt.to_double()) > SAF_bound ||
fabs(rhx.to_double()) > SAF_bound ||
fabs(rhy.to_double()) > SAF_bound ||
fabs(rhw.to_double()) > SAF_bound ||
fabs(rwt.to_double()) > SAF_bound ||
fabs(thx.to_double()) > SAF_bound ||
fabs(thy.to_double()) > SAF_bound ||
fabs(thw.to_double()) > SAF_bound ||
fabs(twt.to_double()) > SAF_bound));
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("ST power_testH2 calls");
++calls;
#endif
return Static_Filtered_power_testH2_16::epsilon_variant(
phx.dbl(),
phy.dbl(),
phw.dbl(),
pwt.dbl(),
qhx.dbl(),
qhy.dbl(),
qhw.dbl(),
qwt.dbl(),
rhx.dbl(),
rhy.dbl(),
rhw.dbl(),
rwt.dbl(),
thx.dbl(),
thy.dbl(),
thw.dbl(),
twt.dbl(),
Static_Filtered_power_testH2_16::_epsilon_0);
}
catch (...)
{
#ifdef CGAL_PROFILE
static Profile_counter failures("ST power_testH2 failures");
++failures;
#endif
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 // CGAL_IA_NEW_FILTERS
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, bool CGAL_IA_PROTECTED,
class CGAL_IA_CACHE >
@ -513,321 +172,6 @@ power_testH2(
}
}
#ifdef CGAL_IA_NEW_FILTERS
struct Static_Filtered_power_testH2_12
{
static double _bound;
static double _epsilon_0,_epsilon_1;
static Oriented_side update_epsilon(
const Static_filter_error &phx,
const Static_filter_error &phy,
const Static_filter_error &phw,
const Static_filter_error &pwt,
const Static_filter_error &qhx,
const Static_filter_error &qhy,
const Static_filter_error &qhw,
const Static_filter_error &qwt,
const Static_filter_error &thx,
const Static_filter_error &thy,
const Static_filter_error &thw,
const Static_filter_error &twt,
double & epsilon_0,
double & epsilon_1)
{
typedef Static_filter_error RT;
RT pa, qa, ta;
if (phx * qhw != qhx * phw )
{
pa = phx*phw;
qa = qhx*qhw;
ta = thx*thw;
}
else
{
pa = phy*phw;
qa = qhy*qhw;
ta = thy*thw;
}
RT dphw = CGAL_NTS square(phw);
RT dpz = CGAL_NTS square(phx) + CGAL_NTS square(phy) - pwt*dphw;
RT dqhw = CGAL_NTS square(qhw);
RT dqz = CGAL_NTS square(qhx) + CGAL_NTS square(qhy) - qwt*dqhw;
RT dthw = CGAL_NTS square(thw);
RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) - twt*dthw;
return Oriented_side(CGAL_NTS Static_Filtered_compare_2::update_epsilon(pa, qa,
epsilon_0) *
Static_Filtered_sign_of_determinant3x3_9::update_epsilon(pa, dpz, dphw,
qa, dqz, dqhw,
ta, dtz, dthw,
epsilon_1));
}
// Call this function from the outside to update the context.
static void new_bound (const double b) // , const double error = 0)
{
_bound = b;
// recompute the epsilons: "just" call it over Static_filter_error.
// That's the tricky part that might not work for everything.
(void) update_epsilon(b,b,b,b,b,b,b,b,b,b,b,b,_epsilon_0,_epsilon_1);
// TODO: We should verify that all epsilons have really been updated.
}
static Oriented_side epsilon_variant(
const Restricted_double &phx,
const Restricted_double &phy,
const Restricted_double &phw,
const Restricted_double &pwt,
const Restricted_double &qhx,
const Restricted_double &qhy,
const Restricted_double &qhw,
const Restricted_double &qwt,
const Restricted_double &thx,
const Restricted_double &thy,
const Restricted_double &thw,
const Restricted_double &twt,
const double & epsilon_0,
const double & epsilon_1)
{
typedef Restricted_double RT;
RT pa, qa, ta;
if (phx * qhw != qhx * phw )
{
pa = phx*phw;
qa = qhx*qhw;
ta = thx*thw;
}
else
{
pa = phy*phw;
qa = qhy*qhw;
ta = thy*thw;
}
RT dphw = CGAL_NTS square(phw);
RT dpz = CGAL_NTS square(phx) + CGAL_NTS square(phy) - pwt*dphw;
RT dqhw = CGAL_NTS square(qhw);
RT dqz = CGAL_NTS square(qhx) + CGAL_NTS square(qhy) - qwt*dqhw;
RT dthw = CGAL_NTS square(thw);
RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) - twt*dthw;
return Oriented_side(CGAL_NTS Static_Filtered_compare_2::epsilon_variant(pa, qa,
epsilon_0) *
Static_Filtered_sign_of_determinant3x3_9::epsilon_variant(pa, dpz, dphw,
qa, dqz, dqhw,
ta, dtz, dthw,
epsilon_1));
}
};
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* */
Oriented_side
power_testH2(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &phx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &phy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &phw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &pwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qhx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qhy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qhw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &thx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &thy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &thw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &twt)
{
// bool re_adjusted = false;
const double SAF_bound = Static_Filtered_power_testH2_12::_bound;
// Check the bounds. All arguments must be <= SAF_bound.
if (
fabs(phx.to_double()) > SAF_bound ||
fabs(phy.to_double()) > SAF_bound ||
fabs(phw.to_double()) > SAF_bound ||
fabs(pwt.to_double()) > SAF_bound ||
fabs(qhx.to_double()) > SAF_bound ||
fabs(qhy.to_double()) > SAF_bound ||
fabs(qhw.to_double()) > SAF_bound ||
fabs(qwt.to_double()) > SAF_bound ||
fabs(thx.to_double()) > SAF_bound ||
fabs(thy.to_double()) > SAF_bound ||
fabs(thw.to_double()) > SAF_bound ||
fabs(twt.to_double()) > SAF_bound)
{
// re_adjust:
// Compute the new bound.
double NEW_bound = 0.0;
NEW_bound = max(NEW_bound, fabs(phx.to_double()));
NEW_bound = max(NEW_bound, fabs(phy.to_double()));
NEW_bound = max(NEW_bound, fabs(phw.to_double()));
NEW_bound = max(NEW_bound, fabs(pwt.to_double()));
NEW_bound = max(NEW_bound, fabs(qhx.to_double()));
NEW_bound = max(NEW_bound, fabs(qhy.to_double()));
NEW_bound = max(NEW_bound, fabs(qhw.to_double()));
NEW_bound = max(NEW_bound, fabs(qwt.to_double()));
NEW_bound = max(NEW_bound, fabs(thx.to_double()));
NEW_bound = max(NEW_bound, fabs(thy.to_double()));
NEW_bound = max(NEW_bound, fabs(thw.to_double()));
NEW_bound = max(NEW_bound, fabs(twt.to_double()));
// Re-adjust the context.
#ifdef CGAL_PROFILE
static Profile_counter updates("SA power_testH2 updates");
++updates;
#endif
Static_Filtered_power_testH2_12::new_bound(NEW_bound);
}
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("SA power_testH2 calls");
++calls;
#endif
return Static_Filtered_power_testH2_12::epsilon_variant(
phx.dbl(),
phy.dbl(),
phw.dbl(),
pwt.dbl(),
qhx.dbl(),
qhy.dbl(),
qhw.dbl(),
qwt.dbl(),
thx.dbl(),
thy.dbl(),
thw.dbl(),
twt.dbl(),
Static_Filtered_power_testH2_12::_epsilon_0,
Static_Filtered_power_testH2_12::_epsilon_1);
}
catch (...)
{
// if (!re_adjusted) { // It failed, we re-adjust once.
// re_adjusted = true;
// goto re_adjust;
// }
#ifdef CGAL_PROFILE
static Profile_counter failures("SA power_testH2 failures");
++failures;
#endif
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());
}
}
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* */
Oriented_side
power_testH2(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &phx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &phy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &phw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &pwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qhx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qhy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qhw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &thx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &thy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &thw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &twt)
{
CGAL_assertion_code(
const double SAF_bound = Static_Filtered_power_testH2_12::_bound; )
CGAL_assertion(!(
fabs(phx.to_double()) > SAF_bound ||
fabs(phy.to_double()) > SAF_bound ||
fabs(phw.to_double()) > SAF_bound ||
fabs(pwt.to_double()) > SAF_bound ||
fabs(qhx.to_double()) > SAF_bound ||
fabs(qhy.to_double()) > SAF_bound ||
fabs(qhw.to_double()) > SAF_bound ||
fabs(qwt.to_double()) > SAF_bound ||
fabs(thx.to_double()) > SAF_bound ||
fabs(thy.to_double()) > SAF_bound ||
fabs(thw.to_double()) > SAF_bound ||
fabs(twt.to_double()) > SAF_bound));
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("ST power_testH2 calls");
++calls;
#endif
return Static_Filtered_power_testH2_12::epsilon_variant(
phx.dbl(),
phy.dbl(),
phw.dbl(),
pwt.dbl(),
qhx.dbl(),
qhy.dbl(),
qhw.dbl(),
qwt.dbl(),
thx.dbl(),
thy.dbl(),
thw.dbl(),
twt.dbl(),
Static_Filtered_power_testH2_12::_epsilon_0,
Static_Filtered_power_testH2_12::_epsilon_1);
}
catch (...)
{
#ifdef CGAL_PROFILE
static Profile_counter failures("ST power_testH2 failures");
++failures;
#endif
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_IA_NEW_FILTERS
CGAL_END_NAMESPACE
#endif // CGAL_ARITHMETIC_FILTER_REGULAR_TRIANGULATION_RTH2_H

View File

@ -133,478 +133,6 @@ power_testH3(
}
}
#ifdef CGAL_IA_NEW_FILTERS
struct Static_Filtered_power_testH3_25
{
static double _bound;
static double _epsilon_0;
static Oriented_side update_epsilon(
const Static_filter_error &phx,
const Static_filter_error &phy,
const Static_filter_error &phz,
const Static_filter_error &phw,
const Static_filter_error &pwt,
const Static_filter_error &qhx,
const Static_filter_error &qhy,
const Static_filter_error &qhz,
const Static_filter_error &qhw,
const Static_filter_error &qwt,
const Static_filter_error &rhx,
const Static_filter_error &rhy,
const Static_filter_error &rhz,
const Static_filter_error &rhw,
const Static_filter_error &rwt,
const Static_filter_error &shx,
const Static_filter_error &shy,
const Static_filter_error &shz,
const Static_filter_error &shw,
const Static_filter_error &swt,
const Static_filter_error &thx,
const Static_filter_error &thy,
const Static_filter_error &thz,
const Static_filter_error &thw,
const Static_filter_error &twt,
double & epsilon_0)
{
typedef Static_filter_error RT;
RT dphx = phx*phw;
RT dphy = phy*phw;
RT dphz = phz*phw;
RT dphw = CGAL_NTS square(phw);
RT dpz = CGAL_NTS square(phx) + CGAL_NTS square(phy) +
CGAL_NTS square(phz) - pwt*dphw;
RT dqhx = qhx*qhw;
RT dqhy = qhy*qhw;
RT dqhz = qhz*qhw;
RT dqhw = CGAL_NTS square(qhw);
RT dqz = CGAL_NTS square(qhx) + CGAL_NTS square(qhy) +
CGAL_NTS square(qhz) - qwt*dqhw;
RT drhx = rhx*rhw;
RT drhy = rhy*rhw;
RT drhz = rhz*rhw;
RT drhw = CGAL_NTS square(rhw);
RT drz = CGAL_NTS square(rhx) + CGAL_NTS square(rhy) +
CGAL_NTS square(rhz) - rwt*drhw;
RT dshx = shx*shw;
RT dshy = shy*shw;
RT dshz = shz*shw;
RT dshw = CGAL_NTS square(shw);
RT dsz = CGAL_NTS square(shx) + CGAL_NTS square(shy) +
CGAL_NTS square(shz) - swt*dshw;
RT dthx = thx*thw;
RT dthy = thy*thw;
RT dthz = thz*thw;
RT dthw = CGAL_NTS square(thw);
RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) +
CGAL_NTS square(thz) - twt*dthw;
return Oriented_side(- Static_Filtered_sign_of_determinant5x5_25::update_epsilon(dphx, dphy, dphz, dpz, dphw,
dqhx, dqhy, dqhz, dqz, dqhw,
drhx, drhy, drhz, drz, drhw,
dshx, dshy, dshz, dsz, dshw,
dthx, dthy, dthz, dtz, dthw,
epsilon_0));
}
// Call this function from the outside to update the context.
static void new_bound (const double b) // , const double error = 0)
{
_bound = b;
// recompute the epsilons: "just" call it over Static_filter_error.
// That's the tricky part that might not work for everything.
(void) update_epsilon(b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,_epsilon_0);
// TODO: We should verify that all epsilons have really been updated.
}
static Oriented_side epsilon_variant(
const Restricted_double &phx,
const Restricted_double &phy,
const Restricted_double &phz,
const Restricted_double &phw,
const Restricted_double &pwt,
const Restricted_double &qhx,
const Restricted_double &qhy,
const Restricted_double &qhz,
const Restricted_double &qhw,
const Restricted_double &qwt,
const Restricted_double &rhx,
const Restricted_double &rhy,
const Restricted_double &rhz,
const Restricted_double &rhw,
const Restricted_double &rwt,
const Restricted_double &shx,
const Restricted_double &shy,
const Restricted_double &shz,
const Restricted_double &shw,
const Restricted_double &swt,
const Restricted_double &thx,
const Restricted_double &thy,
const Restricted_double &thz,
const Restricted_double &thw,
const Restricted_double &twt,
const double & epsilon_0)
{
typedef Restricted_double RT;
RT dphx = phx*phw;
RT dphy = phy*phw;
RT dphz = phz*phw;
RT dphw = CGAL_NTS square(phw);
RT dpz = CGAL_NTS square(phx) + CGAL_NTS square(phy) +
CGAL_NTS square(phz) - pwt*dphw;
RT dqhx = qhx*qhw;
RT dqhy = qhy*qhw;
RT dqhz = qhz*qhw;
RT dqhw = CGAL_NTS square(qhw);
RT dqz = CGAL_NTS square(qhx) + CGAL_NTS square(qhy) +
CGAL_NTS square(qhz) - qwt*dqhw;
RT drhx = rhx*rhw;
RT drhy = rhy*rhw;
RT drhz = rhz*rhw;
RT drhw = CGAL_NTS square(rhw);
RT drz = CGAL_NTS square(rhx) + CGAL_NTS square(rhy) +
CGAL_NTS square(rhz) - rwt*drhw;
RT dshx = shx*shw;
RT dshy = shy*shw;
RT dshz = shz*shw;
RT dshw = CGAL_NTS square(shw);
RT dsz = CGAL_NTS square(shx) + CGAL_NTS square(shy) +
CGAL_NTS square(shz) - swt*dshw;
RT dthx = thx*thw;
RT dthy = thy*thw;
RT dthz = thz*thw;
RT dthw = CGAL_NTS square(thw);
RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) +
CGAL_NTS square(thz) - twt*dthw;
return Oriented_side(- Static_Filtered_sign_of_determinant5x5_25::epsilon_variant(dphx, dphy, dphz, dpz, dphw,
dqhx, dqhy, dqhz, dqz, dqhw,
drhx, drhy, drhz, drz, drhw,
dshx, dshy, dshz, dsz, dshw,
dthx, dthy, dthz, dtz, dthw,
epsilon_0));
}
};
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* */
Oriented_side
power_testH3(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &phx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &phy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &phz,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &phw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &pwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qhx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qhy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qhz,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qhw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &rhx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &rhy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &rhz,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &rhw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &rwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &shx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &shy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &shz,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &shw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &swt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &thx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &thy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &thz,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &thw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &twt)
{
// bool re_adjusted = false;
const double SAF_bound = Static_Filtered_power_testH3_25::_bound;
// Check the bounds. All arguments must be <= SAF_bound.
if (
fabs(phx.to_double()) > SAF_bound ||
fabs(phy.to_double()) > SAF_bound ||
fabs(phz.to_double()) > SAF_bound ||
fabs(phw.to_double()) > SAF_bound ||
fabs(pwt.to_double()) > SAF_bound ||
fabs(qhx.to_double()) > SAF_bound ||
fabs(qhy.to_double()) > SAF_bound ||
fabs(qhz.to_double()) > SAF_bound ||
fabs(qhw.to_double()) > SAF_bound ||
fabs(qwt.to_double()) > SAF_bound ||
fabs(rhx.to_double()) > SAF_bound ||
fabs(rhy.to_double()) > SAF_bound ||
fabs(rhz.to_double()) > SAF_bound ||
fabs(rhw.to_double()) > SAF_bound ||
fabs(rwt.to_double()) > SAF_bound ||
fabs(shx.to_double()) > SAF_bound ||
fabs(shy.to_double()) > SAF_bound ||
fabs(shz.to_double()) > SAF_bound ||
fabs(shw.to_double()) > SAF_bound ||
fabs(swt.to_double()) > SAF_bound ||
fabs(thx.to_double()) > SAF_bound ||
fabs(thy.to_double()) > SAF_bound ||
fabs(thz.to_double()) > SAF_bound ||
fabs(thw.to_double()) > SAF_bound ||
fabs(twt.to_double()) > SAF_bound)
{
// re_adjust:
// Compute the new bound.
double NEW_bound = 0.0;
NEW_bound = max(NEW_bound, fabs(phx.to_double()));
NEW_bound = max(NEW_bound, fabs(phy.to_double()));
NEW_bound = max(NEW_bound, fabs(phz.to_double()));
NEW_bound = max(NEW_bound, fabs(phw.to_double()));
NEW_bound = max(NEW_bound, fabs(pwt.to_double()));
NEW_bound = max(NEW_bound, fabs(qhx.to_double()));
NEW_bound = max(NEW_bound, fabs(qhy.to_double()));
NEW_bound = max(NEW_bound, fabs(qhz.to_double()));
NEW_bound = max(NEW_bound, fabs(qhw.to_double()));
NEW_bound = max(NEW_bound, fabs(qwt.to_double()));
NEW_bound = max(NEW_bound, fabs(rhx.to_double()));
NEW_bound = max(NEW_bound, fabs(rhy.to_double()));
NEW_bound = max(NEW_bound, fabs(rhz.to_double()));
NEW_bound = max(NEW_bound, fabs(rhw.to_double()));
NEW_bound = max(NEW_bound, fabs(rwt.to_double()));
NEW_bound = max(NEW_bound, fabs(shx.to_double()));
NEW_bound = max(NEW_bound, fabs(shy.to_double()));
NEW_bound = max(NEW_bound, fabs(shz.to_double()));
NEW_bound = max(NEW_bound, fabs(shw.to_double()));
NEW_bound = max(NEW_bound, fabs(swt.to_double()));
NEW_bound = max(NEW_bound, fabs(thx.to_double()));
NEW_bound = max(NEW_bound, fabs(thy.to_double()));
NEW_bound = max(NEW_bound, fabs(thz.to_double()));
NEW_bound = max(NEW_bound, fabs(thw.to_double()));
NEW_bound = max(NEW_bound, fabs(twt.to_double()));
// Re-adjust the context.
#ifdef CGAL_PROFILE
static Profile_counter updates("SA power_testH3 updates");
++updates;
#endif
Static_Filtered_power_testH3_25::new_bound(NEW_bound);
}
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("SA power_testH3 calls");
++calls;
#endif
return Static_Filtered_power_testH3_25::epsilon_variant(
phx.dbl(),
phy.dbl(),
phz.dbl(),
phw.dbl(),
pwt.dbl(),
qhx.dbl(),
qhy.dbl(),
qhz.dbl(),
qhw.dbl(),
qwt.dbl(),
rhx.dbl(),
rhy.dbl(),
rhz.dbl(),
rhw.dbl(),
rwt.dbl(),
shx.dbl(),
shy.dbl(),
shz.dbl(),
shw.dbl(),
swt.dbl(),
thx.dbl(),
thy.dbl(),
thz.dbl(),
thw.dbl(),
twt.dbl(),
Static_Filtered_power_testH3_25::_epsilon_0);
}
catch (...)
{
// if (!re_adjusted) { // It failed, we re-adjust once.
// re_adjusted = true;
// goto re_adjust;
// }
#ifdef CGAL_PROFILE
static Profile_counter failures("SA power_testH3 failures");
++failures;
#endif
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());
}
}
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* */
Oriented_side
power_testH3(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &phx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &phy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &phz,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &phw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &pwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qhx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qhy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qhz,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qhw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &rhx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &rhy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &rhz,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &rhw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &rwt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &shx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &shy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &shz,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &shw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &swt,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &thx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &thy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &thz,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &thw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &twt)
{
CGAL_assertion_code(
const double SAF_bound = Static_Filtered_power_testH3_25::_bound; )
CGAL_assertion(!(
fabs(phx.to_double()) > SAF_bound ||
fabs(phy.to_double()) > SAF_bound ||
fabs(phz.to_double()) > SAF_bound ||
fabs(phw.to_double()) > SAF_bound ||
fabs(pwt.to_double()) > SAF_bound ||
fabs(qhx.to_double()) > SAF_bound ||
fabs(qhy.to_double()) > SAF_bound ||
fabs(qhz.to_double()) > SAF_bound ||
fabs(qhw.to_double()) > SAF_bound ||
fabs(qwt.to_double()) > SAF_bound ||
fabs(rhx.to_double()) > SAF_bound ||
fabs(rhy.to_double()) > SAF_bound ||
fabs(rhz.to_double()) > SAF_bound ||
fabs(rhw.to_double()) > SAF_bound ||
fabs(rwt.to_double()) > SAF_bound ||
fabs(shx.to_double()) > SAF_bound ||
fabs(shy.to_double()) > SAF_bound ||
fabs(shz.to_double()) > SAF_bound ||
fabs(shw.to_double()) > SAF_bound ||
fabs(swt.to_double()) > SAF_bound ||
fabs(thx.to_double()) > SAF_bound ||
fabs(thy.to_double()) > SAF_bound ||
fabs(thz.to_double()) > SAF_bound ||
fabs(thw.to_double()) > SAF_bound ||
fabs(twt.to_double()) > SAF_bound));
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("ST power_testH3 calls");
++calls;
#endif
return Static_Filtered_power_testH3_25::epsilon_variant(
phx.dbl(),
phy.dbl(),
phz.dbl(),
phw.dbl(),
pwt.dbl(),
qhx.dbl(),
qhy.dbl(),
qhz.dbl(),
qhw.dbl(),
qwt.dbl(),
rhx.dbl(),
rhy.dbl(),
rhz.dbl(),
rhw.dbl(),
rwt.dbl(),
shx.dbl(),
shy.dbl(),
shz.dbl(),
shw.dbl(),
swt.dbl(),
thx.dbl(),
thy.dbl(),
thz.dbl(),
thw.dbl(),
twt.dbl(),
Static_Filtered_power_testH3_25::_epsilon_0);
}
catch (...)
{
#ifdef CGAL_PROFILE
static Profile_counter failures("ST power_testH3 failures");
++failures;
#endif
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_IA_NEW_FILTERS
CGAL_END_NAMESPACE
#endif // CGAL_ARITHMETIC_FILTER_REGULAR_TRIANGULATION_RTH3_H

View File

@ -85,240 +85,6 @@ in_smallest_orthogonalcircleC2(
}
}
#ifdef CGAL_IA_NEW_FILTERS
struct Static_Filtered_in_smallest_orthogonalcircleC2_9
{
static double _bound;
static double _epsilon_0;
static Bounded_side update_epsilon(
const Static_filter_error &px,
const Static_filter_error &py,
const Static_filter_error &pw,
const Static_filter_error &qx,
const Static_filter_error &qy,
const Static_filter_error &qw,
const Static_filter_error &tx,
const Static_filter_error &ty,
const Static_filter_error &tw,
double & epsilon_0)
{
typedef Static_filter_error FT;
FT dpx = px-qx;
FT dpy = py-qy;
FT dtx = tx-qx;
FT dty = ty-qy;
FT dpz = CGAL_NTS square(dpx)+CGAL_NTS square(dpy);
return Bounded_side
(CGAL_NTS Static_Filtered_sign_1::update_epsilon(-(CGAL_NTS square(dtx)+CGAL_NTS square(dty)-tw+qw)*dpz
+(dpz-pw+qw)*(dpx*dtx+dpy*dty),
epsilon_0));
}
// Call this function from the outside to update the context.
static void new_bound (const double b) // , const double error = 0)
{
_bound = b;
// recompute the epsilons: "just" call it over Static_filter_error.
// That's the tricky part that might not work for everything.
(void) update_epsilon(b,b,b,b,b,b,b,b,b,_epsilon_0);
// TODO: We should verify that all epsilons have really been updated.
}
static Bounded_side epsilon_variant(
const Restricted_double &px,
const Restricted_double &py,
const Restricted_double &pw,
const Restricted_double &qx,
const Restricted_double &qy,
const Restricted_double &qw,
const Restricted_double &tx,
const Restricted_double &ty,
const Restricted_double &tw,
const double & epsilon_0)
{
typedef Restricted_double FT;
FT dpx = px-qx;
FT dpy = py-qy;
FT dtx = tx-qx;
FT dty = ty-qy;
FT dpz = CGAL_NTS square(dpx)+CGAL_NTS square(dpy);
return Bounded_side
(CGAL_NTS Static_Filtered_sign_1::epsilon_variant(-(CGAL_NTS square(dtx)+CGAL_NTS square(dty)-tw+qw)*dpz
+(dpz-pw+qw)*(dpx*dtx+dpy*dty),
epsilon_0));
}
};
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* CGAL_MEDIUM_INLINE */
Bounded_side
in_smallest_orthogonalcircleC2(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &px,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &py,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &pw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &qw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &tx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &ty,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, true, CGAL_IA_CACHE> &tw)
{
// bool re_adjusted = false;
const double SAF_bound = Static_Filtered_in_smallest_orthogonalcircleC2_9::_bound;
// Check the bounds. All arguments must be <= SAF_bound.
if (
fabs(px.to_double()) > SAF_bound ||
fabs(py.to_double()) > SAF_bound ||
fabs(pw.to_double()) > SAF_bound ||
fabs(qx.to_double()) > SAF_bound ||
fabs(qy.to_double()) > SAF_bound ||
fabs(qw.to_double()) > SAF_bound ||
fabs(tx.to_double()) > SAF_bound ||
fabs(ty.to_double()) > SAF_bound ||
fabs(tw.to_double()) > SAF_bound)
{
// re_adjust:
// Compute the new bound.
double NEW_bound = 0.0;
NEW_bound = max(NEW_bound, fabs(px.to_double()));
NEW_bound = max(NEW_bound, fabs(py.to_double()));
NEW_bound = max(NEW_bound, fabs(pw.to_double()));
NEW_bound = max(NEW_bound, fabs(qx.to_double()));
NEW_bound = max(NEW_bound, fabs(qy.to_double()));
NEW_bound = max(NEW_bound, fabs(qw.to_double()));
NEW_bound = max(NEW_bound, fabs(tx.to_double()));
NEW_bound = max(NEW_bound, fabs(ty.to_double()));
NEW_bound = max(NEW_bound, fabs(tw.to_double()));
// Re-adjust the context.
#ifdef CGAL_PROFILE
static Profile_counter updates("SA in_smallest_orthogonalcircleC2 updates");
++updates;
#endif
Static_Filtered_in_smallest_orthogonalcircleC2_9::new_bound(NEW_bound);
}
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("SA in_smallest_orthogonalcircleC2 calls");
++calls;
#endif
return Static_Filtered_in_smallest_orthogonalcircleC2_9::epsilon_variant(
px.dbl(),
py.dbl(),
pw.dbl(),
qx.dbl(),
qy.dbl(),
qw.dbl(),
tx.dbl(),
ty.dbl(),
tw.dbl(),
Static_Filtered_in_smallest_orthogonalcircleC2_9::_epsilon_0);
}
catch (...)
{
// if (!re_adjusted) { // It failed, we re-adjust once.
// re_adjusted = true;
// goto re_adjust;
// }
#ifdef CGAL_PROFILE
static Profile_counter failures("SA in_smallest_orthogonalcircleC2 failures");
++failures;
#endif
return in_smallest_orthogonalcircleC2(
px.exact(),
py.exact(),
pw.exact(),
qx.exact(),
qy.exact(),
qw.exact(),
tx.exact(),
ty.exact(),
tw.exact());
}
}
#ifndef CGAL_CFG_MATCHING_BUG_2
template < class CGAL_IA_CT, class CGAL_IA_ET, class CGAL_IA_CACHE >
#else
static
#endif
/* CGAL_MEDIUM_INLINE */
Bounded_side
in_smallest_orthogonalcircleC2(
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &px,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &py,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &pw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qy,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &qw,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &tx,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &ty,
const Filtered_exact <CGAL_IA_CT, CGAL_IA_ET, Static, false, CGAL_IA_CACHE> &tw)
{
CGAL_assertion_code(
const double SAF_bound = Static_Filtered_in_smallest_orthogonalcircleC2_9::_bound; )
CGAL_assertion(!(
fabs(px.to_double()) > SAF_bound ||
fabs(py.to_double()) > SAF_bound ||
fabs(pw.to_double()) > SAF_bound ||
fabs(qx.to_double()) > SAF_bound ||
fabs(qy.to_double()) > SAF_bound ||
fabs(qw.to_double()) > SAF_bound ||
fabs(tx.to_double()) > SAF_bound ||
fabs(ty.to_double()) > SAF_bound ||
fabs(tw.to_double()) > SAF_bound));
try
{
#ifdef CGAL_PROFILE
static Profile_counter calls("ST in_smallest_orthogonalcircleC2 calls");
++calls;
#endif
return Static_Filtered_in_smallest_orthogonalcircleC2_9::epsilon_variant(
px.dbl(),
py.dbl(),
pw.dbl(),
qx.dbl(),
qy.dbl(),
qw.dbl(),
tx.dbl(),
ty.dbl(),
tw.dbl(),
Static_Filtered_in_smallest_orthogonalcircleC2_9::_epsilon_0);
}
catch (...)
{
#ifdef CGAL_PROFILE
static Profile_counter failures("ST in_smallest_orthogonalcircleC2 failures");
++failures;
#endif
return in_smallest_orthogonalcircleC2(
px.exact(),
py.exact(),
pw.exact(),
qx.exact(),
qy.exact(),
qw.exact(),
tx.exact(),
ty.exact(),
tw.exact());
}
}
#endif // CGAL_IA_NEW_FILTERS
CGAL_END_NAMESPACE
#endif // CGAL_ARITHMETIC_FILTER_IN_SMALLEST_ORTHOGONALCIRCLE_FTC2_H

View File

@ -16,7 +16,7 @@
# - While parsing, remove CGAL_assertion() and co from the original code.
# - Add assertions about the epsilons being updated.
use vars qw($opt_p $opt_h $opt_d $opt_v $opt_l); # Suppress warnings
use vars qw($opt_p $opt_h $opt_d $opt_v $opt_l $opt_s); # Suppress warnings
require 'getopt.pl';
# Global variables
@ -47,6 +47,7 @@ sub parse_command_line {
warn "Usage: filtered_predicate_converter [options]
-i file : specify the main input source file [default is stdin]
-o file : specify the main output file [default is stdout]
-s : also want the static adaptative filters [default is off]
-l file : indicate the output file that will receive the static part.
-d files : list of dependant predicates file (concatenated with \":\")
by default, only the built-in predicates are known.
@ -63,6 +64,7 @@ sub parse_command_line {
warning("The -l option is compulsory for the static filters.");
}
$pedantic = $opt_p;
$want_statics = $opt_s;
}
# Auxiliary routine to emit a warning and die if pedantic.
@ -367,12 +369,14 @@ sub print_predicates {
print FO "CGAL_BEGIN_NAMESPACE\n\n" if $CGAL eq "" && not $was_in_CGAL;
print FO "CGAL_END_NAMESPACE\n\n" if $CGAL ne "" && $was_in_CGAL;
print_dynamic(@{$predicates[$i]});
print FO "#ifdef CGAL_IA_NEW_FILTERS\n\n";
print_predicate_struct(@{$predicates[$i]});
print_static("true", @{$predicates[$i]});
print_static("false", @{$predicates[$i]});
print FO "#endif // CGAL_IA_NEW_FILTERS\n\n";
print_static_infos(@{$predicates[$i]});
if ($want_statics) {
print FO "#ifdef CGAL_IA_NEW_FILTERS\n\n";
print_predicate_struct(@{$predicates[$i]});
print_static("true", @{$predicates[$i]});
print_static("false", @{$predicates[$i]});
print FO "#endif // CGAL_IA_NEW_FILTERS\n\n";
print_static_infos(@{$predicates[$i]});
}
$was_in_CGAL = $CGAL eq "";
}
print FO "CGAL_END_NAMESPACE\n\n" if $was_in_CGAL;
@ -471,15 +475,23 @@ sub main {
close(FI);
parse_input_code($rest);
open(FO, ">$opt_o") || die "Couldn't open output file \"$opt_o\"\n";
open(FL, ">$opt_l") || die "Couldn't open lib file \"$opt_l\"\n";
if ($want_statics) {
open(FL, ">$opt_l") || die "Couldn't open lib file \"$opt_l\"\n";
}
print_CGAL_header(FO, $new_protect_name, $file_name);
print_CGAL_header(FL, $new_protect_name."_STATIC_INFO_H",
if ($want_statics) {
print_CGAL_header(FL, $new_protect_name."_STATIC_INFO_H",
"static_infos/".$file_name);
}
print_predicates();
print FO "#endif // $new_protect_name\n";
print FL "#endif // $new_protect_name"."_STATIC_INFO_H\n";
if ($want_statics) {
print FL "#endif // $new_protect_name"."_STATIC_INFO_H\n";
}
close(FO);
close(FL);
if ($want_statics) {
close(FL);
}
}
main();