summaryrefslogtreecommitdiff
path: root/ot/lp/network_simplex_simple.h
diff options
context:
space:
mode:
authorAntoine Rolet <antoine.rolet@gmail.com>2017-07-13 15:30:39 +0900
committerAntoine Rolet <antoine.rolet@gmail.com>2017-07-13 15:30:39 +0900
commit55a38f8253e5831105d2c329f4d8ed77686d1330 (patch)
tree6e8890ca1e0817c9043ce3927495c1f8679d5d6c /ot/lp/network_simplex_simple.h
parent0e86d1bdbc0dcf7ffdb943637f62df5de4612ad0 (diff)
Added optional maximal number of iteration
Diffstat (limited to 'ot/lp/network_simplex_simple.h')
-rw-r--r--ot/lp/network_simplex_simple.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ot/lp/network_simplex_simple.h b/ot/lp/network_simplex_simple.h
index 125c818..08449f6 100644
--- a/ot/lp/network_simplex_simple.h
+++ b/ot/lp/network_simplex_simple.h
@@ -1426,7 +1426,7 @@ namespace lemon {
//pivot.setDantzig(true);
// Execute the Network Simplex algorithm
while (pivot.findEnteringArc()) {
- if(++iter_number>=max_iter&&max_iter>0){
+ if(max_iter > 0 && ++iter_number>=max_iter&&max_iter>0){
char errMess[1000];
sprintf( errMess, "RESULT MIGHT BE INACURATE\nMax number of iteration reached, currently \%d. Sometimes iterations go on in cycle even though the solution has been reached, to check if it's the case here have a look at the minimal reduced cost. If it is very close to machine precision, you might actually have the correct solution, if not try setting the maximum number of iterations a bit higher\n",iter_number );
std::cerr << errMess;