COIN-OR::LEMON - Graph Library

Ticket #266: circ-debug-0eb152268d6d.patch

File circ-debug-0eb152268d6d.patch, 1.1 KB (added by Peter Kovacs, 16 years ago)
  • lemon/circulation.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1240605396 -7200
    # Node ID 0eb152268d6d1271a52e841d6e890544b5a2f294
    # Parent  ea2c9187404a7cd2dbcf4e2c93dcdc30807188f2
    Debug check for lower<=upper in Circulation (#266)
    
    diff --git a/lemon/circulation.h b/lemon/circulation.h
    a b  
    341341
    342342  private:
    343343
     344    bool checkBoundMaps() {
     345      for (ArcIt e(_g);e!=INVALID;++e) {
     346        if (_tol.less((*_up)[e], (*_lo)[e])) return false;
     347      }
     348      return true;
     349    }
     350
    344351    void createStructures() {
    345352      _node_num = _el = countNodes(_g);
    346353
     
    490497    /// to the lower bound.
    491498    void init()
    492499    {
     500      LEMON_DEBUG(checkBoundMaps(),
     501        "Upper bounds must be greater or equal to the lower bounds");
     502
    493503      createStructures();
    494504
    495505      for(NodeIt n(_g);n!=INVALID;++n) {
     
    519529    /// to construct the initial solution.
    520530    void greedyInit()
    521531    {
     532      LEMON_DEBUG(checkBoundMaps(),
     533        "Upper bounds must be greater or equal to the lower bounds");
     534
    522535      createStructures();
    523536
    524537      for(NodeIt n(_g);n!=INVALID;++n) {