Changeset 1194:699c7eac2c6d in lemon for test/graph_test.h
 Timestamp:
 01/11/12 22:21:07 (8 years ago)
 Branch:
 default
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

test/graph_test.h
r1193 r1194 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.