# HG changeset patch
# User Peter Kovacs <kpeter@inf.elte.hu>
# Date 1240604282 -7200
# Node ID ea2c9187404a7cd2dbcf4e2c93dcdc30807188f2
# Parent 547e6b876ee16dec1a965c114282dc5be05e75ba
Add two functions to Circulation + bug fix (#266)
- Add capacityMap() as an alias for upperMap().
- Add boundMaps() as an alternative for lowerMap() + upperMap().
- A bug fix in upperMap().
- Doc improvement.
diff --git a/lemon/circulation.h b/lemon/circulation.h
a
|
b
|
|
151 | 151 | the direction of the arcs and taking the negative of the supply values |
152 | 152 | (e.g. using \ref ReverseDigraph and \ref NegMap adaptors). |
153 | 153 | |
| 154 | This algorithm either calculates a feasible circulation, or provides |
| 155 | a \ref barrier() "barrier", which prooves that a feasible soultion |
| 156 | cannot exist. |
| 157 | |
154 | 158 | Note that this algorithm also provides a feasible solution for the |
155 | 159 | \ref min_cost_flow "minimum cost flow problem". |
156 | 160 | |
… |
… |
|
380 | 384 | |
381 | 385 | /// Sets the upper bound (capacity) map. |
382 | 386 | /// \return <tt>(*this)</tt> |
383 | | Circulation& upperMap(const LowerMap& map) { |
| 387 | Circulation& upperMap(const UpperMap& map) { |
384 | 388 | _up = ↦ |
385 | 389 | return *this; |
386 | 390 | } |
387 | 391 | |
| 392 | /// Sets the upper bound (capacity) map. |
| 393 | |
| 394 | /// Sets the upper bound (capacity) map. |
| 395 | /// \return <tt>(*this)</tt> |
| 396 | Circulation& capacityMap(const UpperMap& map) { |
| 397 | _up = ↦ |
| 398 | return *this; |
| 399 | } |
| 400 | |
| 401 | /// Sets the lower and upper bound maps. |
| 402 | |
| 403 | /// Sets the lower and upper bound maps. |
| 404 | /// \return <tt>(*this)</tt> |
| 405 | Circulation& boundMaps(const LowerMap& lower, const UpperMap& upper) { |
| 406 | _lo = &lower; |
| 407 | _up = &upper; |
| 408 | return *this; |
| 409 | } |
| 410 | |
388 | 411 | /// Sets the supply map. |
389 | 412 | |
390 | 413 | /// Sets the supply map. |
diff --git a/test/circulation_test.cc b/test/circulation_test.cc
a
|
b
|
|
85 | 85 | circ_test |
86 | 86 | .lowerMap(lcap) |
87 | 87 | .upperMap(ucap) |
| 88 | .capacityMap(ucap) |
| 89 | .boundMaps(lcap, ucap) |
88 | 90 | .supplyMap(supply) |
89 | 91 | .flowMap(flow); |
90 | 92 | |