[Lemon-commits] Alpar Juttner: Merge #454

Lemon HG hg at lemon.cs.elte.hu
Tue Jul 30 15:45:59 CEST 2013


details:   http://lemon.cs.elte.hu/hg/lemon/rev/879fcb781086
changeset: 1241:879fcb781086
user:      Alpar Juttner <alpar [at] cs.elte.hu>
date:      Tue Jul 30 15:24:45 2013 +0200
description:
	Merge #454

diffstat:

 lemon/capacity_scaling.h |  14 ++++++++++++++
 lemon/cost_scaling.h     |  13 +++++++++++++
 lemon/cycle_canceling.h  |  13 +++++++++++++
 lemon/network_simplex.h  |  13 +++++++++++++
 4 files changed, 53 insertions(+), 0 deletions(-)

diffs (121 lines):

diff -r d1a48668ddb4 -r 879fcb781086 lemon/capacity_scaling.h
--- a/lemon/capacity_scaling.h	Tue Jul 30 15:14:29 2013 +0200
+++ b/lemon/capacity_scaling.h	Tue Jul 30 15:24:45 2013 +0200
@@ -739,6 +739,11 @@
       }
       if (_sum_supply > 0) return INFEASIBLE;
 
+      // Check lower and upper bounds
+      LEMON_DEBUG(checkBoundMaps(),
+          "Upper bounds must be greater or equal to the lower bounds");
+
+
       // Initialize vectors
       for (int i = 0; i != _root; ++i) {
         _pi[i] = 0;
@@ -832,6 +837,15 @@
 
       return OPTIMAL;
     }
+    
+    // Check if the upper bound is greater or equal to the lower bound
+    // on each arc.
+    bool checkBoundMaps() {
+      for (int j = 0; j != _res_arc_num; ++j) {
+        if (_upper[j] < _lower[j]) return false;
+      }
+      return true;
+    }
 
     ProblemType start() {
       // Execute the algorithm
diff -r d1a48668ddb4 -r 879fcb781086 lemon/cost_scaling.h
--- a/lemon/cost_scaling.h	Tue Jul 30 15:14:29 2013 +0200
+++ b/lemon/cost_scaling.h	Tue Jul 30 15:24:45 2013 +0200
@@ -763,6 +763,10 @@
       }
       if (_sum_supply > 0) return INFEASIBLE;
 
+      // Check lower and upper bounds
+      LEMON_DEBUG(checkBoundMaps(),
+          "Upper bounds must be greater or equal to the lower bounds");
+
 
       // Initialize vectors
       for (int i = 0; i != _res_node_num; ++i) {
@@ -899,6 +903,15 @@
 
       return OPTIMAL;
     }
+    
+    // Check if the upper bound is greater or equal to the lower bound
+    // on each arc.
+    bool checkBoundMaps() {
+      for (int j = 0; j != _res_arc_num; ++j) {
+        if (_upper[j] < _lower[j]) return false;
+      }
+      return true;
+    }
 
     // Execute the algorithm and transform the results
     void start(Method method) {
diff -r d1a48668ddb4 -r 879fcb781086 lemon/cycle_canceling.h
--- a/lemon/cycle_canceling.h	Tue Jul 30 15:14:29 2013 +0200
+++ b/lemon/cycle_canceling.h	Tue Jul 30 15:24:45 2013 +0200
@@ -670,6 +670,10 @@
       }
       if (_sum_supply > 0) return INFEASIBLE;
 
+      // Check lower and upper bounds
+      LEMON_DEBUG(checkBoundMaps(),
+          "Upper bounds must be greater or equal to the lower bounds");
+
 
       // Initialize vectors
       for (int i = 0; i != _res_node_num; ++i) {
@@ -779,6 +783,15 @@
 
       return OPTIMAL;
     }
+    
+    // Check if the upper bound is greater or equal to the lower bound
+    // on each arc.
+    bool checkBoundMaps() {
+      for (int j = 0; j != _res_arc_num; ++j) {
+        if (_upper[j] < _lower[j]) return false;
+      }
+      return true;
+    }
 
     // Build a StaticDigraph structure containing the current
     // residual network
diff -r d1a48668ddb4 -r 879fcb781086 lemon/network_simplex.h
--- a/lemon/network_simplex.h	Tue Jul 30 15:14:29 2013 +0200
+++ b/lemon/network_simplex.h	Tue Jul 30 15:24:45 2013 +0200
@@ -1067,6 +1067,10 @@
       if ( !((_stype == GEQ && _sum_supply <= 0) ||
              (_stype == LEQ && _sum_supply >= 0)) ) return false;
 
+      // Check lower and upper bounds
+      LEMON_DEBUG(checkBoundMaps(),
+          "Upper bounds must be greater or equal to the lower bounds");
+
       // Remove non-zero lower bounds
       if (_have_lower) {
         for (int i = 0; i != _arc_num; ++i) {
@@ -1230,6 +1234,15 @@
 
       return true;
     }
+    
+    // Check if the upper bound is greater or equal to the lower bound
+    // on each arc.
+    bool checkBoundMaps() {
+      for (int j = 0; j != _arc_num; ++j) {
+        if (_upper[j] < _lower[j]) return false;
+      }
+      return true;
+    }
 
     // Find the join node
     void findJoinNode() {


More information about the Lemon-commits mailing list