diff -r cd72eae05bdf -r 3c00344f49c9 lemon/math.h --- a/lemon/math.h Mon Jul 16 16:21:40 2018 +0200 +++ b/lemon/math.h Wed Oct 17 19:14:07 2018 +0200 @@ -2,7 +2,7 @@ * * This file is a part of LEMON, a generic C++ optimization library. * - * Copyright (C) 2003-2010 + * Copyright (C) 2003-2013 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * @@ -65,8 +65,13 @@ return v!=v; } + ///Round a value to its closest integer + inline double round(double r) { + return (r > 0.0) ? std::floor(r + 0.5) : std::ceil(r - 0.5); + } + /// @} } //namespace lemon -#endif //LEMON_TOLERANCE_H +#endif //LEMON_MATH_H