NaN checking to be conform to MinGW32
authordeba
Fri, 31 Mar 2006 12:04:48 +0000
changeset 20268d49961ec50f
parent 2025 93fcadf94ab0
child 2027 119db4e6ab2c
NaN checking to be conform to MinGW32
lemon/lp_base.h
     1.1 --- a/lemon/lp_base.h	Fri Mar 31 11:10:44 2006 +0000
     1.2 +++ b/lemon/lp_base.h	Fri Mar 31 12:04:48 2006 +0000
     1.3 @@ -159,6 +159,8 @@
     1.4      static const Value INF;
     1.5      ///The not a number constant
     1.6      static const Value NaN;
     1.7 +
     1.8 +    static inline bool isNaN(const Value& v) { return v!=v; }
     1.9      
    1.10      ///Refer to a column of the LP.
    1.11  
    1.12 @@ -1105,7 +1107,9 @@
    1.13  
    1.14      ///\e Solve the LP problem at hand
    1.15      ///
    1.16 -    ///\return The result of the optimization procedure. Possible values and their meanings can be found in the documentation of \ref SolveExitStatus.
    1.17 +    ///\return The result of the optimization procedure. Possible 
    1.18 +    ///values and their meanings can be found in the documentation of 
    1.19 +    ///\ref SolveExitStatus.
    1.20      ///
    1.21      ///\todo Which method is used to solve the problem
    1.22      SolveExitStatus solve() { return _solve(); }
    1.23 @@ -1290,7 +1294,7 @@
    1.24    {
    1.25      LpSolverBase::Constr tmp(c);
    1.26      ///\todo Create an own exception type.
    1.27 -    if(!isnan(tmp.lowerBound())) throw LogicError();
    1.28 +    if(!LpSolverBase::isNaN(tmp.lowerBound())) throw LogicError();
    1.29      else tmp.lowerBound()=n;
    1.30      return tmp;
    1.31    }
    1.32 @@ -1303,7 +1307,7 @@
    1.33    {
    1.34      LpSolverBase::Constr tmp(c);
    1.35      ///\todo Create an own exception type.
    1.36 -    if(!isnan(tmp.upperBound())) throw LogicError();
    1.37 +    if(!LpSolverBase::isNaN(tmp.upperBound())) throw LogicError();
    1.38      else tmp.upperBound()=n;
    1.39      return tmp;
    1.40    }
    1.41 @@ -1317,7 +1321,7 @@
    1.42    {
    1.43      LpSolverBase::Constr tmp(c);
    1.44      ///\todo Create an own exception type.
    1.45 -    if(!isnan(tmp.upperBound())) throw LogicError();
    1.46 +    if(!LpSolverBase::isNaN(tmp.upperBound())) throw LogicError();
    1.47      else tmp.upperBound()=n;
    1.48      return tmp;
    1.49    }
    1.50 @@ -1330,7 +1334,7 @@
    1.51    {
    1.52      LpSolverBase::Constr tmp(c);
    1.53      ///\todo Create an own exception type.
    1.54 -    if(!isnan(tmp.lowerBound())) throw LogicError();
    1.55 +    if(!LpSolverBase::isNaN(tmp.lowerBound())) throw LogicError();
    1.56      else tmp.lowerBound()=n;
    1.57      return tmp;
    1.58    }