diff -r 224d3781b00b -r d886e4b131e6 lemon/tolerance.h --- a/lemon/tolerance.h Tue May 09 09:21:48 2006 +0000 +++ b/lemon/tolerance.h Tue May 09 09:23:39 2006 +0000 @@ -105,7 +105,7 @@ Tolerance(float e) : _epsilon(e) {} ///Return the epsilon value. - Value epsilon() {return _epsilon;} + Value epsilon() const {return _epsilon;} ///Set the epsilon value. void epsilon(Value e) {_epsilon=e;} @@ -120,15 +120,15 @@ ///@{ ///Returns \c true if \c a is \e surely strictly less than \c b - bool less(Value a,Value b) {return a+_epsilona; } + bool negative(Value a) const { return -_epsilon>a; } ///Returns \c true if \c a is \e surely non-zero - Value nonZero(Value a) { return positive(a)||negative(a); }; + bool nonZero(Value a) const { return positive(a)||negative(a); }; ///@} @@ -156,7 +156,7 @@ Tolerance(double e) : _epsilon(e) {} ///Return the epsilon value. - Value epsilon() {return _epsilon;} + Value epsilon() const {return _epsilon;} ///Set the epsilon value. void epsilon(Value e) {_epsilon=e;} @@ -171,15 +171,15 @@ ///@{ ///Returns \c true if \c a is \e surely strictly less than \c b - bool less(Value a,Value b) {return a+_epsilona; } + bool negative(Value a) const { return -_epsilon>a; } ///Returns \c true if \c a is \e surely non-zero - Value nonZero(Value a) { return positive(a)||negative(a); }; + bool nonZero(Value a) const { return positive(a)||negative(a); }; ///@} @@ -207,7 +207,7 @@ Tolerance(long double e) : _epsilon(e) {} ///Return the epsilon value. - Value epsilon() {return _epsilon;} + Value epsilon() const {return _epsilon;} ///Set the epsilon value. void epsilon(Value e) {_epsilon=e;} @@ -222,15 +222,15 @@ ///@{ ///Returns \c true if \c a is \e surely strictly less than \c b - bool less(Value a,Value b) {return a+_epsilona; } + bool negative(Value a) const { return -_epsilon>a; } ///Returns \c true if \c a is \e surely non-zero - Value nonZero(Value a) { return positive(a)||negative(a); }; + bool nonZero(Value a) const { return positive(a)||negative(a); }; ///@} @@ -263,7 +263,7 @@ ///Returns \c true if \c a is \e surely negative static bool negative(Value a) { return 0>a; } ///Returns \c true if \c a is \e surely non-zero - static Value nonZero(Value a) { return a!=0;}; + static bool nonZero(Value a) { return a!=0; }; ///@} @@ -299,7 +299,7 @@ ///Returns \c true if \c a is \e surely negative static bool negative(Value a) { return 0>a; } ///Returns \c true if \c a is \e surely non-zero - static Value nonZero(Value a) { return a!=0;}; + static bool nonZero(Value a) { return a!=0;}; ///@}