Changeset 1026:699c7eac2c6d in lemon-main for test
- Timestamp:
- 01/11/12 22:21:07 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
test/bpgraph_test.cc
r1025 r1026 102 102 103 103 checkGraphNodeMap(G); 104 checkGraphRed Map(G);105 checkGraphBlue Map(G);104 checkGraphRedNodeMap(G); 105 checkGraphBlueNodeMap(G); 106 106 checkGraphArcMap(G); 107 107 checkGraphEdgeMap(G); … … 261 261 262 262 checkGraphNodeMap(G); 263 checkGraphRed Map(G);264 checkGraphBlue Map(G);263 checkGraphRedNodeMap(G); 264 checkGraphBlueNodeMap(G); 265 265 checkGraphArcMap(G); 266 266 checkGraphEdgeMap(G); … … 370 370 checkGraphArcList(G, 2 * redNum * blueNum); 371 371 372 for (Red It n(G); n != INVALID; ++n) {372 for (RedNodeIt n(G); n != INVALID; ++n) { 373 373 checkGraphOutArcList(G, n, blueNum); 374 374 checkGraphInArcList(G, n, blueNum); … … 376 376 } 377 377 378 for (Blue It n(G); n != INVALID; ++n) {378 for (BlueNodeIt n(G); n != INVALID; ++n) { 379 379 checkGraphOutArcList(G, n, redNum); 380 380 checkGraphInArcList(G, n, redNum); … … 394 394 395 395 checkGraphNodeMap(G); 396 checkGraphRed Map(G);397 checkGraphBlue Map(G);396 checkGraphRedNodeMap(G); 397 checkGraphBlueNodeMap(G); 398 398 checkGraphArcMap(G); 399 399 checkGraphEdgeMap(G); -
test/graph_copy_test.cc
r1025 r1026 217 217 SmartBpGraph from; 218 218 SmartBpGraph::NodeMap<int> fnm(from); 219 SmartBpGraph::Red Map<int> frnm(from);220 SmartBpGraph::Blue Map<int> fbnm(from);219 SmartBpGraph::RedNodeMap<int> frnm(from); 220 SmartBpGraph::BlueNodeMap<int> fbnm(from); 221 221 SmartBpGraph::ArcMap<int> fam(from); 222 222 SmartBpGraph::EdgeMap<int> fem(from); … … 262 262 GR to; 263 263 typename GR::template NodeMap<int> tnm(to); 264 typename GR::template Red Map<int> trnm(to);265 typename GR::template Blue Map<int> tbnm(to);264 typename GR::template RedNodeMap<int> trnm(to); 265 typename GR::template BlueNodeMap<int> tbnm(to); 266 266 typename GR::template ArcMap<int> tam(to); 267 267 typename GR::template EdgeMap<int> tem(to); … … 273 273 274 274 SmartBpGraph::NodeMap<typename GR::Node> nr(from); 275 SmartBpGraph::Red Map<typename GR::RedNode> rnr(from);276 SmartBpGraph::Blue Map<typename GR::BlueNode> bnr(from);275 SmartBpGraph::RedNodeMap<typename GR::RedNode> rnr(from); 276 SmartBpGraph::BlueNodeMap<typename GR::BlueNode> bnr(from); 277 277 SmartBpGraph::ArcMap<typename GR::Arc> ar(from); 278 278 SmartBpGraph::EdgeMap<typename GR::Edge> er(from); 279 279 280 280 typename GR::template NodeMap<SmartBpGraph::Node> ncr(to); 281 typename GR::template Red Map<SmartBpGraph::RedNode> rncr(to);282 typename GR::template Blue Map<SmartBpGraph::BlueNode> bncr(to);281 typename GR::template RedNodeMap<SmartBpGraph::RedNode> rncr(to); 282 typename GR::template BlueNodeMap<SmartBpGraph::BlueNode> bncr(to); 283 283 typename GR::template ArcMap<SmartBpGraph::Arc> acr(to); 284 284 typename GR::template EdgeMap<SmartBpGraph::Edge> ecr(to); 285 285 286 286 bpGraphCopy(from, to). 287 nodeMap(fnm, tnm).redMap(frnm, trnm).blueMap(fbnm, tbnm). 287 nodeMap(fnm, tnm). 288 redNodeMap(frnm, trnm).blueNodeMap(fbnm, tbnm). 288 289 arcMap(fam, tam).edgeMap(fem, tem). 289 290 nodeRef(nr).redRef(rnr).blueRef(bnr). … … 305 306 } 306 307 307 for (SmartBpGraph::Red It it(from); it != INVALID; ++it) {308 for (SmartBpGraph::RedNodeIt it(from); it != INVALID; ++it) { 308 309 check(ncr[nr[it]] == it, "Wrong copy."); 309 310 check(fnm[it] == tnm[nr[it]], "Wrong copy."); … … 314 315 } 315 316 316 for (SmartBpGraph::Blue It it(from); it != INVALID; ++it) {317 for (SmartBpGraph::BlueNodeIt it(from); it != INVALID; ++it) { 317 318 check(ncr[nr[it]] == it, "Wrong copy."); 318 319 check(fnm[it] == tnm[nr[it]], "Wrong copy."); … … 344 345 check(nr[ncr[it]] == it, "Wrong copy."); 345 346 } 346 for (typename GR::Red It it(to); it != INVALID; ++it) {347 for (typename GR::RedNodeIt it(to); it != INVALID; ++it) { 347 348 check(rncr[it] == ncr[it], "Wrong copy."); 348 349 check(rnr[rncr[it]] == it, "Wrong copy."); 349 350 } 350 for (typename GR::Blue It it(to); it != INVALID; ++it) {351 for (typename GR::BlueNodeIt it(to); it != INVALID; ++it) { 351 352 check(bncr[it] == ncr[it], "Wrong copy."); 352 353 check(bnr[bncr[it]] == it, "Wrong copy."); -
test/graph_test.h
r1025 r1026 44 44 void checkGraphRedNodeList(const Graph &G, int cnt) 45 45 { 46 typename Graph::Red It n(G);46 typename Graph::RedNodeIt n(G); 47 47 for(int i=0;i<cnt;i++) { 48 48 check(n!=INVALID,"Wrong red Node list linking."); … … 66 66 void checkGraphBlueNodeList(const Graph &G, int cnt) 67 67 { 68 typename Graph::Blue It n(G);68 typename Graph::BlueNodeIt n(G); 69 69 for(int i=0;i<cnt;i++) { 70 70 check(n!=INVALID,"Wrong blue Node list linking."); … … 226 226 typedef typename Graph::RedNode RedNode; 227 227 std::set<int> values; 228 for (typename Graph::Red It n(G); n != INVALID; ++n) {228 for (typename Graph::RedNodeIt n(G); n != INVALID; ++n) { 229 229 check(G.red(n), "Wrong partition"); 230 230 check(values.find(G.id(n)) == values.end(), "Wrong id"); … … 239 239 typedef typename Graph::BlueNode BlueNode; 240 240 std::set<int> values; 241 for (typename Graph::Blue It n(G); n != INVALID; ++n) {241 for (typename Graph::BlueNodeIt n(G); n != INVALID; ++n) { 242 242 check(G.blue(n), "Wrong partition"); 243 243 check(values.find(G.id(n)) == values.end(), "Wrong id"); … … 305 305 306 306 template <typename Graph> 307 void checkGraphRed Map(const Graph& G) {307 void checkGraphRedNodeMap(const Graph& G) { 308 308 typedef typename Graph::Node Node; 309 typedef typename Graph::Red It RedIt;310 311 typedef typename Graph::template Red Map<int> IntRedMap;312 IntRed Map map(G, 42);313 for (Red It it(G); it != INVALID; ++it) {309 typedef typename Graph::RedNodeIt RedNodeIt; 310 311 typedef typename Graph::template RedNodeMap<int> IntRedNodeMap; 312 IntRedNodeMap map(G, 42); 313 for (RedNodeIt it(G); it != INVALID; ++it) { 314 314 check(map[it] == 42, "Wrong map constructor."); 315 315 } 316 316 int s = 0; 317 for (Red It it(G); it != INVALID; ++it) {317 for (RedNodeIt it(G); it != INVALID; ++it) { 318 318 map[it] = 0; 319 319 check(map[it] == 0, "Wrong operator[]."); … … 323 323 } 324 324 s = s * (s - 1) / 2; 325 for (Red It it(G); it != INVALID; ++it) {325 for (RedNodeIt it(G); it != INVALID; ++it) { 326 326 s -= map[it]; 327 327 } … … 335 335 336 336 template <typename Graph> 337 void checkGraphBlue Map(const Graph& G) {337 void checkGraphBlueNodeMap(const Graph& G) { 338 338 typedef typename Graph::Node Node; 339 typedef typename Graph::Blue It BlueIt;340 341 typedef typename Graph::template Blue Map<int> IntBlueMap;342 IntBlue Map map(G, 42);343 for (Blue It it(G); it != INVALID; ++it) {339 typedef typename Graph::BlueNodeIt BlueNodeIt; 340 341 typedef typename Graph::template BlueNodeMap<int> IntBlueNodeMap; 342 IntBlueNodeMap map(G, 42); 343 for (BlueNodeIt it(G); it != INVALID; ++it) { 344 344 check(map[it] == 42, "Wrong map constructor."); 345 345 } 346 346 int s = 0; 347 for (Blue It it(G); it != INVALID; ++it) {347 for (BlueNodeIt it(G); it != INVALID; ++it) { 348 348 map[it] = 0; 349 349 check(map[it] == 0, "Wrong operator[]."); … … 353 353 } 354 354 s = s * (s - 1) / 2; 355 for (Blue It it(G); it != INVALID; ++it) {355 for (BlueNodeIt it(G); it != INVALID; ++it) { 356 356 s -= map[it]; 357 357 }
Note: See TracChangeset
for help on using the changeset viewer.