23 namespace hugo { |
23 namespace hugo { |
24 |
24 |
25 /// \addtogroup graphs |
25 /// \addtogroup graphs |
26 /// @{ |
26 /// @{ |
27 |
27 |
28 // class SymListGraph; |
|
29 |
|
30 ///A list graph class. |
28 ///A list graph class. |
31 |
29 |
32 ///This is a simple and fast erasable graph implementation. |
30 ///This is a simple and fast erasable graph implementation. |
33 /// |
31 /// |
34 ///It conforms to the graph interface documented under |
32 ///It conforms to the graph interface documented under |
35 ///the description of \ref GraphSkeleton. |
33 ///the description of \ref ErasableGraphSkeleton. |
36 ///\sa \ref GraphSkeleton. |
34 ///\sa \ref ErasableGraphSkeleton. |
37 class ListGraph { |
35 class ListGraph { |
38 |
36 |
39 //Nodes are double linked. |
37 //Nodes are double linked. |
40 //The free nodes are only single linked using the "next" field. |
38 //The free nodes are only single linked using the "next" field. |
41 struct NodeT |
39 struct NodeT |
42 { |
40 { |
43 int first_in,first_out; |
41 int first_in,first_out; |
44 int prev, next; |
42 int prev, next; |
45 // NodeT() {} |
|
46 }; |
43 }; |
47 //Edges are double linked. |
44 //Edges are double linked. |
48 //The free edges are only single linked using the "next_in" field. |
45 //The free edges are only single linked using the "next_in" field. |
49 struct EdgeT |
46 struct EdgeT |
50 { |
47 { |
51 int head, tail; |
48 int head, tail; |
52 int prev_in, prev_out; |
49 int prev_in, prev_out; |
53 int next_in, next_out; |
50 int next_in, next_out; |
54 //FIXME: is this necessary? |
|
55 // EdgeT() : next_in(-1), next_out(-1) prev_in(-1), prev_out(-1) {} |
|
56 }; |
51 }; |
57 |
52 |
58 std::vector<NodeT> nodes; |
53 std::vector<NodeT> nodes; |
59 //The first node |
54 //The first node |
60 int first_node; |
55 int first_node; |