... |
... |
@@ -30,4 +30,5 @@
|
30 |
30 |
const int nn = 10;
|
31 |
31 |
|
|
32 |
// Build a digraph
|
32 |
33 |
SmartDigraph from;
|
33 |
34 |
SmartDigraph::NodeMap<int> fnm(from);
|
... |
... |
@@ -52,4 +53,5 @@
|
52 |
53 |
}
|
53 |
54 |
|
|
55 |
// Test digraph copy
|
54 |
56 |
ListDigraph to;
|
55 |
57 |
ListDigraph::NodeMap<int> tnm(to);
|
... |
... |
@@ -70,4 +72,7 @@
|
70 |
72 |
node(fn, tn).arc(fa, ta).run();
|
71 |
73 |
|
|
74 |
check(countNodes(from) == countNodes(to), "Wrong copy.");
|
|
75 |
check(countArcs(from) == countArcs(to), "Wrong copy.");
|
|
76 |
|
72 |
77 |
for (SmartDigraph::NodeIt it(from); it != INVALID; ++it) {
|
73 |
78 |
check(ncr[nr[it]] == it, "Wrong copy.");
|
... |
... |
@@ -91,4 +96,10 @@
|
91 |
96 |
check(tn == nr[fn], "Wrong copy.");
|
92 |
97 |
check(ta == er[fa], "Wrong copy.");
|
|
98 |
|
|
99 |
// Test repeated copy
|
|
100 |
digraphCopy(from, to).run();
|
|
101 |
|
|
102 |
check(countNodes(from) == countNodes(to), "Wrong copy.");
|
|
103 |
check(countArcs(from) == countArcs(to), "Wrong copy.");
|
93 |
104 |
}
|
94 |
105 |
|
... |
... |
@@ -96,4 +107,5 @@
|
96 |
107 |
const int nn = 10;
|
97 |
108 |
|
|
109 |
// Build a graph
|
98 |
110 |
SmartGraph from;
|
99 |
111 |
SmartGraph::NodeMap<int> fnm(from);
|
... |
... |
@@ -123,4 +135,5 @@
|
123 |
135 |
}
|
124 |
136 |
|
|
137 |
// Test graph copy
|
125 |
138 |
ListGraph to;
|
126 |
139 |
ListGraph::NodeMap<int> tnm(to);
|
... |
... |
@@ -145,4 +158,8 @@
|
145 |
158 |
node(fn, tn).arc(fa, ta).edge(fe, te).run();
|
146 |
159 |
|
|
160 |
check(countNodes(from) == countNodes(to), "Wrong copy.");
|
|
161 |
check(countEdges(from) == countEdges(to), "Wrong copy.");
|
|
162 |
check(countArcs(from) == countArcs(to), "Wrong copy.");
|
|
163 |
|
147 |
164 |
for (SmartGraph::NodeIt it(from); it != INVALID; ++it) {
|
148 |
165 |
check(ncr[nr[it]] == it, "Wrong copy.");
|
... |
... |
@@ -181,4 +198,11 @@
|
181 |
198 |
check(ta == ar[fa], "Wrong copy.");
|
182 |
199 |
check(te == er[fe], "Wrong copy.");
|
|
200 |
|
|
201 |
// Test repeated copy
|
|
202 |
graphCopy(from, to).run();
|
|
203 |
|
|
204 |
check(countNodes(from) == countNodes(to), "Wrong copy.");
|
|
205 |
check(countEdges(from) == countEdges(to), "Wrong copy.");
|
|
206 |
check(countArcs(from) == countArcs(to), "Wrong copy.");
|
183 |
207 |
}
|
184 |
208 |
|