diff -r 259e3a90ad97 -r 8db773f19586 lemon/preflow.h --- a/lemon/preflow.h Thu Mar 22 18:56:26 2018 +0100 +++ b/lemon/preflow.h Thu Mar 22 18:56:47 2018 +0100 @@ -476,7 +476,7 @@ /// Initializes the internal data structures and sets the initial /// flow to the given \c flowMap. The \c flowMap should contain a /// flow or at least a preflow, i.e. at each node excluding the - /// source node the incoming flow should greater or equal to the + /// source node the incoming flow should be greater or equal to the /// outgoing flow. /// \return \c false if the given \c flowMap is not a preflow. template @@ -495,7 +495,7 @@ for (OutArcIt e(_graph, n); e != INVALID; ++e) { excess -= (*_flow)[e]; } - if (excess < 0 && n != _source) return false; + if (_tolerance.negative(excess) && n != _source) return false; (*_excess)[n] = excess; } @@ -639,7 +639,7 @@ (*_excess)[n] = excess; - if (excess != 0) { + if (_tolerance.nonZero(excess)) { if (new_level + 1 < _level->maxLevel()) { _level->liftHighestActive(new_level + 1); } else { @@ -720,7 +720,7 @@ (*_excess)[n] = excess; - if (excess != 0) { + if (_tolerance.nonZero(excess)) { if (new_level + 1 < _level->maxLevel()) { _level->liftActiveOn(level, new_level + 1); } else { @@ -791,7 +791,7 @@ for (NodeIt n(_graph); n != INVALID; ++n) { if (!reached[n]) { _level->dirtyTopButOne(n); - } else if ((*_excess)[n] > 0 && _target != n) { + } else if (_tolerance.positive((*_excess)[n]) && _target != n) { _level->activate(n); } } @@ -852,7 +852,7 @@ (*_excess)[n] = excess; - if (excess != 0) { + if (_tolerance.nonZero(excess)) { if (new_level + 1 < _level->maxLevel()) { _level->liftHighestActive(new_level + 1); } else {