COIN-OR::LEMON - Graph Library

Changeset 2413:21eb3ccdc3df in lemon-0.x for lemon/tolerance.h


Ignore:
Timestamp:
03/22/07 16:40:50 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3244
Message:

Right dimacs format for min cost flows
Bug fixes in tolerance and min_mean_cycle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/tolerance.h

    r2391 r2413  
    306306    static Value zero() {return 0;}
    307307  };
     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  };
    308375
    309376#if defined __GNUC__ && !defined __STRICT_ANSI__
Note: See TracChangeset for help on using the changeset viewer.