COIN-OR::LEMON - Graph Library

Changeset 660:edb42cb9d352 in lemon-0.x for src


Ignore:
Timestamp:
05/25/04 15:13:52 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@863
Message:

ResCap?, a map for the residual capacity in ResGraphWrapper?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/graph_wrapper.h

    r658 r660  
    14621462    }
    14631463
     1464    typedef typename Parent::Edge Edge;
     1465
    14641466    //    bool forward(const Parent::Edge& e) const { return Parent::forward(e); }
    14651467    //bool backward(const Edge& e) const { return e.backward; }
    14661468
    1467     void augment(const typename Parent::Edge& e, Number a) const {
     1469    void augment(const Edge& e, Number a) const {
    14681470      if (Parent::forward(e)) 
    14691471//      flow->set(e.out, flow->get(e.out)+a);
     
    14741476    }
    14751477
    1476     Number resCap(const typename Parent::Edge& e) const {
     1478    /// \deprecated
     1479    ///
     1480    Number resCap(const Edge& e) const {
    14771481      if (Parent::forward(e))
    14781482//      return (capacity->get(e.out)-flow->get(e.out));
     
    14831487    }
    14841488
     1489    /// \brief Residual capacity map.
     1490    ///
     1491    /// In generic residual graphs the residual capacity can be obtained as a map.
     1492    class ResCap {
     1493    protected:
     1494      const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>* res_graph;
     1495    public:
     1496      typedef Number ValueType;
     1497      typedef Edge KeyType;
     1498      ResCap(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& _res_graph) :
     1499        res_graph(&_res_graph) { }
     1500      Number operator[](const Edge& e) const {
     1501        if (res_graph->forward(e))
     1502          //    return (capacity->get(e.out)-flow->get(e.out));
     1503          return (*(res_graph->capacity))[e]-(*(res_graph->flow))[e];
     1504        else
     1505          //    return (flow->get(e.in));
     1506          return (*(res_graph->flow))[e];
     1507      }
     1508      /// \bug not needed with dynamic maps, or does it?
     1509      void update() { }
     1510    };
     1511
    14851512  };
    1486 
    1487 
    14881513
    14891514
Note: See TracChangeset for help on using the changeset viewer.