diff -r c86db0f7f917 -r a8081c9cd96a lemon/network_simplex.h --- a/lemon/network_simplex.h Thu Nov 08 14:21:28 2007 +0000 +++ b/lemon/network_simplex.h Wed Nov 14 06:28:08 2007 +0000 @@ -26,8 +26,9 @@ /// flow. #include +#include +#include #include -#include /// \brief The pivot rule used in the algorithm. //#define FIRST_ELIGIBLE_PIVOT @@ -85,7 +86,7 @@ /// \warning /// - Edge capacities and costs should be nonnegative integers. /// However \c CostMap::Value should be signed type. - /// - Supply values should be integers. + /// - Supply values should be signed integers. /// - \c LowerMap::Value must be convertible to /// \c CapacityMap::Value and \c CapacityMap::Value must be /// convertible to \c SupplyMap::Value. @@ -148,15 +149,12 @@ public: - typedef typename MapBase::Value Value; - typedef typename MapBase::Key Key; - ReducedCostMap( const SGraph &_gr, const SCostMap &_cm, const SPotentialMap &_pm ) : gr(_gr), cost_map(_cm), pot_map(_pm) {} - Value operator[](const Key &e) const { + Cost operator[](const Edge &e) const { return cost_map[e] - pot_map[gr.source(e)] + pot_map[gr.target(e)]; }