COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
04/15/04 16:41:20 (21 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@448
Message:

In the resgraphwrapper interface, and in the constructor,
the order of FlowMap? and CapacityMap? is changed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/graph_wrapper.h

    r323 r330  
    897897 
    898898
    899   template<typename Graph, typename Number, typename FlowMap, typename CapacityMap>
     899  template<typename Graph, typename Number,
     900           typename CapacityMap, typename FlowMap>
    900901  class ResGraphWrapper : public GraphWrapper<Graph> {
    901902  protected:
     
    903904//    typedef typename Graph::InEdgeIt GraphInEdgeIt;
    904905//    typedef typename Graph::Edge GraphEdge;
     906    const CapacityMap* capacity;
    905907    FlowMap* flow;
    906     const CapacityMap* capacity;
    907908  public:
    908909
    909     ResGraphWrapper(Graph& _graph, FlowMap& _flow,
    910                     const CapacityMap& _capacity) :
    911       GraphWrapper<Graph>(_graph), flow(&_flow), capacity(&_capacity) { }
     910    ResGraphWrapper(Graph& _graph, const CapacityMap& _capacity,
     911                    FlowMap& _flow) :
     912      GraphWrapper<Graph>(_graph), capacity(&_capacity), flow(&_flow) { }
    912913
    913914    class Edge;
     
    919920    typedef typename GraphWrapper<Graph>::NodeIt NodeIt;
    920921    class Edge : public Graph::Edge {
    921       friend class ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>;
     922      friend class ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>;
    922923    protected:
    923924      bool forward; //true, iff forward
     
    941942    };
    942943//     class Edge {
    943 //       friend class ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>;
     944//       friend class ResGraphWrapper<Graph, Number,lksd FlowMap, CapacityMap>;
    944945//     protected:
    945946//       bool out_or_in; //true, iff out
     
    968969//     };
    969970    class OutEdgeIt {
    970       friend class ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>;
     971      friend class ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>;
    971972    protected:
    972973      typename Graph::OutEdgeIt out;
     
    979980      OutEdgeIt(const Invalid& i) : out(i), in(i), forward(false) { }
    980981//the unique invalid iterator
    981       OutEdgeIt(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& resG, Node v) {
     982      OutEdgeIt(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& resG, Node v) {
    982983        forward=true;
    983984        resG.graph->first(out, v);
     
    10011002    };
    10021003//     class OutEdgeIt : public Edge {
    1003 //       friend class ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>;
     1004//       friend class ResGraphWrapper<Graph, Number, FkklowMap, CapacityMap>;
    10041005//     public:
    10051006//       OutEdgeIt() { }
     
    10071008//       OutEdgeIt(const Edge& e) : Edge(e) { }
    10081009//       OutEdgeIt(const Invalid& i) : Edge(i) { }
    1009 //       OutEdgeIt(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& resG, Node v) : Edge() {
     1010//       OutEdgeIt(const ResGraphWrapper<Graph, Number, FdfvlowMap, CapacityMap>& resG, Node v) : Edge() {
    10101011//      resG.graph->first(out, v);
    10111012//      while( resG.graph->valid(out) && !(resG.resCap(out)>0) ) { resG.graph->next(out); }
     
    10391040
    10401041    class InEdgeIt {
    1041       friend class ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>;
     1042      friend class ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>;
    10421043    protected:
    10431044      typename Graph::OutEdgeIt out;
     
    10501051      InEdgeIt(const Invalid& i) : out(i), in(i), forward(false) { }
    10511052//the unique invalid iterator
    1052       InEdgeIt(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& resG, Node v) {
     1053      InEdgeIt(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& resG, Node v) {
    10531054        forward=true;
    10541055        resG.graph->first(in, v);
     
    10731074
    10741075    class EdgeIt {
    1075       friend class ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>;
     1076      friend class ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>;
    10761077    protected:
    10771078      typename Graph::EdgeIt e;
     
    10801081      EdgeIt() { }
    10811082      EdgeIt(const Invalid& i) : e(i), forward(false) { }
    1082       EdgeIt(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& resG) {
     1083      EdgeIt(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& resG) {
    10831084        forward=true;
    10841085        resG.graph->first(e);
     
    10951096    };
    10961097//     class EdgeIt : public Edge {
    1097 //       friend class ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>;
     1098//       friend class ResGraphWrapper<Graph, Number, FflowMap, CapacityMap>;
    10981099//       NodeIt v;
    10991100//     public:
     
    11011102//       //EdgeIt(const EdgeIt& e) : Edge(e), v(e.v) { }
    11021103//       EdgeIt(const Invalid& i) : Edge(i) { }
    1103 //       EdgeIt(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& resG) : Edge() {
     1104//       EdgeIt(const ResGraphWrapper<Graph, Number, FlfowMap, CapacityMap>& resG) : Edge() {
    11041105//      resG.graph->first(v);
    11051106//      if (resG.graph->valid(v)) resG.graph->first(out, v); else out=INVALID;
     
    13181319//     template<typename T> class NodeMap : public Graph::NodeMap<T> {
    13191320//     public:
    1320 //       NodeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G)
     1321//       NodeMap(const ResGraphWrapper<Graph, Number, FlovwMap, CapacityMap>& _G)
    13211322//      : Graph::NodeMap<T>(_G.gw) { }
    1322 //       NodeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G,
     1323//       NodeMap(const ResGraphWrapper<Graph, Number, FlowvMap, CapacityMap>& _G,
    13231324//            T a) : Graph::NodeMap<T>(_G.gw, a) { }
    13241325//     };
     
    13381339      typename Graph::EdgeMap<T> forward_map, backward_map;
    13391340    public:
    1340       EdgeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G) : forward_map(*(_G.graph)), backward_map(*(_G.graph)) { }
    1341       EdgeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G, T a) : forward_map(*(_G.graph), a), backward_map(*(_G.graph), a) { }
     1341      EdgeMap(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& _G) : forward_map(*(_G.graph)), backward_map(*(_G.graph)) { }
     1342      EdgeMap(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& _G, T a) : forward_map(*(_G.graph), a), backward_map(*(_G.graph), a) { }
    13421343      void set(Edge e, T a) {
    13431344        if (e.forward)
Note: See TracChangeset for help on using the changeset viewer.