COIN-OR::LEMON - Graph Library

Changeset 658:b3564d0e9c60 in lemon-0.x for src/hugo


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

ResGraphWrapper? pretected default constructor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/graph_wrapper.h

    r656 r658  
    13761376  template<typename Graph, typename Number,
    13771377           typename CapacityMap, typename FlowMap>
    1378   class ForwardFilter {
    1379     const Graph* graph;
     1378  class ResForwardFilter {
     1379    //    const Graph* graph;
    13801380    const CapacityMap* capacity;
    13811381    const FlowMap* flow;
    13821382  public:
    1383     void setGraph(const Graph& _graph) { graph=&_graph; }
     1383    ResForwardFilter(/*const Graph& _graph, */
     1384                     const CapacityMap& _capacity, const FlowMap& _flow) :
     1385      /*graph(&_graph),*/ capacity(&_capacity), flow(&_flow) { }
     1386    ResForwardFilter() : /*graph(0),*/ capacity(0), flow(0) { }
     1387    //void setGraph(const Graph& _graph) { graph=&_graph; }
    13841388    void setCapacity(const CapacityMap& _capacity) { capacity=&_capacity; }
    13851389    void setFlow(const FlowMap& _flow) { flow=&_flow; }
    1386     ForwardFilter(const Graph& _graph,
    1387                   const CapacityMap& _capacity, const FlowMap& _flow) :
    1388       graph(&_graph), capacity(&_capacity), flow(&_flow) { }
    13891390    bool operator[](const typename Graph::Edge& e) const {
    13901391      return ((*flow)[e] < (*capacity)[e]);
     
    13941395  template<typename Graph, typename Number,
    13951396           typename CapacityMap, typename FlowMap>
    1396   class BackwardFilter {
    1397     const Graph* graph;
     1397  class ResBackwardFilter {
     1398    //const Graph* graph;
    13981399    const CapacityMap* capacity;
    13991400    const FlowMap* flow;
    14001401  public:
    1401     void setGraph(const Graph& _graph) { graph=&_graph; }
     1402    ResBackwardFilter(/*const Graph& _graph,*/
     1403                      const CapacityMap& _capacity, const FlowMap& _flow) :
     1404      /*graph(&_graph),*/ capacity(&_capacity), flow(&_flow) { }
     1405    ResBackwardFilter() : /*graph(0),*/ capacity(0), flow(0) { }
     1406    //void setGraph(const Graph& _graph) { graph=&_graph; }
    14021407    void setCapacity(const CapacityMap& _capacity) { capacity=&_capacity; }
    14031408    void setFlow(const FlowMap& _flow) { flow=&_flow; }
    1404     BackwardFilter(const Graph& _graph,
    1405                    const CapacityMap& _capacity, const FlowMap& _flow) :
    1406       graph(&_graph), capacity(&_capacity), flow(&_flow) { }
    14071409    bool operator[](const typename Graph::Edge& e) const {
    14081410      return (0 < (*flow)[e]);
     
    14191421    public SubBidirGraphWrapper<
    14201422    Graph,
    1421     ForwardFilter<Graph, Number, CapacityMap, FlowMap>, 
    1422     BackwardFilter<Graph, Number, CapacityMap, FlowMap> > {
     1423    ResForwardFilter<Graph, Number, CapacityMap, FlowMap>, 
     1424    ResBackwardFilter<Graph, Number, CapacityMap, FlowMap> > {
    14231425  public:
    14241426    typedef SubBidirGraphWrapper<
    14251427      Graph,
    1426       ForwardFilter<Graph, Number, CapacityMap, FlowMap>, 
    1427       BackwardFilter<Graph, Number, CapacityMap, FlowMap> > Parent;
     1428      ResForwardFilter<Graph, Number, CapacityMap, FlowMap>, 
     1429      ResBackwardFilter<Graph, Number, CapacityMap, FlowMap> > Parent;
    14281430  protected:
    14291431    const CapacityMap* capacity;
    14301432    FlowMap* flow;
    1431     ForwardFilter<Graph, Number, CapacityMap, FlowMap> forward_filter;
    1432     BackwardFilter<Graph, Number, CapacityMap, FlowMap> backward_filter;
    1433 //     ResGraphWrapper() : Parent(),
    1434 //                      capacity(0), flow(0) { }
    1435 //     void setCapacityMap(const CapacityMap& _capacity) {
    1436 //       capacity=&_capacity;
    1437 //     }
    1438 //     void setFlowMap(FlowMap& _flow) {
    1439 //       flow=&_flow;
     1433    ResForwardFilter<Graph, Number, CapacityMap, FlowMap> forward_filter;
     1434    ResBackwardFilter<Graph, Number, CapacityMap, FlowMap> backward_filter;
     1435    ResGraphWrapper() : Parent(),
     1436                        capacity(0), flow(0) { }
     1437    void setCapacityMap(const CapacityMap& _capacity) {
     1438      capacity=&_capacity;
     1439      forward_filter.setCapacity(_capacity);
     1440      backward_filter.setCapacity(_capacity);
     1441    }
     1442    void setFlowMap(FlowMap& _flow) {
     1443      flow=&_flow;
     1444      forward_filter.setFlow(_flow);
     1445      backward_filter.setFlow(_flow);
     1446    }
     1447//     /// \bug does graph reference needed in filtermaps??
     1448//     void setGraph(const Graph& _graph) {
     1449//       Parent::setGraph(_graph);
     1450//       forward_filter.setGraph(_graph);
     1451//       backward_filter.setGraph(_graph);
    14401452//     }
    14411453  public:
     
    14431455                       FlowMap& _flow) :
    14441456      Parent(), capacity(&_capacity), flow(&_flow),
    1445       forward_filter(_graph, _capacity, _flow),
    1446       backward_filter(_graph, _capacity, _flow) {
     1457      forward_filter(/*_graph,*/ _capacity, _flow),
     1458      backward_filter(/*_graph,*/ _capacity, _flow) {
    14471459      Parent::setGraph(_graph);
    14481460      Parent::setForwardFilterMap(forward_filter);
Note: See TracChangeset for help on using the changeset viewer.