COIN-OR::LEMON - Graph Library

Ticket #298: 298-new-impr-64ba4ed66159.patch

File 298-new-impr-64ba4ed66159.patch, 1.5 KB (added by Peter Kovacs, 15 years ago)

A new small improvement

  • lemon/network_simplex.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1252683471 -7200
    # Node ID 64ba4ed661591e45b73eb26db1dd98dddb34b2c8
    # Parent  6d5f547e5bfb8131568ad50ea406129a056ac9ed
    Small improvements for NetworkSimplex (#298)
    
    diff --git a/lemon/network_simplex.h b/lemon/network_simplex.h
    a b  
    768768    /// This function sets the supply values of the nodes.
    769769    /// If neither this function nor \ref stSupply() is used before
    770770    /// calling \ref run(), the supply of each node will be set to zero.
    771     /// (It makes sense only if non-zero lower bounds are given.)
    772771    ///
    773772    /// \param map A node map storing the supply values.
    774773    /// Its \c Value type must be convertible to the \c Value type
     
    789788    /// and the required flow value.
    790789    /// If neither this function nor \ref supplyMap() is used before
    791790    /// calling \ref run(), the supply of each node will be set to zero.
    792     /// (It makes sense only if non-zero lower bounds are given.)
    793791    ///
    794792    /// Using this function has the same effect as using \ref supplyMap()
    795793    /// with such a map in which \c k is assigned to \c s, \c -k is
     
    944942      Number c = 0;
    945943      for (ArcIt a(_graph); a != INVALID; ++a) {
    946944        int i = _arc_id[a];
    947         c += Number(_flow[i]) * Number(_cost[i]);
     945        c += static_cast<Number>(_flow[i]) * static_cast<Number>(_cost[i]);
    948946      }
    949947      return c;
    950948    }