COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/work/alpar/emptygraph.h @ 53:cc5eb73a3a93

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

.

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