From 66527a142ec7357d1c94443f4064e37dd66f9ced Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Mon, 2 Aug 1999 09:35:09 +0000 Subject: [PATCH] - Added ctor(int). - sqrt -> std::sqrt(). - fixed ulp() declaration. - Added lexicographical_sign_SAF(). --- .../include/CGAL/Static_filter_error.h | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Packages/Interval_arithmetic/include/CGAL/Static_filter_error.h b/Packages/Interval_arithmetic/include/CGAL/Static_filter_error.h index 51f0698e74c..3a478dc8292 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Static_filter_error.h +++ b/Packages/Interval_arithmetic/include/CGAL/Static_filter_error.h @@ -37,10 +37,18 @@ CGAL_BEGIN_NAMESPACE +struct Static_filter_error; +inline Comparison_result compare_SAF(const Static_filter_error &a, + const Static_filter_error &b, double &epsilon); +inline Sign sign_SAF(const Static_filter_error &a, double &epsilon); + struct Static_filter_error { typedef Static_filter_error Sfe; + Static_filter_error (const int &i) + : _b(i), _e(0), _d(1) {} + Static_filter_error (const double &b, const double &e, const int &d) : _b(b), _e(e), _d(d) {} @@ -66,7 +74,7 @@ struct Static_filter_error Sfe operator- (const Sfe &f) const { return *this + f; } Sfe operator- () const { return *this; } - Sfe operator/ (const Sfe &f) const { abort(); } // Division not supported. + Sfe operator/ (const Sfe &) const { abort(); } // Division not supported. Sfe& operator+=(const Sfe &f) { return *this = *this + f; } Sfe& operator-=(const Sfe &f) { return *this = *this - f; } @@ -91,7 +99,7 @@ struct Static_filter_error double bound() const { return _b; } int degree() const { return _d; } - double ulp const (const double &d) + double ulp (const double &d) const { // You are supposed to call this function with rounding towards // +infinity, and on a positive number. @@ -117,9 +125,9 @@ sqrt(const Static_filter_error &f) { CGAL_warning_msg(f.degree() & 1 == 0, "you really want a non integer degree ???"); - double b = sqrt(f.bound()); + double b = std::sqrt(f.bound()); FPU_CW_t backup = FPU_get_and_set_cw(FPU_cw_up); - double e = sqrt(f.error()) + f.ulp(b)/2; + double e = std::sqrt(f.error()) + f.ulp(b)/2; FPU_set_cw(backup); return Static_filter_error(b, e, f.degree()/2); } @@ -127,6 +135,16 @@ sqrt(const Static_filter_error &f) // Now the overloaded built-in predicates, that will _set_ the epsilons. +inline +Sign +lexicographical_sign_SAF(const Static_filter_error &, + const Static_filter_error &, + double &) +{ + // not finished.. + return ZERO; // ?? +} + inline Comparison_result compare_SAF(const Static_filter_error &a,