Changes in / [772:f964a00b9068:780:580af8cf2f6a] in lemon-main
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/Makefile.am
r770 r780 114 114 lemon/smart_graph.h \ 115 115 lemon/soplex.h \ 116 lemon/static_graph.h \ 116 117 lemon/suurballe.h \ 117 118 lemon/time_measure.h \ -
lemon/bits/graph_extender.h
r685 r778 57 57 } 58 58 59 Node fromId(int id, Node) const{59 static Node fromId(int id, Node) { 60 60 return Parent::nodeFromId(id); 61 61 } 62 62 63 Arc fromId(int id, Arc) const{63 static Arc fromId(int id, Arc) { 64 64 return Parent::arcFromId(id); 65 65 } … … 356 356 } 357 357 358 Node fromId(int id, Node) const{358 static Node fromId(int id, Node) { 359 359 return Parent::nodeFromId(id); 360 360 } 361 361 362 Arc fromId(int id, Arc) const{362 static Arc fromId(int id, Arc) { 363 363 return Parent::arcFromId(id); 364 364 } 365 365 366 Edge fromId(int id, Edge) const{366 static Edge fromId(int id, Edge) { 367 367 return Parent::edgeFromId(id); 368 368 } -
lemon/edge_set.h
r670 r778 868 868 } 869 869 870 void next(Arc& arc) const{870 static void next(Arc& arc) { 871 871 --arc.id; 872 872 } … … 1174 1174 } 1175 1175 1176 void next(Arc& arc) const{1176 static void next(Arc& arc) { 1177 1177 --arc.id; 1178 1178 } … … 1182 1182 } 1183 1183 1184 void next(Edge& arc) const{1184 static void next(Edge& arc) { 1185 1185 --arc.id; 1186 1186 } -
lemon/full_graph.h
r735 r780 52 52 53 53 Node operator()(int ix) const { return Node(ix); } 54 int index(const Node& node) const{ return node._id; }54 static int index(const Node& node) { return node._id; } 55 55 56 56 Arc arc(const Node& s, const Node& t) const { … … 214 214 /// the range <tt>[0..nodeNum()-1]</tt>. 215 215 /// \sa operator()() 216 int index(Node node) const{ return Parent::index(node); }216 static int index(const Node& node) { return Parent::index(node); } 217 217 218 218 /// \brief Returns the arc connecting the given nodes. … … 288 288 289 289 Node operator()(int ix) const { return Node(ix); } 290 int index(const Node& node) const{ return node._id; }290 static int index(const Node& node) { return node._id; } 291 291 292 292 Edge edge(const Node& u, const Node& v) const { … … 589 589 /// the range <tt>[0..nodeNum()-1]</tt>. 590 590 /// \sa operator()() 591 int index(Node node) const{ return Parent::index(node); }591 static int index(const Node& node) { return Parent::index(node); } 592 592 593 593 /// \brief Returns the arc connecting the given nodes. -
lemon/hypercube_graph.h
r737 r780 263 263 } 264 264 265 int index(Node node) const{265 static int index(Node node) { 266 266 return node._id; 267 267 } … … 357 357 /// Gives back the index of the given node. 358 358 /// The lower bits of the integer describes the node. 359 int index(Node node) const{359 static int index(Node node) { 360 360 return Parent::index(node); 361 361 } -
lemon/smart_graph.h
r736 r780 498 498 } 499 499 500 void next(Node& node) const{500 static void next(Node& node) { 501 501 --node._id; 502 502 } … … 506 506 } 507 507 508 void next(Arc& arc) const{508 static void next(Arc& arc) { 509 509 --arc._id; 510 510 } … … 514 514 } 515 515 516 void next(Edge& arc) const{516 static void next(Edge& arc) { 517 517 --arc._id; 518 518 } -
test/digraph_test.cc
r740 r780 20 20 #include <lemon/list_graph.h> 21 21 #include <lemon/smart_graph.h> 22 #include <lemon/static_graph.h> 22 23 #include <lemon/full_graph.h> 23 24 … … 329 330 checkConcept<ClearableDigraphComponent<>, SmartDigraph>(); 330 331 } 332 { // Checking StaticDigraph 333 checkConcept<Digraph, StaticDigraph>(); 334 checkConcept<ClearableDigraphComponent<>, StaticDigraph>(); 335 } 331 336 { // Checking FullDigraph 332 337 checkConcept<Digraph, FullDigraph>(); … … 382 387 check(!g.valid(g.nodeFromId(-1)), "Wrong validity check"); 383 388 check(!g.valid(g.arcFromId(-1)), "Wrong validity check"); 389 } 390 391 void checkStaticDigraph() { 392 SmartDigraph g; 393 SmartDigraph::NodeMap<StaticDigraph::Node> nref(g); 394 SmartDigraph::ArcMap<StaticDigraph::Arc> aref(g); 395 396 StaticDigraph G; 397 398 checkGraphNodeList(G, 0); 399 checkGraphArcList(G, 0); 400 401 G.build(g, nref, aref); 402 403 checkGraphNodeList(G, 0); 404 checkGraphArcList(G, 0); 405 406 SmartDigraph::Node 407 n1 = g.addNode(), 408 n2 = g.addNode(), 409 n3 = g.addNode(); 410 411 G.build(g, nref, aref); 412 413 checkGraphNodeList(G, 3); 414 checkGraphArcList(G, 0); 415 416 SmartDigraph::Arc a1 = g.addArc(n1, n2); 417 418 G.build(g, nref, aref); 419 420 check(G.source(aref[a1]) == nref[n1] && G.target(aref[a1]) == nref[n2], 421 "Wrong arc or wrong references"); 422 checkGraphNodeList(G, 3); 423 checkGraphArcList(G, 1); 424 425 checkGraphOutArcList(G, nref[n1], 1); 426 checkGraphOutArcList(G, nref[n2], 0); 427 checkGraphOutArcList(G, nref[n3], 0); 428 429 checkGraphInArcList(G, nref[n1], 0); 430 checkGraphInArcList(G, nref[n2], 1); 431 checkGraphInArcList(G, nref[n3], 0); 432 433 checkGraphConArcList(G, 1); 434 435 SmartDigraph::Arc 436 a2 = g.addArc(n2, n1), 437 a3 = g.addArc(n2, n3), 438 a4 = g.addArc(n2, n3); 439 440 digraphCopy(g, G).nodeRef(nref).run(); 441 442 checkGraphNodeList(G, 3); 443 checkGraphArcList(G, 4); 444 445 checkGraphOutArcList(G, nref[n1], 1); 446 checkGraphOutArcList(G, nref[n2], 3); 447 checkGraphOutArcList(G, nref[n3], 0); 448 449 checkGraphInArcList(G, nref[n1], 1); 450 checkGraphInArcList(G, nref[n2], 1); 451 checkGraphInArcList(G, nref[n3], 2); 452 453 checkGraphConArcList(G, 4); 454 455 std::vector<std::pair<int,int> > arcs; 456 arcs.push_back(std::make_pair(0,1)); 457 arcs.push_back(std::make_pair(0,2)); 458 arcs.push_back(std::make_pair(1,3)); 459 arcs.push_back(std::make_pair(1,2)); 460 arcs.push_back(std::make_pair(3,0)); 461 arcs.push_back(std::make_pair(3,3)); 462 arcs.push_back(std::make_pair(4,2)); 463 arcs.push_back(std::make_pair(4,3)); 464 arcs.push_back(std::make_pair(4,1)); 465 466 G.build(6, arcs.begin(), arcs.end()); 467 468 checkGraphNodeList(G, 6); 469 checkGraphArcList(G, 9); 470 471 checkGraphOutArcList(G, G.node(0), 2); 472 checkGraphOutArcList(G, G.node(1), 2); 473 checkGraphOutArcList(G, G.node(2), 0); 474 checkGraphOutArcList(G, G.node(3), 2); 475 checkGraphOutArcList(G, G.node(4), 3); 476 checkGraphOutArcList(G, G.node(5), 0); 477 478 checkGraphInArcList(G, G.node(0), 1); 479 checkGraphInArcList(G, G.node(1), 2); 480 checkGraphInArcList(G, G.node(2), 3); 481 checkGraphInArcList(G, G.node(3), 3); 482 checkGraphInArcList(G, G.node(4), 0); 483 checkGraphInArcList(G, G.node(5), 0); 484 485 checkGraphConArcList(G, 9); 486 487 checkNodeIds(G); 488 checkArcIds(G); 489 checkGraphNodeMap(G); 490 checkGraphArcMap(G); 491 492 int n = G.nodeNum(); 493 int m = G.arcNum(); 494 check(G.index(G.node(n-1)) == n-1, "Wrong index."); 495 check(G.index(G.arc(m-1)) == m-1, "Wrong index."); 384 496 } 385 497 … … 436 548 checkDigraphValidity<SmartDigraph>(); 437 549 } 550 { // Checking StaticDigraph 551 checkStaticDigraph(); 552 } 438 553 { // Checking FullDigraph 439 554 checkFullDigraph(8);
Note: See TracChangeset
for help on using the changeset viewer.