COIN-OR::LEMON - Graph Library

Changeset 1092:dceba191c00d in lemon-main for lemon/nagamochi_ibaraki.h


Ignore:
Timestamp:
08/09/13 11:28:17 (11 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
1093:fb1c7da561ce, 1165:e0ccc1f0268f
Phase:
public
Message:

Apply unify-sources.sh to the source tree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/nagamochi_ibaraki.h

    r978 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    304304    //This is here to avoid a gcc-3.3 compilation error.
    305305    //It should never be called.
    306     NagamochiIbaraki() {} 
    307    
     306    NagamochiIbaraki() {}
     307
    308308  public:
    309309
     
    415415        for (typename Graph::OutArcIt a(_graph, n); a != INVALID; ++a) {
    416416          typename Graph::Node m = _graph.target(a);
    417          
     417
    418418          if (!(n < m)) continue;
    419419
    420420          (*_nodes)[n].sum += (*_capacity)[a];
    421421          (*_nodes)[m].sum += (*_capacity)[a];
    422          
     422
    423423          int c = (*_nodes)[m].curr_arc;
    424424          if (c != -1 && _arcs[c ^ 1].target == n) {
     
    426426          } else {
    427427            _edges[index].capacity = (*_capacity)[a];
    428            
     428
    429429            _arcs[index << 1].prev = -1;
    430430            if ((*_nodes)[n].first_arc != -1) {
     
    436436
    437437            (*_nodes)[m].curr_arc = (index << 1);
    438            
     438
    439439            _arcs[(index << 1) | 1].prev = -1;
    440440            if ((*_nodes)[m].first_arc != -1) {
     
    444444            (*_nodes)[m].first_arc = ((index << 1) | 1);
    445445            _arcs[(index << 1) | 1].target = n;
    446            
     446
    447447            ++index;
    448448          }
     
    453453      _min_cut = std::numeric_limits<Value>::max();
    454454
    455       for (typename Graph::Node n = _first_node; 
     455      for (typename Graph::Node n = _first_node;
    456456           n != INVALID; n = (*_nodes)[n].next) {
    457457        if ((*_nodes)[n].sum < _min_cut) {
     
    478478
    479479      _heap->clear();
    480       for (typename Graph::Node n = _first_node; 
     480      for (typename Graph::Node n = _first_node;
    481481           n != INVALID; n = (*_nodes)[n].next) {
    482482        (*_heap_cross_ref)[n] = Heap::PRE_HEAP;
     
    498498        for (int a = (*_nodes)[n].first_arc; a != -1; a = _arcs[a].next) {
    499499          switch (_heap->state(_arcs[a].target)) {
    500           case Heap::PRE_HEAP: 
     500          case Heap::PRE_HEAP:
    501501            {
    502502              Value nv = _edges[a >> 1].capacity;
     
    564564            if (!merged) {
    565565              for (int b = (*_nodes)[n].first_arc; b != -1; b = _arcs[b].next) {
    566                 (*_nodes)[_arcs[b].target].curr_arc = b;         
     566                (*_nodes)[_arcs[b].target].curr_arc = b;
    567567              }
    568568              merged = true;
     
    574574              if ((b ^ a) == 1) continue;
    575575              typename Graph::Node o = _arcs[b].target;
    576               int c = (*_nodes)[o].curr_arc; 
     576              int c = (*_nodes)[o].curr_arc;
    577577              if (c != -1 && _arcs[c ^ 1].target == n) {
    578578                _edges[c >> 1].capacity += _edges[b >> 1].capacity;
     
    607607            } else {
    608608              (*_nodes)[n].first_arc = _arcs[a].next;
    609             }           
     609            }
    610610            if (_arcs[a].next != -1) {
    611611              _arcs[_arcs[a].next].prev = _arcs[a].prev;
     
    615615            (*_next_rep)[(*_nodes)[n].last_rep] = m;
    616616            (*_nodes)[n].last_rep = (*_nodes)[m].last_rep;
    617            
     617
    618618            if ((*_nodes)[m].prev != INVALID) {
    619619              (*_nodes)[(*_nodes)[m].prev].next = (*_nodes)[m].next;
Note: See TracChangeset for help on using the changeset viewer.