COIN-OR::LEMON - Graph Library

Changeset 64:72bd463289a9 in lemon-0.x for src/work/edmonds_karp.hh


Ignore:
Timestamp:
02/05/04 16:06:45 (17 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@79
Message:

.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/edmonds_karp.hh

    r59 r64  
    4242      }
    4343      bool valid() const { return sym.valid(); }
    44       void augment(const T a) const {
     44      void augment(T a) const {
    4545        if (resG->G.aNode(sym)==resG->G.tail(sym)) {
    4646          resG->flow.set(sym, resG->flow.get(sym)+a);
     
    5757      //OutEdgeIt(const OutEdgeIt& e) { resG=e.resG; sym=e.sym; }
    5858    private:
    59       OutEdgeIt(const ResGraph<Graph, T, FlowMap, CapacityMap>& _resG, const NodeIt v) {
     59      OutEdgeIt(const ResGraph<Graph, T, FlowMap, CapacityMap>& _resG, NodeIt v) {
    6060        resG=&_resG;
    6161        sym=resG->G.template first<OldSymEdgeIt>(v);
     
    7070    };
    7171
    72     void getFirst(OutEdgeIt& e, const NodeIt v) const {
     72    void getFirst(OutEdgeIt& e, NodeIt v) const {
    7373      e=OutEdgeIt(*this, v);
    7474    }
     
    8383
    8484    template< typename It >
    85     It first(const NodeIt v) const {
     85    It first(NodeIt v) const {
    8686      It e;
    8787      getFirst(e, v);
     
    8989    }
    9090
    91     NodeIt tail(const EdgeIt e) const { return G.aNode(e.sym); }
    92     NodeIt head(const EdgeIt e) const { return G.bNode(e.sym); }
    93 
    94     NodeIt aNode(const OutEdgeIt e) const { return G.aNode(e.sym); }
    95     NodeIt bNode(const OutEdgeIt e) const { return G.bNode(e.sym); }
    96 
    97     int id(const NodeIt v) const { return G.id(v); }
     91    NodeIt tail(EdgeIt e) const { return G.aNode(e.sym); }
     92    NodeIt head(EdgeIt e) const { return G.bNode(e.sym); }
     93
     94    NodeIt aNode(OutEdgeIt e) const { return G.aNode(e.sym); }
     95    NodeIt bNode(OutEdgeIt e) const { return G.bNode(e.sym); }
     96
     97    int id(NodeIt v) const { return G.id(v); }
    9898
    9999    template <typename ValueType>
     
    102102    public:
    103103      NodeMap(const ResGraph<Graph, T, FlowMap, CapacityMap>& _G) : node_map(_G.G) { }
    104       NodeMap(const ResGraph<Graph, T, FlowMap, CapacityMap>& _G, const ValueType a) : node_map(_G.G, a) { }
    105       void set(const NodeIt nit, const ValueType a) { node_map.set(nit, a); }
    106       ValueType get(const NodeIt nit) const { return node_map.get(nit); }
     104      NodeMap(const ResGraph<Graph, T, FlowMap, CapacityMap>& _G, ValueType a) : node_map(_G.G, a) { }
     105      void set(NodeIt nit, ValueType a) { node_map.set(nit, a); }
     106      ValueType get(NodeIt nit) const { return node_map.get(nit); }
    107107    };
    108108
     
    117117    typedef typename Graph::InEdgeIt InEdgeIt;
    118118    const Graph& G;
    119     const NodeIt s;
    120     const NodeIt t;
     119    NodeIt s;
     120    NodeIt t;
    121121    FlowMap& flow;
    122122    const CapacityMap& capacity;
     
    125125    typedef typename AugGraph::EdgeIt AugEdgeIt;
    126126  public:
    127     MaxFlow(const Graph& _G, const NodeIt _s, const NodeIt _t, FlowMap& _flow, const CapacityMap& _capacity) : G(_G), s(_s), t(_t), flow(_flow), capacity(_capacity) { }
     127    MaxFlow(const Graph& _G, NodeIt _s, NodeIt _t, FlowMap& _flow, const CapacityMap& _capacity) : G(_G), s(_s), t(_t), flow(_flow), capacity(_capacity) { }
    128128    bool augment() {
    129129      AugGraph res_graph(G, flow, capacity);
Note: See TracChangeset for help on using the changeset viewer.