Changeset 2413:21eb3ccdc3df in lemon-0.x for lemon/tolerance.h
- Timestamp:
- 03/22/07 16:40:50 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3244
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/tolerance.h
r2391 r2413 306 306 static Value zero() {return 0;} 307 307 }; 308 309 310 ///Long integer specialization of \ref Tolerance. 311 312 ///Long integer specialization of \ref Tolerance. 313 ///\sa Tolerance 314 template<> 315 class Tolerance<long int> 316 { 317 public: 318 ///\e 319 typedef long int Value; 320 321 ///\name Comparisons 322 ///See \ref Tolerance for more details. 323 324 ///@{ 325 326 ///Returns \c true if \c a is \e surely strictly less than \c b 327 static bool less(Value a,Value b) { return a<b;} 328 ///Returns \c true if \c a is \e surely different from \c b 329 static bool different(Value a,Value b) { return a!=b; } 330 ///Returns \c true if \c a is \e surely positive 331 static bool positive(Value a) { return 0<a; } 332 ///Returns \c true if \c a is \e surely negative 333 static bool negative(Value a) { return 0>a; } 334 ///Returns \c true if \c a is \e surely non-zero 335 static bool nonZero(Value a) { return a!=0;}; 336 337 ///@} 338 339 ///Returns zero 340 static Value zero() {return 0;} 341 }; 342 343 ///Unsigned long integer specialization of \ref Tolerance. 344 345 ///Unsigned long integer specialization of \ref Tolerance. 346 ///\sa Tolerance 347 template<> 348 class Tolerance<unsigned long int> 349 { 350 public: 351 ///\e 352 typedef unsigned long int Value; 353 354 ///\name Comparisons 355 ///See \ref Tolerance for more details. 356 357 ///@{ 358 359 ///Returns \c true if \c a is \e surely strictly less than \c b 360 static bool less(Value a,Value b) { return a<b;} 361 ///Returns \c true if \c a is \e surely different from \c b 362 static bool different(Value a,Value b) { return a!=b; } 363 ///Returns \c true if \c a is \e surely positive 364 static bool positive(Value a) { return 0<a; } 365 ///Returns \c true if \c a is \e surely negative 366 static bool negative(Value) { return false; } 367 ///Returns \c true if \c a is \e surely non-zero 368 static bool nonZero(Value a) { return a!=0;}; 369 370 ///@} 371 372 ///Returns zero 373 static Value zero() {return 0;} 374 }; 308 375 309 376 #if defined __GNUC__ && !defined __STRICT_ANSI__
Note: See TracChangeset
for help on using the changeset viewer.