lemon/cost_scaling.h
changeset 1070 ee9bac10f58e
parent 1003 16f55008c863
child 1071 879fcb781086
child 1102 330264b171cf
     1.1 --- a/lemon/cost_scaling.h	Sat Mar 20 11:03:12 2010 +0100
     1.2 +++ b/lemon/cost_scaling.h	Sat Mar 16 16:20:41 2013 +0100
     1.3 @@ -761,6 +761,10 @@
     1.4        }
     1.5        if (_sum_supply > 0) return INFEASIBLE;
     1.6  
     1.7 +      // Check lower and upper bounds
     1.8 +      LEMON_DEBUG(checkBoundMaps(),
     1.9 +          "Upper bounds must be greater or equal to the lower bounds");
    1.10 +
    1.11  
    1.12        // Initialize vectors
    1.13        for (int i = 0; i != _res_node_num; ++i) {
    1.14 @@ -897,6 +901,15 @@
    1.15  
    1.16        return OPTIMAL;
    1.17      }
    1.18 +    
    1.19 +    // Check if the upper bound is greater or equal to the lower bound
    1.20 +    // on each arc.
    1.21 +    bool checkBoundMaps() {
    1.22 +      for (int j = 0; j != _res_arc_num; ++j) {
    1.23 +        if (_upper[j] < _lower[j]) return false;
    1.24 +      }
    1.25 +      return true;
    1.26 +    }
    1.27  
    1.28      // Execute the algorithm and transform the results
    1.29      void start(Method method) {