COIN-OR::LEMON - Graph Library

Ticket #266: circ-ea2c9187404a.patch

File circ-ea2c9187404a.patch, 2.0 KB (added by Peter Kovacs, 16 years ago)
  • lemon/circulation.h

    # 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  
    151151     the direction of the arcs and taking the negative of the supply values
    152152     (e.g. using \ref ReverseDigraph and \ref NegMap adaptors).
    153153
     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
    154158     Note that this algorithm also provides a feasible solution for the
    155159     \ref min_cost_flow "minimum cost flow problem".
    156160
     
    380384
    381385    /// Sets the upper bound (capacity) map.
    382386    /// \return <tt>(*this)</tt>
    383     Circulation& upperMap(const LowerMap& map) {
     387    Circulation& upperMap(const UpperMap& map) {
    384388      _up = &map;
    385389      return *this;
    386390    }
    387391
     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 = &map;
     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
    388411    /// Sets the supply map.
    389412
    390413    /// Sets the supply map.
  • test/circulation_test.cc

    diff --git a/test/circulation_test.cc b/test/circulation_test.cc
    a b  
    8585  circ_test
    8686    .lowerMap(lcap)
    8787    .upperMap(ucap)
     88    .capacityMap(ucap)
     89    .boundMaps(lcap, ucap)
    8890    .supplyMap(supply)
    8991    .flowMap(flow);
    9092