Changeset 2495:e4f8367beb41 in lemon-0.x
- Timestamp:
- 10/13/07 10:48:07 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3334
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/lp_base.h
r2435 r2495 35 35 ///\ingroup lp_group 36 36 namespace lemon { 37 38 /// Function to decide whether a floating point value is finite or not. 39 40 /// Retruns true if the argument is not infinity, minus infinity or NaN. 41 /// It does the same as the isfinite() function defined by C99. 42 template <typename T> 43 bool isFinite(T value) 44 { 45 typedef std::numeric_limits<T> Lim; 46 if (Lim::has_infinity && (value == Lim::infinity() || value == 47 -Lim::infinity()) || 48 (Lim::has_quiet_NaN || Lim::has_signaling_NaN) && value != value) 49 { 50 return false; 51 } 52 return true; 53 } 37 54 38 55 ///Common base class for LP solvers … … 458 475 ///Is the constraint lower bounded? 459 476 bool lowerBounded() const { 460 using namespace std; 461 return finite(_lb); 477 return isFinite(_lb); 462 478 } 463 479 ///Is the constraint upper bounded? 464 480 bool upperBounded() const { 465 using namespace std; 466 return finite(_ub); 481 return isFinite(_ub); 467 482 } 468 483
Note: See TracChangeset
for help on using the changeset viewer.