... | ... |
@@ -20,2 +20,3 @@ |
20 | 20 |
#include <lemon/list_graph.h> |
21 |
#include <lemon/static_graph.h> |
|
21 | 22 |
#include <lemon/lgf_reader.h> |
... | ... |
@@ -28,2 +29,3 @@ |
28 | 29 |
|
30 |
template <typename GR> |
|
29 | 31 |
void digraph_copy_test() { |
... | ... |
@@ -53,15 +55,15 @@ |
53 | 55 |
} |
56 |
|
|
57 |
// Test digraph copy |
|
58 |
GR to; |
|
59 |
typename GR::template NodeMap<int> tnm(to); |
|
60 |
typename GR::template ArcMap<int> tam(to); |
|
61 |
typename GR::Node tn; |
|
62 |
typename GR::Arc ta; |
|
54 | 63 |
|
55 |
// Test digraph copy |
|
56 |
ListDigraph to; |
|
57 |
ListDigraph::NodeMap<int> tnm(to); |
|
58 |
ListDigraph::ArcMap<int> tam(to); |
|
59 |
ListDigraph::Node tn; |
|
60 |
ListDigraph::Arc ta; |
|
64 |
SmartDigraph::NodeMap<typename GR::Node> nr(from); |
|
65 |
SmartDigraph::ArcMap<typename GR::Arc> er(from); |
|
61 | 66 |
|
62 |
SmartDigraph::NodeMap<ListDigraph::Node> nr(from); |
|
63 |
SmartDigraph::ArcMap<ListDigraph::Arc> er(from); |
|
64 |
|
|
65 |
ListDigraph::NodeMap<SmartDigraph::Node> ncr(to); |
|
66 |
|
|
67 |
typename GR::template NodeMap<SmartDigraph::Node> ncr(to); |
|
68 |
typename GR::template ArcMap<SmartDigraph::Arc> ecr(to); |
|
67 | 69 |
|
... | ... |
@@ -88,3 +90,3 @@ |
88 | 90 |
|
89 |
for ( |
|
91 |
for (typename GR::NodeIt it(to); it != INVALID; ++it) { |
|
90 | 92 |
check(nr[ncr[it]] == it, "Wrong copy."); |
... | ... |
@@ -92,3 +94,3 @@ |
92 | 94 |
|
93 |
for ( |
|
95 |
for (typename GR::ArcIt it(to); it != INVALID; ++it) { |
|
94 | 96 |
check(er[ecr[it]] == it, "Wrong copy."); |
... | ... |
@@ -105,2 +107,3 @@ |
105 | 107 |
|
108 |
template <typename GR> |
|
106 | 109 |
void graph_copy_test() { |
... | ... |
@@ -137,17 +140,17 @@ |
137 | 140 |
// Test graph copy |
138 |
ListGraph to; |
|
139 |
ListGraph::NodeMap<int> tnm(to); |
|
140 |
ListGraph::ArcMap<int> tam(to); |
|
141 |
ListGraph::EdgeMap<int> tem(to); |
|
142 |
ListGraph::Node tn; |
|
143 |
ListGraph::Arc ta; |
|
144 |
|
|
141 |
GR to; |
|
142 |
typename GR::template NodeMap<int> tnm(to); |
|
143 |
typename GR::template ArcMap<int> tam(to); |
|
144 |
typename GR::template EdgeMap<int> tem(to); |
|
145 |
typename GR::Node tn; |
|
146 |
typename GR::Arc ta; |
|
147 |
typename GR::Edge te; |
|
145 | 148 |
|
146 |
SmartGraph::NodeMap<ListGraph::Node> nr(from); |
|
147 |
SmartGraph::ArcMap<ListGraph::Arc> ar(from); |
|
148 |
SmartGraph:: |
|
149 |
SmartGraph::NodeMap<typename GR::Node> nr(from); |
|
150 |
SmartGraph::ArcMap<typename GR::Arc> ar(from); |
|
151 |
SmartGraph::EdgeMap<typename GR::Edge> er(from); |
|
149 | 152 |
|
150 |
ListGraph::NodeMap<SmartGraph::Node> ncr(to); |
|
151 |
ListGraph::ArcMap<SmartGraph::Arc> acr(to); |
|
152 |
|
|
153 |
typename GR::template NodeMap<SmartGraph::Node> ncr(to); |
|
154 |
typename GR::template ArcMap<SmartGraph::Arc> acr(to); |
|
155 |
typename GR::template EdgeMap<SmartGraph::Edge> ecr(to); |
|
153 | 156 |
|
... | ... |
@@ -186,3 +189,3 @@ |
186 | 189 |
|
187 |
for ( |
|
190 |
for (typename GR::NodeIt it(to); it != INVALID; ++it) { |
|
188 | 191 |
check(nr[ncr[it]] == it, "Wrong copy."); |
... | ... |
@@ -190,6 +193,6 @@ |
190 | 193 |
|
191 |
for ( |
|
194 |
for (typename GR::ArcIt it(to); it != INVALID; ++it) { |
|
192 | 195 |
check(ar[acr[it]] == it, "Wrong copy."); |
193 | 196 |
} |
194 |
for ( |
|
197 |
for (typename GR::EdgeIt it(to); it != INVALID; ++it) { |
|
195 | 198 |
check(er[ecr[it]] == it, "Wrong copy."); |
... | ... |
@@ -210,4 +213,7 @@ |
210 | 213 |
int main() { |
211 |
digraph_copy_test(); |
|
212 |
graph_copy_test(); |
|
214 |
digraph_copy_test<SmartDigraph>(); |
|
215 |
digraph_copy_test<ListDigraph>(); |
|
216 |
digraph_copy_test<StaticDigraph>(); |
|
217 |
graph_copy_test<SmartGraph>(); |
|
218 |
graph_copy_test<ListGraph>(); |
|
213 | 219 |
|
0 comments (0 inline)