COIN-OR::LEMON - Graph Library

Changeset 147:f3f1d7a4a8d3 in lemon-0.x for src/work


Ignore:
Timestamp:
03/02/04 21:40:39 (21 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@207
Message:

Step toward to a standardised graph interface.

Location:
src/work/alpar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/work/alpar/emptygraph.h

    r145 r147  
    55public:
    66
    7   class EdgeIt {};
     7  class NodeIt {
     8  public:
     9    NodeIt() {}   //FIXME
     10    //NodeIt(const NodeIt &) {}
     11    bool operator==(NodeIt n) const {} //FIXME
     12    bool operator!=(NodeIt n) const {} //FIXME
     13  };
     14   
     15  class EachNodeIt : public NodeIt {
     16  public:
     17    EachNodeIt() {} //FIXME
     18    EachNodeIt(const EmptyGraph &) const {}
     19    EachNodeIt(const EachNodeIt &) const {} //FIXME
     20  };
     21   
     22  class EdgeIt {
     23    EdgeIt() {}   //FIXME
     24    //EdgeIt(const EdgeIt &) {}
     25    bool operator==(EdgeIt n) const {} //FIXME
     26    bool operator!=(EdgeIt n) const {} //FIXME   
     27  };
    828 
    9   class InEdgeIt : public EdgeIt {};
    10   class OutEdgeIt : public EdgeIt {};
    11   class SymEdgeIt : public EdgeIt {};
    12   class EachEdgeIt : public EdgeIt {};
     29  class OutEdgeIt : public EdgeIt {
     30    OutEdgeIt() {}
     31    OutEdgeIt(const EmptyGraph &, NodeIt) {}
     32  };
    1333
    14   class NodeIt {};
    15    
    16   NodeIt &getFirst(NodeIt &) const {}
     34  class InEdgeIt : public EdgeIt {
     35    InEdgeIt() {}
     36    InEdgeIt(const EmptyGraph &, NodeIt) {}   
     37  };
     38  //  class SymEdgeIt : public EdgeIt {};
     39  class EachEdgeIt : public EdgeIt {
     40    EachEdgeIt() {}
     41    EachEdgeIt(const EmptyGraph &, NodeIt) {}
     42  };
     43
     44  EachNodeIt &getFirst(EachNodeIt &) const {}
    1745  InEdgeIt &getFirst(InEdgeIt &, NodeIt) const {}
    1846  OutEdgeIt &getFirst(OutEdgeIt &, NodeIt) const {}
    19   SymEdgeIt &getFirst(SymEdgeIt &, NodeIt) const {}
     47  //  SymEdgeIt &getFirst(SymEdgeIt &, NodeIt) const {}
    2048  EachEdgeIt &getFirst(EachEdgeIt &) const {}
    2149
     
    2351  InEdgeIt getNext(InEdgeIt) const {}
    2452  OutEdgeIt getNext(OutEdgeIt) const {}
    25   SymEdgeIt getNext(SymEdgeIt) const {}
     53  //SymEdgeIt getNext(SymEdgeIt) const {}
    2654  EachEdgeIt getNext(EachEdgeIt) const {}
    2755
     
    2957  InEdgeIt &next(InEdgeIt &) const {}
    3058  OutEdgeIt &next(OutEdgeIt &) const {}
    31   SymEdgeIt &next(SymEdgeIt &) const {}
     59  //SymEdgeIt &next(SymEdgeIt &) const {}
    3260  EachEdgeIt &next(EachEdgeIt &) const {}
    3361
     
    3563  NodeIt tail(EdgeIt) const {}
    3664 
    37   NodeIt aNode(InEdgeIt) const {}
    38   NodeIt aNode(OutEdgeIt) const {}
    39   NodeIt aNode(SymEdgeIt) const {}
     65//   NodeIt aNode(InEdgeIt) const {}
     66//   NodeIt aNode(OutEdgeIt) const {}
     67//   NodeIt aNode(SymEdgeIt) const {}
    4068
    41   NodeIt bNode(InEdgeIt) const {}
    42   NodeIt bNode(OutEdgeIt) const {}
    43   NodeIt bNode(SymEdgeIt) const {}
     69//   NodeIt bNode(InEdgeIt) const {}
     70//   NodeIt bNode(OutEdgeIt) const {}
     71//   NodeIt bNode(SymEdgeIt) const {}
    4472
    45   //bool valid(const NodeIt) const {};
    46   //bool valid(const EdgeIt) const {};
     73  bool valid(const NodeIt) const {};
     74  bool valid(const EdgeIt) const {};
     75
     76  int id(const NodeIt) const {};
     77  int id(const EdgeIt) const {};
    4778
    4879  //void setInvalid(NodeIt &) const {};
     
    5788  void clear() {}
    5889
     90  int nodeNum() {}
     91  int edgeNum() {}
     92
    5993  template<class T> class NodeMap
    6094  {
     
    6296    typedef T ValueType;
    6397    typedef NodeIt KeyType;
    64     void set(NodeIt i, T t) {}
    65     T get(NodeIt i) const {}
    66     T &operator[](NodeIt i) {}
    67      
     98
    6899    NodeMap(const Graph &G) {}
    69100    NodeMap(const Graph &G, T t) {}
     101
     102    void set(NodeIt i, T t) {}
     103    T get(NodeIt i) const {}  //FIXME: Is it necessary
     104    T &operator[](NodeIt i) {}
     105    const T &operator[](NodeIt i) const {}
     106
     107    update() {}
     108    update(T a) {}   //FIXME: Is it necessary
    70109  };
    71110
     
    75114    typedef T ValueType;
    76115    typedef EdgeIt KeyType;
     116
     117    EdgeMap(const Graph &G) {}
     118    EdgeMap(const Graph &G, T t) {}
     119   
    77120    void set(EdgeIt i, T t) {}
    78121    T get(EdgeIt i) const {}
    79122    T &operator[](EdgeIt i) {}
    80      
    81     EdgeMap(const Graph &G) {}
    82     EdgeMap(const Graph &G, T t) {}
     123   
     124    update() {}
     125    update(T a) {}   //FIXME: Is it necessary
    83126  };
    84127};
    85128
    86 class EmptyBipGraph : public EmptyGraph
    87 {
    88   class ANodeIt {};
    89   class BNodeIt {};
    90129
    91   ANodeIt &next(ANodeIt &) {}
    92   BNodeIt &next(BNodeIt &) {}
     130// class EmptyBipGraph : public EmptyGraph
     131// {
     132//   class ANodeIt {};
     133//   class BNodeIt {};
    93134
    94   ANodeIt &getFirst(ANodeIt &) const {}
    95   BNodeIt &getFirst(BNodeIt &) const {}
     135//   ANodeIt &next(ANodeIt &) {}
     136//   BNodeIt &next(BNodeIt &) {}
    96137
    97   enum NodeClass { A = 0, B = 1 };
    98   NodeClass getClass(NodeIt n) {}
     138//   ANodeIt &getFirst(ANodeIt &) const {}
     139//   BNodeIt &getFirst(BNodeIt &) const {}
    99140
    100 }
     141//   enum NodeClass { A = 0, B = 1 };
     142//   NodeClass getClass(NodeIt n) {}
     143
     144// }
  • src/work/alpar/gwrapper.h

    r145 r147  
    182182  typedef typename G::EdgeIt EdgeIt;
    183183 
    184   typedef typename G::InEdgeIt SymEdgeIt;
    185   typedef typename G::OutEdgeIt SymEdgeIt;
     184  typedef typename G::SymEdgeIt InEdgeIt;
     185  typedef typename G::SymEdgeIt OutEdgeIt;
    186186  typedef typename G::SymEdgeIt SymEdgeIt;
    187187  typedef typename G::EachEdgeIt EachEdgeIt;
Note: See TracChangeset for help on using the changeset viewer.