next() -> getNext()
authoralpar
Tue, 02 Mar 2004 15:45:27 +0000
changeset 14507c32a103bbb
parent 144 a1323efc5753
child 146 c4adf922624f
next() -> getNext()
goNext() -> next()
src/work/alpar/emptygraph.h
src/work/alpar/gwrapper.h
     1.1 --- a/src/work/alpar/emptygraph.h	Tue Mar 02 14:51:13 2004 +0000
     1.2 +++ b/src/work/alpar/emptygraph.h	Tue Mar 02 15:45:27 2004 +0000
     1.3 @@ -1,8 +1,9 @@
     1.4  // -*-mode: c++; -*-
     1.5  
     1.6 -class Graph
     1.7 +class EmptyGraph
     1.8  {
     1.9  public:
    1.10 +
    1.11    class EdgeIt {};
    1.12    
    1.13    class InEdgeIt : public EdgeIt {};
    1.14 @@ -18,17 +19,17 @@
    1.15    SymEdgeIt &getFirst(SymEdgeIt &, NodeIt) const {}
    1.16    EachEdgeIt &getFirst(EachEdgeIt &) const {}
    1.17  
    1.18 -  NodeIt next(NodeIt) const {}
    1.19 -  InEdgeIt next(InEdgeIt) const {}
    1.20 -  OutEdgeIt next(OutEdgeIt) const {}
    1.21 -  SymEdgeIt next(SymEdgeIt) const {}
    1.22 -  EachEdgeIt next(EachEdgeIt) const {}
    1.23 +  NodeIt getNext(NodeIt) const {}
    1.24 +  InEdgeIt getNext(InEdgeIt) const {}
    1.25 +  OutEdgeIt getNext(OutEdgeIt) const {}
    1.26 +  SymEdgeIt getNext(SymEdgeIt) const {}
    1.27 +  EachEdgeIt getNext(EachEdgeIt) const {}
    1.28  
    1.29 -  NodeIt &goNext(NodeIt &) const {}
    1.30 -  InEdgeIt &goNext(InEdgeIt &) const {}
    1.31 -  OutEdgeIt &goNext(OutEdgeIt &) const {}
    1.32 -  SymEdgeIt &goNext(SymEdgeIt &) const {}
    1.33 -  EachEdgeIt &goNext(EachEdgeIt &) const {}
    1.34 +  NodeIt &next(NodeIt &) const {}
    1.35 +  InEdgeIt &next(InEdgeIt &) const {}
    1.36 +  OutEdgeIt &next(OutEdgeIt &) const {}
    1.37 +  SymEdgeIt &next(SymEdgeIt &) const {}
    1.38 +  EachEdgeIt &next(EachEdgeIt &) const {}
    1.39  
    1.40    NodeIt head(EdgeIt) const {}
    1.41    NodeIt tail(EdgeIt) const {}
    1.42 @@ -81,3 +82,19 @@
    1.43      EdgeMap(const Graph &G, T t) {}
    1.44    };
    1.45  };
    1.46 +
    1.47 +class EmptyBipGraph : public EmptyGraph
    1.48 +{
    1.49 +  class ANodeIt {};
    1.50 +  class BNodeIt {};
    1.51 +
    1.52 +  ANodeIt &next(ANodeIt &) {}
    1.53 +  BNodeIt &next(BNodeIt &) {}
    1.54 +
    1.55 +  ANodeIt &getFirst(ANodeIt &) const {}
    1.56 +  BNodeIt &getFirst(BNodeIt &) const {}
    1.57 +
    1.58 +  enum NodeClass { A = 0, B = 1 };
    1.59 +  NodeClass getClass(NodeIt n) {}
    1.60 +
    1.61 +}
     2.1 --- a/src/work/alpar/gwrapper.h	Tue Mar 02 14:51:13 2004 +0000
     2.2 +++ b/src/work/alpar/gwrapper.h	Tue Mar 02 15:45:27 2004 +0000
     2.3 @@ -117,6 +117,61 @@
     2.4  };
     2.5  
     2.6  template<typename G>
     2.7 +class RevGraphExt : public G
     2.8 +{
     2.9 +public:
    2.10 +  //  typedef G BaseGraph;
    2.11 +
    2.12 +  typedef typename G::EdgeIt EdgeIt;
    2.13 +  
    2.14 +  typedef typename G::InEdgeIt OutEdgeIt;
    2.15 +  typedef typename G::OutEdgeIt InEdgeIt;
    2.16 +  typedef typename G::SymEdgeIt SymEdgeIt;
    2.17 +  typedef typename G::EachEdgeIt EachEdgeIt;
    2.18 +
    2.19 +  typedef typename G::NodeIt NodeIt;
    2.20 +    
    2.21 +//   template<typename I> I &getFirst(I &i); { return graph->getFirst(i); }
    2.22 +//   template<typename I,typename P> I &getFirst(I &i,const P &p);
    2.23 +//   { return graph->getFirst(i,p); }
    2.24 +//   template<typename I> I next(const I i); { return graph->goNext(i); }
    2.25 +//   template<typename I> I &goNext(I &i); { return graph->goNext(i); }
    2.26 +
    2.27 +  NodeIt head(const EdgeIt &e);
    2.28 +  { return G::tail(e); }
    2.29 +  NodeIt tail(const EdgeIt &e);
    2.30 +  { return G::head(e); }
    2.31 +  
    2.32 +//   template<typename I> NodeIt aNode(const I e);
    2.33 +//   { return graph->aNode(e); }
    2.34 +//   template<typename I> NodeIt bNode(const I e);
    2.35 +//   { return graph->bNode(e); }
    2.36 +  
    2.37 +//   template<typename I> bool valid(const I i);
    2.38 +//   { return graph->valid(i); }
    2.39 +  
    2.40 +//   template<typename I> void setInvalid(const I &i);
    2.41 +//   { return graph->setInvalid(i); }
    2.42 +  
    2.43 +//   NodeIt addNode(); { return graph->addNode(); }
    2.44 +
    2.45 +  EdgeIt addEdge(const NodeIt from,const NodeIt to);
    2.46 +  { return G::addEdge(to,from); }
    2.47 +  
    2.48 +//   template<I> void delete(I i); { graph->delete(i); }
    2.49 +  
    2.50 +//   void clean();  { graph->clean(); }
    2.51 +  
    2.52 +//   template<class T> class NodeMap : public typename G::NodeMap<T>;
    2.53 +//   template<class T> class EdgeMap : public typename G::EdgeMap<T>;
    2.54 +  
    2.55 +//   void SetG(G &g) {graph = &g;}
    2.56 +  
    2.57 +//   RevGraphWrapper() {graph = NULL;}
    2.58 +//   RevGraphWrapper(G &g) {graph = &g;}
    2.59 +};
    2.60 +
    2.61 +template<typename G>
    2.62  class SymGraphWrapper
    2.63  {
    2.64    G *graph;
    2.65 @@ -173,6 +228,23 @@
    2.66  };
    2.67  
    2.68  
    2.69 +
    2.70 +
    2.71 +
    2.72 +
    2.73 +
    2.74 +
    2.75 +
    2.76 +
    2.77 +
    2.78 +
    2.79 +
    2.80 +
    2.81 +
    2.82 +
    2.83 +
    2.84 +
    2.85 +
    2.86  // FIXME: comparison should be made better!!!
    2.87  template<typename G, typename lomap, typename fmap, typename himap>
    2.88  class ResGraphWrapper