lemon/cost_scaling.h
changeset 1241 879fcb781086
parent 1221 1c978b5bcc65
parent 1240 ee9bac10f58e
child 1250 97d978243703
     1.1 --- a/lemon/cost_scaling.h	Tue Jul 30 15:14:29 2013 +0200
     1.2 +++ b/lemon/cost_scaling.h	Tue Jul 30 15:24:45 2013 +0200
     1.3 @@ -763,6 +763,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 @@ -899,6 +903,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) {