Ticket #5659: diff

File diff, 1.7 KB (added by Thomas Sewell <thomas.sewell@…>, 11 years ago)

diff

  • dijkstra_shortest_paths.hpp

     
    420420      dummy_property_map p_map;
    421421
    422422      typedef typename property_traits<DistanceMap>::value_type D;
     423      D inf = choose_param(get_param(params, distance_inf_t()),
     424                      (std::numeric_limits<D>::max)());
     425
    423426      dijkstra_shortest_paths
    424427        (g, s,
    425428         choose_param(get_param(params, vertex_predecessor), p_map),
     
    427430         choose_param(get_param(params, distance_compare_t()),
    428431                      std::less<D>()),
    429432         choose_param(get_param(params, distance_combine_t()),
    430                       closed_plus<D>()),
    431          choose_param(get_param(params, distance_inf_t()),
    432                       (std::numeric_limits<D>::max)()),
     433                      closed_plus<D>(inf)),
     434         inf,
    433435         choose_param(get_param(params, distance_zero_t()),
    434436                      D()),
    435437         choose_param(get_param(params, graph_visitor),
  • relax.hpp

     
    2222    template <class T>
    2323    struct closed_plus
    2424    {
     25      const T inf;
     26
     27      closed_plus() : inf(std::numeric_limits<T>::max()) { }
     28      closed_plus(T inf) : inf(inf) { }
     29
    2530      T operator()(const T& a, const T& b) const {
    2631        using namespace std;
    27        const T inf = (std::numeric_limits<T>::max)();
    2832       if (a == inf) return inf;
    2933       if (b == inf) return inf;
    3034       return a + b;