lemon/capacity_scaling.h
changeset 1071 879fcb781086
parent 1053 1c978b5bcc65
parent 1070 ee9bac10f58e
child 1076 97d978243703
     1.1 --- a/lemon/capacity_scaling.h	Tue Jul 30 15:14:29 2013 +0200
     1.2 +++ b/lemon/capacity_scaling.h	Tue Jul 30 15:24:45 2013 +0200
     1.3 @@ -739,6 +739,11 @@
     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 != _root; ++i) {
    1.14          _pi[i] = 0;
    1.15 @@ -832,6 +837,15 @@
    1.16  
    1.17        return OPTIMAL;
    1.18      }
    1.19 +    
    1.20 +    // Check if the upper bound is greater or equal to the lower bound
    1.21 +    // on each arc.
    1.22 +    bool checkBoundMaps() {
    1.23 +      for (int j = 0; j != _res_arc_num; ++j) {
    1.24 +        if (_upper[j] < _lower[j]) return false;
    1.25 +      }
    1.26 +      return true;
    1.27 +    }
    1.28  
    1.29      ProblemType start() {
    1.30        // Execute the algorithm