138 /// |
138 /// |
139 /// Returns a const reference to the edge map storing the found flow. |
139 /// Returns a const reference to the edge map storing the found flow. |
140 /// |
140 /// |
141 /// \pre \ref run() must be called before using this function. |
141 /// \pre \ref run() must be called before using this function. |
142 const FlowMap& flowMap() const { |
142 const FlowMap& flowMap() const { |
143 return _flow_result; |
143 return _flow; |
144 } |
144 } |
145 |
145 |
146 /// \brief Returns a const reference to the node map storing the |
146 /// \brief Returns a const reference to the node map storing the |
147 /// found potentials (the dual solution). |
147 /// found potentials (the dual solution). |
148 /// |
148 /// |
149 /// Returns a const reference to the node map storing the found |
149 /// Returns a const reference to the node map storing the found |
150 /// potentials (the dual solution). |
150 /// potentials (the dual solution). |
151 /// |
151 /// |
152 /// \pre \ref run() must be called before using this function. |
152 /// \pre \ref run() must be called before using this function. |
153 const PotentialMap& potentialMap() const { |
153 const PotentialMap& potentialMap() const { |
154 return _potential_result; |
154 return _potential; |
155 } |
155 } |
156 |
156 |
157 /// \brief Returns the total cost of the found flow. |
157 /// \brief Returns the total cost of the found flow. |
158 /// |
158 /// |
159 /// Returns the total cost of the found flow. The complexity of the |
159 /// Returns the total cost of the found flow. The complexity of the |
160 /// function is \f$ O(e) \f$. |
160 /// function is \f$ O(e) \f$. |
161 /// |
161 /// |
162 /// \pre \ref run() must be called before using this function. |
162 /// \pre \ref run() must be called before using this function. |
163 Cost totalCost() const { |
163 Cost totalCost() const { |
164 Cost c = 0; |
164 Cost c = 0; |
165 for (typename Graph::EdgeIt e(graph); e != INVALID; ++e) |
165 for (typename Graph::EdgeIt e(_graph); e != INVALID; ++e) |
166 c += _flow[e] * _cost[e]; |
166 c += _flow[e] * _cost[e]; |
167 return c; |
167 return c; |
168 } |
168 } |
169 |
169 |
170 }; //class MinCostMaxFlow |
170 }; //class MinCostMaxFlow |