Changeset 2073:d886e4b131e6 in lemon0.x
 Timestamp:
 05/09/06 11:23:39 (15 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2733
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/tolerance.h
r1965 r2073 106 106 107 107 ///Return the epsilon value. 108 Value epsilon() {return _epsilon;}108 Value epsilon() const {return _epsilon;} 109 109 ///Set the epsilon value. 110 110 void epsilon(Value e) {_epsilon=e;} … … 121 121 122 122 ///Returns \c true if \c a is \e surely strictly less than \c b 123 bool less(Value a,Value b) {return a+_epsilon<b;}124 ///Returns \c true if \c a is \e surely different from \c b 125 bool different(Value a,Value b) { return less(a,b)less(b,a); }126 ///Returns \c true if \c a is \e surely positive 127 bool positive(Value a) { return _epsilon<a; }128 ///Returns \c true if \c a is \e surely negative 129 bool negative(Value a) { return _epsilon>a; }130 ///Returns \c true if \c a is \e surely nonzero 131 Value nonZero(Value a){ return positive(a)negative(a); };123 bool less(Value a,Value b) const {return a+_epsilon<b;} 124 ///Returns \c true if \c a is \e surely different from \c b 125 bool different(Value a,Value b) const { return less(a,b)less(b,a); } 126 ///Returns \c true if \c a is \e surely positive 127 bool positive(Value a) const { return _epsilon<a; } 128 ///Returns \c true if \c a is \e surely negative 129 bool negative(Value a) const { return _epsilon>a; } 130 ///Returns \c true if \c a is \e surely nonzero 131 bool nonZero(Value a) const { return positive(a)negative(a); }; 132 132 133 133 ///@} … … 157 157 158 158 ///Return the epsilon value. 159 Value epsilon() {return _epsilon;}159 Value epsilon() const {return _epsilon;} 160 160 ///Set the epsilon value. 161 161 void epsilon(Value e) {_epsilon=e;} … … 172 172 173 173 ///Returns \c true if \c a is \e surely strictly less than \c b 174 bool less(Value a,Value b) {return a+_epsilon<b;}175 ///Returns \c true if \c a is \e surely different from \c b 176 bool different(Value a,Value b) { return less(a,b)less(b,a); }177 ///Returns \c true if \c a is \e surely positive 178 bool positive(Value a) { return _epsilon<a; }179 ///Returns \c true if \c a is \e surely negative 180 bool negative(Value a) { return _epsilon>a; }181 ///Returns \c true if \c a is \e surely nonzero 182 Value nonZero(Value a){ return positive(a)negative(a); };174 bool less(Value a,Value b) const {return a+_epsilon<b;} 175 ///Returns \c true if \c a is \e surely different from \c b 176 bool different(Value a,Value b) const { return less(a,b)less(b,a); } 177 ///Returns \c true if \c a is \e surely positive 178 bool positive(Value a) const { return _epsilon<a; } 179 ///Returns \c true if \c a is \e surely negative 180 bool negative(Value a) const { return _epsilon>a; } 181 ///Returns \c true if \c a is \e surely nonzero 182 bool nonZero(Value a) const { return positive(a)negative(a); }; 183 183 184 184 ///@} … … 208 208 209 209 ///Return the epsilon value. 210 Value epsilon() {return _epsilon;}210 Value epsilon() const {return _epsilon;} 211 211 ///Set the epsilon value. 212 212 void epsilon(Value e) {_epsilon=e;} … … 223 223 224 224 ///Returns \c true if \c a is \e surely strictly less than \c b 225 bool less(Value a,Value b) {return a+_epsilon<b;}226 ///Returns \c true if \c a is \e surely different from \c b 227 bool different(Value a,Value b) { return less(a,b)less(b,a); }228 ///Returns \c true if \c a is \e surely positive 229 bool positive(Value a) { return _epsilon<a; }230 ///Returns \c true if \c a is \e surely negative 231 bool negative(Value a) { return _epsilon>a; }232 ///Returns \c true if \c a is \e surely nonzero 233 Value nonZero(Value a){ return positive(a)negative(a); };225 bool less(Value a,Value b) const {return a+_epsilon<b;} 226 ///Returns \c true if \c a is \e surely different from \c b 227 bool different(Value a,Value b) const { return less(a,b)less(b,a); } 228 ///Returns \c true if \c a is \e surely positive 229 bool positive(Value a) const { return _epsilon<a; } 230 ///Returns \c true if \c a is \e surely negative 231 bool negative(Value a) const { return _epsilon>a; } 232 ///Returns \c true if \c a is \e surely nonzero 233 bool nonZero(Value a) const { return positive(a)negative(a); }; 234 234 235 235 ///@} … … 264 264 static bool negative(Value a) { return 0>a; } 265 265 ///Returns \c true if \c a is \e surely nonzero 266 static Value nonZero(Value a) { return a!=0;};266 static bool nonZero(Value a) { return a!=0; }; 267 267 268 268 ///@} … … 300 300 static bool negative(Value a) { return 0>a; } 301 301 ///Returns \c true if \c a is \e surely nonzero 302 static ValuenonZero(Value a) { return a!=0;};302 static bool nonZero(Value a) { return a!=0;}; 303 303 304 304 ///@}
Note: See TracChangeset
for help on using the changeset viewer.