62 checkGraphConArcList(G, 1); |
62 checkGraphConArcList(G, 1); |
63 |
63 |
64 Arc a2 = G.addArc(n2, n1), |
64 Arc a2 = G.addArc(n2, n1), |
65 a3 = G.addArc(n2, n3), |
65 a3 = G.addArc(n2, n3), |
66 a4 = G.addArc(n2, n3); |
66 a4 = G.addArc(n2, n3); |
|
67 ignore_unused_variable_warning(a2,a3,a4); |
67 |
68 |
68 checkGraphNodeList(G, 3); |
69 checkGraphNodeList(G, 3); |
69 checkGraphArcList(G, 4); |
70 checkGraphArcList(G, 4); |
70 |
71 |
71 checkGraphOutArcList(G, n1, 1); |
72 checkGraphOutArcList(G, n1, 1); |
90 |
91 |
91 Digraph G; |
92 Digraph G; |
92 Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode(); |
93 Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode(); |
93 Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1), |
94 Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1), |
94 a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3); |
95 a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3); |
|
96 ignore_unused_variable_warning(a1,a2,a3,a4); |
95 |
97 |
96 Node n4 = G.split(n2); |
98 Node n4 = G.split(n2); |
97 |
99 |
98 check(G.target(OutArcIt(G, n2)) == n4 && |
100 check(G.target(OutArcIt(G, n2)) == n4 && |
99 G.source(InArcIt(G, n4)) == n2, |
101 G.source(InArcIt(G, n4)) == n2, |
123 Node n1 = G.addNode(), n2 = G.addNode(), |
125 Node n1 = G.addNode(), n2 = G.addNode(), |
124 n3 = G.addNode(), n4 = G.addNode(); |
126 n3 = G.addNode(), n4 = G.addNode(); |
125 Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n4, n1), |
127 Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n4, n1), |
126 a3 = G.addArc(n4, n3), a4 = G.addArc(n4, n3), |
128 a3 = G.addArc(n4, n3), a4 = G.addArc(n4, n3), |
127 a5 = G.addArc(n2, n4); |
129 a5 = G.addArc(n2, n4); |
|
130 ignore_unused_variable_warning(a1,a2,a3,a5); |
128 |
131 |
129 checkGraphNodeList(G, 4); |
132 checkGraphNodeList(G, 4); |
130 checkGraphArcList(G, 5); |
133 checkGraphArcList(G, 5); |
131 |
134 |
132 // Check changeSource() and changeTarget() |
135 // Check changeSource() and changeTarget() |
202 Node n1 = G.addNode(), n2 = G.addNode(), |
205 Node n1 = G.addNode(), n2 = G.addNode(), |
203 n3 = G.addNode(), n4 = G.addNode(); |
206 n3 = G.addNode(), n4 = G.addNode(); |
204 Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n4, n1), |
207 Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n4, n1), |
205 a3 = G.addArc(n4, n3), a4 = G.addArc(n3, n1), |
208 a3 = G.addArc(n4, n3), a4 = G.addArc(n3, n1), |
206 a5 = G.addArc(n2, n4); |
209 a5 = G.addArc(n2, n4); |
|
210 ignore_unused_variable_warning(a2,a3,a4,a5); |
207 |
211 |
208 // Check arc deletion |
212 // Check arc deletion |
209 G.erase(a1); |
213 G.erase(a1); |
210 |
214 |
211 checkGraphNodeList(G, 4); |
215 checkGraphNodeList(G, 4); |
249 |
253 |
250 Digraph G; |
254 Digraph G; |
251 Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode(); |
255 Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode(); |
252 Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1), |
256 Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1), |
253 a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3); |
257 a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3); |
|
258 ignore_unused_variable_warning(a1,a2,a3,a4); |
254 |
259 |
255 typename Digraph::Snapshot snapshot(G); |
260 typename Digraph::Snapshot snapshot(G); |
256 |
261 |
257 Node n = G.addNode(); |
262 Node n = G.addNode(); |
258 G.addArc(n3, n); |
263 G.addArc(n3, n); |
349 n3 = g.addNode(); |
354 n3 = g.addNode(); |
350 |
355 |
351 Arc |
356 Arc |
352 e1 = g.addArc(n1, n2), |
357 e1 = g.addArc(n1, n2), |
353 e2 = g.addArc(n2, n3); |
358 e2 = g.addArc(n2, n3); |
|
359 ignore_unused_variable_warning(e2); |
354 |
360 |
355 check(g.valid(n1), "Wrong validity check"); |
361 check(g.valid(n1), "Wrong validity check"); |
356 check(g.valid(e1), "Wrong validity check"); |
362 check(g.valid(e1), "Wrong validity check"); |
357 |
363 |
358 check(!g.valid(g.nodeFromId(-1)), "Wrong validity check"); |
364 check(!g.valid(g.nodeFromId(-1)), "Wrong validity check"); |