COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/work/alpar/emptygraph.h @ 55:75ed9549d34d

Last change on this file since 55:75ed9549d34d was 55:75ed9549d34d, checked in by Alpar Juttner, 18 years ago

aNode(), bNode(), head() and tail() added

File size: 1.8 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  NodeIt head(const EdgeIt &);
34  NodeIt tail(const EdgeIt &);
35 
36  NodeIt aNode(const InEdgeIt &);
37  NodeIt aNode(const OutEdgeIt &);
38  NodeIt aNode(const SymEdgeIt &);
39
40  NodeIt bNode(const InEdgeIt &);
41  NodeIt bNode(const OutEdgeIt &);
42  NodeIt bNode(const SymEdgeIt &);
43
44  bool valid(const NodeIt &);
45  bool valid(const EdgeIt &);
46
47  void setInvalid(const NodeIt &);
48  void setInvalid(const EdgeIt &);
49 
50  NodeIt addNode();
51  EdgeIt addEdge(const NodeIt from,const NodeIt to);
52   
53  void delete(NodeIt n);
54  void delete(EdgeIt e);
55
56  void clean();
57
58  template<class T> class NodeMap
59  {
60  public:
61    typedef T value_type;
62    void set(const NodeIt i, const T &t);
63    T get(const NodeIt i) const;
64    T &operator[](const NodeIt i);
65     
66    NodeMap(const Graph &G);
67  };
68
69  template<class T> class EdgeMap
70  {
71  public:
72    typedef T value_type;
73    void set(const EdgeIt i, const T &t);
74    T get(const EdgeIt i) const;
75    T &operator[](const EdgeIt i);
76     
77    EdgeMap(const Graph &G);
78  };
79};
Note: See TracBrowser for help on using the repository browser.