Step toward to a standardised graph interface.
authoralpar
Tue, 02 Mar 2004 20:40:39 +0000
changeset 147f3f1d7a4a8d3
parent 146 c4adf922624f
child 148 004fdf703abb
Step toward to a standardised graph interface.
src/work/alpar/emptygraph.h
src/work/alpar/gwrapper.h
     1.1 --- a/src/work/alpar/emptygraph.h	Tue Mar 02 18:24:00 2004 +0000
     1.2 +++ b/src/work/alpar/emptygraph.h	Tue Mar 02 20:40:39 2004 +0000
     1.3 @@ -4,46 +4,77 @@
     1.4  {
     1.5  public:
     1.6  
     1.7 -  class EdgeIt {};
     1.8 +  class NodeIt {
     1.9 +  public:
    1.10 +    NodeIt() {}   //FIXME
    1.11 +    //NodeIt(const NodeIt &) {} 
    1.12 +    bool operator==(NodeIt n) const {} //FIXME
    1.13 +    bool operator!=(NodeIt n) const {} //FIXME
    1.14 +  };
    1.15 +    
    1.16 +  class EachNodeIt : public NodeIt {
    1.17 +  public:
    1.18 +    EachNodeIt() {} //FIXME
    1.19 +    EachNodeIt(const EmptyGraph &) const {}
    1.20 +    EachNodeIt(const EachNodeIt &) const {} //FIXME
    1.21 +  };
    1.22 +    
    1.23 +  class EdgeIt {
    1.24 +    EdgeIt() {}   //FIXME
    1.25 +    //EdgeIt(const EdgeIt &) {} 
    1.26 +    bool operator==(EdgeIt n) const {} //FIXME
    1.27 +    bool operator!=(EdgeIt n) const {} //FIXME    
    1.28 +  };
    1.29    
    1.30 -  class InEdgeIt : public EdgeIt {};
    1.31 -  class OutEdgeIt : public EdgeIt {};
    1.32 -  class SymEdgeIt : public EdgeIt {};
    1.33 -  class EachEdgeIt : public EdgeIt {};
    1.34 +  class OutEdgeIt : public EdgeIt {
    1.35 +    OutEdgeIt() {}
    1.36 +    OutEdgeIt(const EmptyGraph &, NodeIt) {}
    1.37 +  };
    1.38  
    1.39 -  class NodeIt {};
    1.40 -    
    1.41 -  NodeIt &getFirst(NodeIt &) const {}
    1.42 +  class InEdgeIt : public EdgeIt {
    1.43 +    InEdgeIt() {}
    1.44 +    InEdgeIt(const EmptyGraph &, NodeIt) {}    
    1.45 +  };
    1.46 +  //  class SymEdgeIt : public EdgeIt {};
    1.47 +  class EachEdgeIt : public EdgeIt {
    1.48 +    EachEdgeIt() {}
    1.49 +    EachEdgeIt(const EmptyGraph &, NodeIt) {}
    1.50 +  };
    1.51 +
    1.52 +  EachNodeIt &getFirst(EachNodeIt &) const {}
    1.53    InEdgeIt &getFirst(InEdgeIt &, NodeIt) const {}
    1.54    OutEdgeIt &getFirst(OutEdgeIt &, NodeIt) const {}
    1.55 -  SymEdgeIt &getFirst(SymEdgeIt &, NodeIt) const {}
    1.56 +  //  SymEdgeIt &getFirst(SymEdgeIt &, NodeIt) const {}
    1.57    EachEdgeIt &getFirst(EachEdgeIt &) const {}
    1.58  
    1.59    NodeIt getNext(NodeIt) const {}
    1.60    InEdgeIt getNext(InEdgeIt) const {}
    1.61    OutEdgeIt getNext(OutEdgeIt) const {}
    1.62 -  SymEdgeIt getNext(SymEdgeIt) const {}
    1.63 +  //SymEdgeIt getNext(SymEdgeIt) const {}
    1.64    EachEdgeIt getNext(EachEdgeIt) const {}
    1.65  
    1.66    NodeIt &next(NodeIt &) const {}
    1.67    InEdgeIt &next(InEdgeIt &) const {}
    1.68    OutEdgeIt &next(OutEdgeIt &) const {}
    1.69 -  SymEdgeIt &next(SymEdgeIt &) const {}
    1.70 +  //SymEdgeIt &next(SymEdgeIt &) const {}
    1.71    EachEdgeIt &next(EachEdgeIt &) const {}
    1.72  
    1.73    NodeIt head(EdgeIt) const {}
    1.74    NodeIt tail(EdgeIt) const {}
    1.75    
    1.76 -  NodeIt aNode(InEdgeIt) const {}
    1.77 -  NodeIt aNode(OutEdgeIt) const {}
    1.78 -  NodeIt aNode(SymEdgeIt) const {}
    1.79 +//   NodeIt aNode(InEdgeIt) const {}
    1.80 +//   NodeIt aNode(OutEdgeIt) const {}
    1.81 +//   NodeIt aNode(SymEdgeIt) const {}
    1.82  
    1.83 -  NodeIt bNode(InEdgeIt) const {}
    1.84 -  NodeIt bNode(OutEdgeIt) const {}
    1.85 -  NodeIt bNode(SymEdgeIt) const {}
    1.86 +//   NodeIt bNode(InEdgeIt) const {}
    1.87 +//   NodeIt bNode(OutEdgeIt) const {}
    1.88 +//   NodeIt bNode(SymEdgeIt) const {}
    1.89  
    1.90 -  //bool valid(const NodeIt) const {};
    1.91 -  //bool valid(const EdgeIt) const {};
    1.92 +  bool valid(const NodeIt) const {};
    1.93 +  bool valid(const EdgeIt) const {};
    1.94 +
    1.95 +  int id(const NodeIt) const {};
    1.96 +  int id(const EdgeIt) const {};
    1.97  
    1.98    //void setInvalid(NodeIt &) const {};
    1.99    //void setInvalid(EdgeIt &) const {};
   1.100 @@ -56,17 +87,25 @@
   1.101  
   1.102    void clear() {}
   1.103  
   1.104 +  int nodeNum() {}
   1.105 +  int edgeNum() {}
   1.106 +
   1.107    template<class T> class NodeMap
   1.108    {
   1.109    public:
   1.110      typedef T ValueType;
   1.111      typedef NodeIt KeyType;
   1.112 -    void set(NodeIt i, T t) {}
   1.113 -    T get(NodeIt i) const {}
   1.114 -    T &operator[](NodeIt i) {}
   1.115 -      
   1.116 +
   1.117      NodeMap(const Graph &G) {}
   1.118      NodeMap(const Graph &G, T t) {}
   1.119 +
   1.120 +    void set(NodeIt i, T t) {}
   1.121 +    T get(NodeIt i) const {}  //FIXME: Is it necessary
   1.122 +    T &operator[](NodeIt i) {}
   1.123 +    const T &operator[](NodeIt i) const {}
   1.124 +
   1.125 +    update() {}
   1.126 +    update(T a) {}   //FIXME: Is it necessary
   1.127    };
   1.128  
   1.129    template<class T> class EdgeMap
   1.130 @@ -74,27 +113,32 @@
   1.131    public:
   1.132      typedef T ValueType;
   1.133      typedef EdgeIt KeyType;
   1.134 +
   1.135 +    EdgeMap(const Graph &G) {}
   1.136 +    EdgeMap(const Graph &G, T t) {}
   1.137 +    
   1.138      void set(EdgeIt i, T t) {}
   1.139      T get(EdgeIt i) const {}
   1.140      T &operator[](EdgeIt i) {}
   1.141 -      
   1.142 -    EdgeMap(const Graph &G) {}
   1.143 -    EdgeMap(const Graph &G, T t) {}
   1.144 +    
   1.145 +    update() {}
   1.146 +    update(T a) {}   //FIXME: Is it necessary
   1.147    };
   1.148  };
   1.149  
   1.150 -class EmptyBipGraph : public EmptyGraph
   1.151 -{
   1.152 -  class ANodeIt {};
   1.153 -  class BNodeIt {};
   1.154  
   1.155 -  ANodeIt &next(ANodeIt &) {}
   1.156 -  BNodeIt &next(BNodeIt &) {}
   1.157 +// class EmptyBipGraph : public EmptyGraph
   1.158 +// {
   1.159 +//   class ANodeIt {};
   1.160 +//   class BNodeIt {};
   1.161  
   1.162 -  ANodeIt &getFirst(ANodeIt &) const {}
   1.163 -  BNodeIt &getFirst(BNodeIt &) const {}
   1.164 +//   ANodeIt &next(ANodeIt &) {}
   1.165 +//   BNodeIt &next(BNodeIt &) {}
   1.166  
   1.167 -  enum NodeClass { A = 0, B = 1 };
   1.168 -  NodeClass getClass(NodeIt n) {}
   1.169 +//   ANodeIt &getFirst(ANodeIt &) const {}
   1.170 +//   BNodeIt &getFirst(BNodeIt &) const {}
   1.171  
   1.172 -}
   1.173 +//   enum NodeClass { A = 0, B = 1 };
   1.174 +//   NodeClass getClass(NodeIt n) {}
   1.175 +
   1.176 +// }
     2.1 --- a/src/work/alpar/gwrapper.h	Tue Mar 02 18:24:00 2004 +0000
     2.2 +++ b/src/work/alpar/gwrapper.h	Tue Mar 02 20:40:39 2004 +0000
     2.3 @@ -181,8 +181,8 @@
     2.4  
     2.5    typedef typename G::EdgeIt EdgeIt;
     2.6    
     2.7 -  typedef typename G::InEdgeIt SymEdgeIt;
     2.8 -  typedef typename G::OutEdgeIt SymEdgeIt;
     2.9 +  typedef typename G::SymEdgeIt InEdgeIt;
    2.10 +  typedef typename G::SymEdgeIt OutEdgeIt;
    2.11    typedef typename G::SymEdgeIt SymEdgeIt;
    2.12    typedef typename G::EachEdgeIt EachEdgeIt;
    2.13