COIN-OR::LEMON - Graph Library

Ticket #368: 368-ns-fix-5205145fabf6.patch

File 368-ns-fix-5205145fabf6.patch, 1.0 KB (added by Peter Kovacs, 14 years ago)
  • lemon/network_simplex.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1272819236 -7200
    # Node ID 5205145fabf68906e789911c2fc39968fd655f6e
    # Parent  5b926cc36a4b4c53712651778e2ad62115d2b023
    Fix the usage of min() (#368)
    
    diff --git a/lemon/network_simplex.h b/lemon/network_simplex.h
    a b  
    10421042      if (std::numeric_limits<Cost>::is_exact) {
    10431043        ART_COST = std::numeric_limits<Cost>::max() / 2 + 1;
    10441044      } else {
    1045         ART_COST = std::numeric_limits<Cost>::min();
     1045        ART_COST = 0;
    10461046        for (int i = 0; i != _arc_num; ++i) {
    10471047          if (_cost[i] > ART_COST) ART_COST = _cost[i];
    10481048        }
     
    14571457      // optimality conditions
    14581458      if (_sum_supply == 0) {
    14591459        if (_stype == GEQ) {
    1460           Cost max_pot = std::numeric_limits<Cost>::min();
     1460          Cost max_pot = -std::numeric_limits<Cost>::max();
    14611461          for (int i = 0; i != _node_num; ++i) {
    14621462            if (_pi[i] > max_pot) max_pot = _pi[i];
    14631463          }