Change LEMON's isnan() to isNaN() for the sake of AIX/xlC
authorAlpar Juttner <alpar@cs.elte.hu>
Fri, 13 Feb 2009 15:01:09 +0000
changeset 51106787db0ef5f
parent 510 bc0a130bbb46
child 513 2a136de8e3f2
Change LEMON's isnan() to isNaN() for the sake of AIX/xlC

Certain xlC versions implement isnan() as a #define.
lemon/lp_base.h
lemon/math.h
     1.1 --- a/lemon/lp_base.h	Fri Feb 13 14:56:27 2009 +0000
     1.2 +++ b/lemon/lp_base.h	Fri Feb 13 15:01:09 2009 +0000
     1.3 @@ -597,11 +597,11 @@
     1.4        const Value &upperBound() const { return _ub; }
     1.5        ///Is the constraint lower bounded?
     1.6        bool lowerBounded() const {
     1.7 -        return _lb != -INF && !isnan(_lb);
     1.8 +        return _lb != -INF && !isNaN(_lb);
     1.9        }
    1.10        ///Is the constraint upper bounded?
    1.11        bool upperBounded() const {
    1.12 -        return _ub != INF && !isnan(_ub);
    1.13 +        return _ub != INF && !isNaN(_ub);
    1.14        }
    1.15  
    1.16      };
    1.17 @@ -1666,7 +1666,7 @@
    1.18    inline LpBase::Constr operator<=(const LpBase::Value &n,
    1.19                                     const LpBase::Constr &c) {
    1.20      LpBase::Constr tmp(c);
    1.21 -    LEMON_ASSERT(isnan(tmp.lowerBound()), "Wrong LP constraint");
    1.22 +    LEMON_ASSERT(isNaN(tmp.lowerBound()), "Wrong LP constraint");
    1.23      tmp.lowerBound()=n;
    1.24      return tmp;
    1.25    }
    1.26 @@ -1678,7 +1678,7 @@
    1.27                                     const LpBase::Value &n)
    1.28    {
    1.29      LpBase::Constr tmp(c);
    1.30 -    LEMON_ASSERT(isnan(tmp.upperBound()), "Wrong LP constraint");
    1.31 +    LEMON_ASSERT(isNaN(tmp.upperBound()), "Wrong LP constraint");
    1.32      tmp.upperBound()=n;
    1.33      return tmp;
    1.34    }
    1.35 @@ -1690,7 +1690,7 @@
    1.36    inline LpBase::Constr operator>=(const LpBase::Value &n,
    1.37                                     const LpBase::Constr &c) {
    1.38      LpBase::Constr tmp(c);
    1.39 -    LEMON_ASSERT(isnan(tmp.upperBound()), "Wrong LP constraint");
    1.40 +    LEMON_ASSERT(isNaN(tmp.upperBound()), "Wrong LP constraint");
    1.41      tmp.upperBound()=n;
    1.42      return tmp;
    1.43    }
    1.44 @@ -1702,7 +1702,7 @@
    1.45                                     const LpBase::Value &n)
    1.46    {
    1.47      LpBase::Constr tmp(c);
    1.48 -    LEMON_ASSERT(isnan(tmp.lowerBound()), "Wrong LP constraint");
    1.49 +    LEMON_ASSERT(isNaN(tmp.lowerBound()), "Wrong LP constraint");
    1.50      tmp.lowerBound()=n;
    1.51      return tmp;
    1.52    }
     2.1 --- a/lemon/math.h	Fri Feb 13 14:56:27 2009 +0000
     2.2 +++ b/lemon/math.h	Fri Feb 13 15:01:09 2009 +0000
     2.3 @@ -60,7 +60,7 @@
     2.4    ///This function checks whether the parameter is NaN or not.
     2.5    ///Is should be equivalent with std::isnan(), but it is not
     2.6    ///provided by all compilers.
     2.7 -  inline bool isnan(double v)
     2.8 +  inline bool isNaN(double v)
     2.9      {
    2.10        return v!=v;
    2.11      }