COIN-OR::LEMON - Graph Library

Ticket #350: acf6cb96c7d4.patch

File acf6cb96c7d4.patch, 1.2 KB (added by Alpar Juttner, 15 years ago)
  • lemon/cost_scaling.h

    # HG changeset patch
    # User Alpar Juttner <alpar@cs.elte.hu>
    # Date 1267165002 -3600
    # Node ID acf6cb96c7d43bd58fcbde697e0a9b43367f1cbc
    # Parent  2c35bef44dd12ecff705b0b9cd6cde34a9bb371b
    Fix ambiguous use of sqrt (#350)
    
    diff --git a/lemon/cost_scaling.h b/lemon/cost_scaling.h
    a b  
    944944          BellmanFord<StaticDigraph, LargeCostArcMap> bf(_sgr, _cost_map);
    945945          bf.init(0);
    946946          bool done = false;
    947           int K = int(BF_HEURISTIC_BOUND_FACTOR * sqrt(_res_node_num));
     947          int K = int(BF_HEURISTIC_BOUND_FACTOR *
     948                      std::sqrt(double(_res_node_num)));
    948949          for (int i = 0; i < K && !done; ++i)
    949950            done = bf.processNextWeakRound();
    950951          if (done) break;
     
    10721073          BellmanFord<StaticDigraph, LargeCostArcMap> bf(_sgr, _cost_map);
    10731074          bf.init(0);
    10741075          bool done = false;
    1075           int K = int(BF_HEURISTIC_BOUND_FACTOR * sqrt(_res_node_num));
     1076          int K = int(BF_HEURISTIC_BOUND_FACTOR *
     1077                      std::sqrt(double(_res_node_num)));
    10761078          for (int i = 0; i < K && !done; ++i)
    10771079            done = bf.processNextWeakRound();
    10781080          if (done) break;