.
authormarci
Mon, 22 Mar 2004 17:05:08 +0000
changeset 235aa50acc936dc
parent 234 348f8fd374ee
child 236 ea3de9530ee8
.
src/work/marci/graph_wrapper.h
     1.1 --- a/src/work/marci/graph_wrapper.h	Mon Mar 22 16:37:10 2004 +0000
     1.2 +++ b/src/work/marci/graph_wrapper.h	Mon Mar 22 17:05:08 2004 +0000
     1.3 @@ -240,88 +240,99 @@
     1.4  //     };
     1.5  //   };
     1.6  
     1.7 -  template<typename /*Graph*/GraphWrapper
     1.8 -  /*=typename GraphWrapperSkeleton< TrivGraphWrapper<Graph>*/ >
     1.9 -  class RevGraphWrapper : 
    1.10 -    public GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/ {
    1.11 -  protected:
    1.12 -    //Graph* graph;
    1.13 +//   template<typename /*Graph*/GraphWrapper
    1.14 +//   /*=typename GraphWrapperSkeleton< TrivGraphWrapper<Graph>*/ >
    1.15 +//   class RevGraphWrapper : 
    1.16 +//     public GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/ {
    1.17 +//   protected:
    1.18 +//     //Graph* graph;
    1.19      
    1.20 +//   public:
    1.21 +//     //typedef Graph BaseGraph;
    1.22 +
    1.23 +//     //typedef typename Graph::Node Node;    
    1.24 +//     //typedef typename Graph::NodeIt NodeIt;
    1.25 +  
    1.26 +//     //typedef typename Graph::Edge Edge;
    1.27 +//     typedef typename GraphWrapper/*typename GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/::OutEdgeIt InEdgeIt;
    1.28 +//     typedef typename GraphWrapper/*typename GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/::InEdgeIt OutEdgeIt;
    1.29 +//     //typedef typename Graph::SymEdgeIt SymEdgeIt;
    1.30 +//     //typedef typename Graph::EdgeIt EdgeIt;
    1.31 +
    1.32 +//     //RevGraphWrapper() : graph(0) { }
    1.33 +//     RevGraphWrapper(GraphWrapper _gw/*BaseGraph& _graph*/) : GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/(_gw/*TrivGraphWrapper<Graph>(_graph)*/) { }
    1.34 +    
    1.35 +//     //void setGraph(Graph& _graph) { graph = &_graph; }
    1.36 +//     //Graph& getGraph() const { return (*graph); }
    1.37 +    
    1.38 +//     //template<typename I> I& first(I& i) const { return graph->first(i); }
    1.39 +//     //template<typename I, typename P> I& first(I& i, const P& p) const { 
    1.40 +//     //  return graph->first(i, p); }
    1.41 +
    1.42 +//     //template<typename I> I getNext(const I& i) const { 
    1.43 +//     //  return graph->getNext(i); }
    1.44 +//     //template<typename I> I& next(I &i) const { return graph->next(i); }    
    1.45 +
    1.46 +//     //template< typename It > It first() const { 
    1.47 +//     //  It e; first(e); return e; }
    1.48 +
    1.49 +//     //template< typename It > It first(const Node& v) const { 
    1.50 +//     //  It e; first(e, v); return e; }
    1.51 +
    1.52 +//     //Node head(const Edge& e) const { return graph->tail(e); }
    1.53 +//     //Node tail(const Edge& e) const { return graph->head(e); }
    1.54 +  
    1.55 +//     //template<typename I> bool valid(const I& i) const 
    1.56 +//     //  { return graph->valid(i); }
    1.57 +  
    1.58 +//     //template<typename I> void setInvalid(const I &i);
    1.59 +//     //{ return graph->setInvalid(i); }
    1.60 +  
    1.61 +//     //template<typename I> Node aNode(const I& e) const { 
    1.62 +//     //  return graph->aNode(e); }
    1.63 +//     //template<typename I> Node bNode(const I& e) const { 
    1.64 +//     //  return graph->bNode(e); }
    1.65 +
    1.66 +//     //Node addNode() const { return graph->addNode(); }
    1.67 +//     //Edge addEdge(const Node& tail, const Node& head) const { 
    1.68 +//     //  return graph->addEdge(tail, head); }
    1.69 +  
    1.70 +//     //int nodeNum() const { return graph->nodeNum(); }
    1.71 +//     //int edgeNum() const { return graph->edgeNum(); }
    1.72 +  
    1.73 +//     //template<typename I> void erase(const I& i) const { graph->erase(i); }
    1.74 +  
    1.75 +//     //void clear() const { graph->clear(); }
    1.76 +
    1.77 +//     template<typename T> class NodeMap : 
    1.78 +//       public GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T> 
    1.79 +//     { 
    1.80 +//     public:
    1.81 +//       NodeMap(const RevGraphWrapper<GraphWrapper>& _gw) : 
    1.82 +// 	GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw) { }
    1.83 +//       NodeMap(const RevGraphWrapper<GraphWrapper>& _gw, T a) : 
    1.84 +// 	GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw, a) { }
    1.85 +//     };
    1.86 +    
    1.87 +//     template<typename T> class EdgeMap : 
    1.88 +//       public GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T> { 
    1.89 +//     public:
    1.90 +//       EdgeMap(const RevGraphWrapper<GraphWrapper>& _gw) : 
    1.91 +// 	GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw) { }
    1.92 +//       EdgeMap(const RevGraphWrapper<GraphWrapper>& _gw, T a) : 
    1.93 +// 	GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw, a) { }
    1.94 +//     };
    1.95 +//   };
    1.96 +
    1.97 +
    1.98 +  template<typename GraphWrapper>
    1.99 +  class RevGraphWrapper : public GraphWrapperSkeleton<GraphWrapper> {
   1.100    public:
   1.101 -    //typedef Graph BaseGraph;
   1.102 -
   1.103 -    //typedef typename Graph::Node Node;    
   1.104 -    //typedef typename Graph::NodeIt NodeIt;
   1.105 -  
   1.106 -    //typedef typename Graph::Edge Edge;
   1.107 -    typedef typename GraphWrapper/*typename GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/::OutEdgeIt InEdgeIt;
   1.108 -    typedef typename GraphWrapper/*typename GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/::InEdgeIt OutEdgeIt;
   1.109 -    //typedef typename Graph::SymEdgeIt SymEdgeIt;
   1.110 -    //typedef typename Graph::EdgeIt EdgeIt;
   1.111 -
   1.112 -    //RevGraphWrapper() : graph(0) { }
   1.113 -    RevGraphWrapper(GraphWrapper _gw/*BaseGraph& _graph*/) : GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/(_gw/*TrivGraphWrapper<Graph>(_graph)*/) { }
   1.114 +    typedef typename GraphWrapperSkeleton<GraphWrapper>::OutEdgeIt InEdgeIt;
   1.115 +    typedef typename GraphWrapperSkeleton<GraphWrapper>::InEdgeIt OutEdgeIt;
   1.116      
   1.117 -    //void setGraph(Graph& _graph) { graph = &_graph; }
   1.118 -    //Graph& getGraph() const { return (*graph); }
   1.119 -    
   1.120 -    //template<typename I> I& first(I& i) const { return graph->first(i); }
   1.121 -    //template<typename I, typename P> I& first(I& i, const P& p) const { 
   1.122 -    //  return graph->first(i, p); }
   1.123 -
   1.124 -    //template<typename I> I getNext(const I& i) const { 
   1.125 -    //  return graph->getNext(i); }
   1.126 -    //template<typename I> I& next(I &i) const { return graph->next(i); }    
   1.127 -
   1.128 -    //template< typename It > It first() const { 
   1.129 -    //  It e; first(e); return e; }
   1.130 -
   1.131 -    //template< typename It > It first(const Node& v) const { 
   1.132 -    //  It e; first(e, v); return e; }
   1.133 -
   1.134 -    //Node head(const Edge& e) const { return graph->tail(e); }
   1.135 -    //Node tail(const Edge& e) const { return graph->head(e); }
   1.136 -  
   1.137 -    //template<typename I> bool valid(const I& i) const 
   1.138 -    //  { return graph->valid(i); }
   1.139 -  
   1.140 -    //template<typename I> void setInvalid(const I &i);
   1.141 -    //{ return graph->setInvalid(i); }
   1.142 -  
   1.143 -    //template<typename I> Node aNode(const I& e) const { 
   1.144 -    //  return graph->aNode(e); }
   1.145 -    //template<typename I> Node bNode(const I& e) const { 
   1.146 -    //  return graph->bNode(e); }
   1.147 -
   1.148 -    //Node addNode() const { return graph->addNode(); }
   1.149 -    //Edge addEdge(const Node& tail, const Node& head) const { 
   1.150 -    //  return graph->addEdge(tail, head); }
   1.151 -  
   1.152 -    //int nodeNum() const { return graph->nodeNum(); }
   1.153 -    //int edgeNum() const { return graph->edgeNum(); }
   1.154 -  
   1.155 -    //template<typename I> void erase(const I& i) const { graph->erase(i); }
   1.156 -  
   1.157 -    //void clear() const { graph->clear(); }
   1.158 -
   1.159 -    template<typename T> class NodeMap : 
   1.160 -      public GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T> 
   1.161 -    { 
   1.162 -    public:
   1.163 -      NodeMap(const RevGraphWrapper<GraphWrapper>& _gw) : 
   1.164 -	GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw) { }
   1.165 -      NodeMap(const RevGraphWrapper<GraphWrapper>& _gw, T a) : 
   1.166 -	GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw, a) { }
   1.167 -    };
   1.168 -    
   1.169 -    template<typename T> class EdgeMap : 
   1.170 -      public GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T> { 
   1.171 -    public:
   1.172 -      EdgeMap(const RevGraphWrapper<GraphWrapper>& _gw) : 
   1.173 -	GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw) { }
   1.174 -      EdgeMap(const RevGraphWrapper<GraphWrapper>& _gw, T a) : 
   1.175 -	GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw, a) { }
   1.176 -    };
   1.177 +    RevGraphWrapper(GraphWrapper _gw) : 
   1.178 +      GraphWrapperSkeleton<GraphWrapper>(_gw) { }  
   1.179    };
   1.180  
   1.181