COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/work/alpar/emptygraph.h @ 54:acd0dc288149

Last change on this file since 54:acd0dc288149 was 54:acd0dc288149, checked in by Alpar Juttner, 17 years ago

.

File size: 1.5 KB
Line 
1// -*-mode: c++; -*-
2
3class Graph
4{
5public:
6  class EdgeIt {};
7 
8  class InEdgeIt : public EdgeIt
9  class OutEdgeIt : public EdgeIt {};
10  class SymEdgeIt : public EdgeIt {};
11  class EachEdgeIt : public EdgeIt {};
12
13  class NodeIt {};
14   
15  NodeIt &getFirst(NodeIt &);
16  InEdgeIt &getFirst(InEdgeIt &,const NodeIt &);
17  OutEdgeIt &getFirst(OutEdgeIt &,const NodeIt &);
18  SymEdgeIt &getFirst(SymEdgeIt &,const NodeIt &);
19  EachEdgeIt &getFirst(EachEdgeIt &);
20
21  NodeIt next(const NodeIt &);
22  InEdgeIt next(const InEdgeIt &);
23  OutEdgeIt next(const OutEdgeIt &);
24  SymEdgeIt next(const SymEdgeIt &);
25  EachEdgeIt next(const EachEdgeIt &);
26
27  NodeIt &goNext(const NodeIt &);
28  InEdgeIt &goNext(const InEdgeIt &);
29  OutEdgeIt &goNext(const OutEdgeIt &);
30  SymEdgeIt &goNext(const SymEdgeIt &);
31  EachEdgeIt &goNext(const EachEdgeIt &);
32
33  bool valid(const NodeIt &n);
34  bool valid(const EdgeIt &n);
35
36  void setInvalid(const NodeIt &n);
37  void setInvalid(const EdgeIt &n);
38 
39  NodeIt addNode();
40  EdgeIt addEdge(const NodeIt from,const NodeIt to);
41   
42  void delete(NodeIt n);
43  void delete(EdgeIt e);
44
45  void clean();
46
47  template<class T> class NodeMap
48  {
49  public:
50    typedef T value_type;
51    void set(const NodeIt i, const T &t);
52    T get(const NodeIt i) const;
53    T &operator[](const NodeIt i);
54     
55    NodeMap(const Graph &G);
56  };
57
58  template<class T> class EdgeMap
59  {
60  public:
61    typedef T value_type;
62    void set(const EdgeIt i, const T &t);
63    T get(const EdgeIt i) const;
64    T &operator[](const EdgeIt i);
65     
66    EdgeMap(const Graph &G);
67  };
68};
Note: See TracBrowser for help on using the repository browser.