From 98916cb7d5763730e7cc06f70fa772d9b0e9fbfc Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Fri, 6 Aug 1999 12:57:52 +0000 Subject: [PATCH] - Removed the _SAF functions. - Added an empty ctor. --- .../include/CGAL/Restricted_double.h | 38 +------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/Packages/Interval_arithmetic/include/CGAL/Restricted_double.h b/Packages/Interval_arithmetic/include/CGAL/Restricted_double.h index 2a6b52e757e..7340acb867e 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Restricted_double.h +++ b/Packages/Interval_arithmetic/include/CGAL/Restricted_double.h @@ -28,7 +28,7 @@ // The goal of this class is to be run by some overloaded predicates, // This is just a wrapper for a double, but with limited functionality, // to detect non-intented use. -// It's the type over which is run the _SAF epsilon variant, and which throws +// It's the type over which is run the epsilon variant, and which throws // the exceptions. // TODO: I need to add some missing operators and functions, min/max... @@ -43,6 +43,7 @@ struct Restricted_double typedef Restricted_double Self; struct unsafe_comparison {}; // Exception class. + Restricted_double () {} Restricted_double (const double &d) : _d(d) {} Restricted_double (const int &i) : _d(double(i)) {} // Add operator= for efficiency. @@ -80,41 +81,6 @@ abs(const Restricted_double &f) return std::fabs(f.dbl()); } -// Now the epsilon predicates, which might throw the exception. - -inline -Sign -lexicographical_sign_SAF(const Restricted_double &, - const Restricted_double &, - const double &) -{ - // Not finished... - throw Restricted_double::unsafe_comparison(); -} - -inline -Comparison_result -compare_SAF(const Restricted_double &a, - const Restricted_double &b, - const double &epsilon) -{ - if (a.dbl() > b.dbl()+epsilon) return LARGER; - if (a.dbl() < b.dbl()-epsilon) return SMALLER; - if (a.dbl()==b.dbl() && epsilon==0) return EQUAL; - throw Restricted_double::unsafe_comparison(); -} - -inline -Sign -sign_SAF(const Restricted_double &a, const double &epsilon) -{ - // return compare_SAF(a,0,epsilon); - if (a.dbl()> epsilon) return POSITIVE; - if (a.dbl()<-epsilon) return NEGATIVE; - if (a.dbl()==0 && epsilon==0) return ZERO; - throw Restricted_double::unsafe_comparison(); -} - CGAL_END_NAMESPACE #endif // CGAL_RESTRICTED_DOUBLE_H