COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
08/31/04 13:26:59 (17 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1068
Message:

ResGraphWrapper?<Graph> is done, so does dimacs.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/augmenting_flow.h

    r762 r775  
    10211021      case AFTER_AUGMENTING:
    10221022//      std::cout << "AFTER_AUGMENTING" << std::endl;
    1023         for(g->first(v); g->valid(v); g->next(v)) {
     1023        for(g->first(v); v!=INVALID; ++v) {
    10241024          if (level[v]) {
    10251025            M.set(v, true);
     
    10311031      case AFTER_FAST_AUGMENTING:
    10321032//      std::cout << "AFTER_FAST_AUGMENTING" << std::endl;
    1033         for(g->first(v); g->valid(v); g->next(v)) {
     1033        for(g->first(v); v!=INVALID; ++v) {
    10341034          if (level[v]==number_of_augmentations) {
    10351035            M.set(v, true);
     
    10541054
    10551055        OutEdgeIt e;
    1056         for(g->first(e,w) ; g->valid(e); g->next(e)) {
     1056        for(g->first(e,w) ; e!=INVALID; ++e) {
    10571057          Node v=g->head(e);
    10581058          if (!M[v] && (*flow)[e] < (*capacity)[e] ) {
     
    10631063
    10641064        InEdgeIt f;
    1065         for(g->first(f,w) ; g->valid(f); g->next(f)) {
     1065        for(g->first(f,w) ; f!=INVALID; ++f) {
    10661066          Node v=g->tail(f);
    10671067          if (!M[v] && (*flow)[f] > 0 ) {
     
    11341134    while ( !bfs.finished() ) {
    11351135      ResGWOutEdgeIt e=bfs;
    1136       if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
     1136      if (e!=INVALID && bfs.isBNodeNewlyReached()) {
    11371137        Node v=res_graph.tail(e);
    11381138        Node w=res_graph.head(e);
    11391139        pred.set(w, e);
    1140         if (res_graph.valid(pred[v])) {
     1140        if (pred[v]!=INVALID) {
    11411141          free.set(w, std::min(free[v], res_graph.resCap(e)));
    11421142        } else {
     
    11521152      Node n=t;
    11531153      Num augment_value=free[t];
    1154       while (res_graph.valid(pred[n])) {
     1154      while (pred[n]!=INVALID) {
    11551155        ResGWEdge e=pred[n];
    11561156        res_graph.augment(e, augment_value);
     
    11911191    while ( !bfs.finished() ) {
    11921192      ResGWOutEdgeIt e=bfs;
    1193       if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
     1193      if (e!=INVALID && bfs.isBNodeNewlyReached()) {
    11941194        Node v=res_graph.tail(e);
    11951195        Node w=res_graph.head(e);
    11961196        pred.set(w, e);
    1197         if (res_graph.valid(pred[v])) {
     1197        if (pred[v]!=INVALID) {
    11981198          free.set(w, std::min(free[v], res_graph.resCap(e)));
    11991199        } else {
     
    12091209      Node n=t;
    12101210      Num augment_value=free[t];
    1211       while (res_graph.valid(pred[n])) {
     1211      while (pred[n]!=INVALID) {
    12121212        ResGWEdge e=pred[n];
    12131213        res_graph.augment(e, augment_value);
     
    12451245    {
    12461246      typename ResGW::NodeIt n;
    1247       for(res_graph.first(n); res_graph.valid(n); res_graph.next(n)) {
     1247      for(res_graph.first(n); n!=INVALID; ++n) {
    12481248        res_graph_to_F.set(n, F.addNode());
    12491249      }
     
    12571257    while ( !bfs.finished() ) {
    12581258      ResGWOutEdgeIt e=bfs;
    1259       if (res_graph.valid(e)) {
     1259      if (e!=INVALID) {
    12601260        if (bfs.isBNodeNewlyReached()) {
    12611261          dist.set(res_graph.head(e), dist[res_graph.tail(e)]+1);
     
    13001300            typename MG::Node w=F.bNode(dfs);
    13011301            pred.set(w, dfs);
    1302             if (F.valid(pred[v])) {
     1302            if (pred[v]!=INVALID) {
    13031303              free.set(w, std::min(free[v], residual_capacity[dfs]));
    13041304            } else {
     
    13201320        typename MG::Node n=tF;
    13211321        Num augment_value=free[tF];
    1322         while (F.valid(pred[n])) {
     1322        while (pred[n]!=INVALID) {
    13231323          typename MG::Edge e=pred[n];
    13241324          res_graph.augment(original_edge[e], augment_value);
     
    13381338
    13391339
    1340 
    1341 
    13421340  template <typename Graph, typename Num, typename CapMap, typename FlowMap>
    13431341  bool AugmentingFlow<Graph, Num, CapMap, FlowMap>::augmentOnBlockingFlow2()
     
    13551353    while ( !bfs.finished() ) {
    13561354      ResGWOutEdgeIt e=bfs;
    1357       if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
     1355      if (e!=INVALID && bfs.isBNodeNewlyReached()) {
    13581356        dist.set(res_graph.head(e), dist[res_graph.tail(e)]+1);
    13591357      }
     
    13721370      first_out_edges(filter_res_graph);
    13731371    typename FilterResGW::NodeIt v;
    1374     for(filter_res_graph.first(v); filter_res_graph.valid(v);
    1375         filter_res_graph.next(v))
     1372    for(filter_res_graph.first(v); v!=INVALID; ++v)
    13761373      {
    13771374        typename FilterResGW::OutEdgeIt e;
     
    14191416
    14201417              pred.set(w, /*typename ErasingResGW::OutEdgeIt*/(dfs));
    1421               if (erasing_res_graph.valid(pred[v])) {
     1418              if (pred[v]!=INVALID) {
    14221419                free1.set
    14231420                  (w, std::min(free1[v], res_graph.resCap
Note: See TracChangeset for help on using the changeset viewer.