equal
deleted
inserted
replaced
73 |
73 |
74 public: |
74 public: |
75 |
75 |
76 /// \brief The type of the flow map. |
76 /// \brief The type of the flow map. |
77 typedef typename Graph::template EdgeMap<Capacity> FlowMap; |
77 typedef typename Graph::template EdgeMap<Capacity> FlowMap; |
|
78 typedef typename CostMap::Value Cost; |
78 |
79 |
79 private: |
80 private: |
80 |
81 |
81 /// \brief The directed graph the algorithm runs on. |
82 /// \brief The directed graph the algorithm runs on. |
82 const Graph &graph; |
83 const Graph &graph; |
131 /// function is \f$ O(e) \f$. |
132 /// function is \f$ O(e) \f$. |
132 /// |
133 /// |
133 /// \pre \ref run() must be called before using this function. |
134 /// \pre \ref run() must be called before using this function. |
134 Cost totalCost() const { |
135 Cost totalCost() const { |
135 Cost c = 0; |
136 Cost c = 0; |
136 for (EdgeIt e(graph); e != INVALID; ++e) |
137 for (typename Graph::EdgeIt e(graph); e != INVALID; ++e) |
137 c += flow[e] * cost[e]; |
138 c += flow[e] * cost[e]; |
138 return c; |
139 return c; |
139 } |
140 } |
140 |
141 |
141 /// \brief Runs the algorithm. |
142 /// \brief Runs the algorithm. |