COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/work/alpar/emptygraph.h @ 52:a4fc9c5dcee5

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

An empty Graph class.

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