COIN-OR::LEMON - Graph Library

Changeset 1070:ee9bac10f58e in lemon-main


Ignore:
Timestamp:
03/16/13 16:20:41 (12 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Children:
1071:879fcb781086, 1102:330264b171cf
Phase:
public
Message:

Debug checking for capacity bounds in min cost flow algorithms (#454)

Location:
lemon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • lemon/capacity_scaling.h

    r1004 r1070  
    738738      if (_sum_supply > 0) return INFEASIBLE;
    739739
     740      // Check lower and upper bounds
     741      LEMON_DEBUG(checkBoundMaps(),
     742          "Upper bounds must be greater or equal to the lower bounds");
     743
     744
    740745      // Initialize vectors
    741746      for (int i = 0; i != _root; ++i) {
     
    830835
    831836      return OPTIMAL;
     837    }
     838   
     839    // Check if the upper bound is greater or equal to the lower bound
     840    // on each arc.
     841    bool checkBoundMaps() {
     842      for (int j = 0; j != _res_arc_num; ++j) {
     843        if (_upper[j] < _lower[j]) return false;
     844      }
     845      return true;
    832846    }
    833847
  • lemon/cost_scaling.h

    r1003 r1070  
    762762      if (_sum_supply > 0) return INFEASIBLE;
    763763
     764      // Check lower and upper bounds
     765      LEMON_DEBUG(checkBoundMaps(),
     766          "Upper bounds must be greater or equal to the lower bounds");
     767
    764768
    765769      // Initialize vectors
     
    897901
    898902      return OPTIMAL;
     903    }
     904   
     905    // Check if the upper bound is greater or equal to the lower bound
     906    // on each arc.
     907    bool checkBoundMaps() {
     908      for (int j = 0; j != _res_arc_num; ++j) {
     909        if (_upper[j] < _lower[j]) return false;
     910      }
     911      return true;
    899912    }
    900913
  • lemon/cycle_canceling.h

    r1013 r1070  
    671671      if (_sum_supply > 0) return INFEASIBLE;
    672672
     673      // Check lower and upper bounds
     674      LEMON_DEBUG(checkBoundMaps(),
     675          "Upper bounds must be greater or equal to the lower bounds");
     676
    673677
    674678      // Initialize vectors
     
    779783
    780784      return OPTIMAL;
     785    }
     786   
     787    // Check if the upper bound is greater or equal to the lower bound
     788    // on each arc.
     789    bool checkBoundMaps() {
     790      for (int j = 0; j != _res_arc_num; ++j) {
     791        if (_upper[j] < _lower[j]) return false;
     792      }
     793      return true;
    781794    }
    782795
  • lemon/network_simplex.h

    r1004 r1070  
    10681068             (_stype == LEQ && _sum_supply >= 0)) ) return false;
    10691069
     1070      // Check lower and upper bounds
     1071      LEMON_DEBUG(checkBoundMaps(),
     1072          "Upper bounds must be greater or equal to the lower bounds");
     1073
    10701074      // Remove non-zero lower bounds
    10711075      if (_have_lower) {
     
    12311235      return true;
    12321236    }
     1237   
     1238    // Check if the upper bound is greater or equal to the lower bound
     1239    // on each arc.
     1240    bool checkBoundMaps() {
     1241      for (int j = 0; j != _arc_num; ++j) {
     1242        if (_upper[j] < _lower[j]) return false;
     1243      }
     1244      return true;
     1245    }
    12331246
    12341247    // Find the join node
Note: See TracChangeset for help on using the changeset viewer.