Changes in / [827:580af8cf2f6a:819:f964a00b9068] in lemon
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/Makefile.am
r827 r817 114 114 lemon/smart_graph.h \ 115 115 lemon/soplex.h \ 116 lemon/static_graph.h \117 116 lemon/suurballe.h \ 118 117 lemon/time_measure.h \ -
lemon/bits/graph_extender.h
r825 r732 57 57 } 58 58 59 static Node fromId(int id, Node){59 Node fromId(int id, Node) const { 60 60 return Parent::nodeFromId(id); 61 61 } 62 62 63 static Arc fromId(int id, Arc){63 Arc fromId(int id, Arc) const { 64 64 return Parent::arcFromId(id); 65 65 } … … 356 356 } 357 357 358 static Node fromId(int id, Node){358 Node fromId(int id, Node) const { 359 359 return Parent::nodeFromId(id); 360 360 } 361 361 362 static Arc fromId(int id, Arc){362 Arc fromId(int id, Arc) const { 363 363 return Parent::arcFromId(id); 364 364 } 365 365 366 static Edge fromId(int id, Edge){366 Edge fromId(int id, Edge) const { 367 367 return Parent::edgeFromId(id); 368 368 } -
lemon/edge_set.h
r825 r717 868 868 } 869 869 870 static void next(Arc& arc){870 void next(Arc& arc) const { 871 871 --arc.id; 872 872 } … … 1174 1174 } 1175 1175 1176 static void next(Arc& arc){1176 void next(Arc& arc) const { 1177 1177 --arc.id; 1178 1178 } … … 1182 1182 } 1183 1183 1184 static void next(Edge& arc){1184 void next(Edge& arc) const { 1185 1185 --arc.id; 1186 1186 } -
lemon/full_graph.h
r827 r782 52 52 53 53 Node operator()(int ix) const { return Node(ix); } 54 static int index(const Node& node){ return node._id; }54 int index(const Node& node) const { 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 static int index(const Node& node){ return Parent::index(node); }216 int index(Node node) const { 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 static int index(const Node& node){ return node._id; }290 int index(const Node& node) const { 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 static int index(const Node& node){ return Parent::index(node); }591 int index(Node node) const { return Parent::index(node); } 592 592 593 593 /// \brief Returns the arc connecting the given nodes. -
lemon/hypercube_graph.h
r827 r784 263 263 } 264 264 265 static int index(Node node){265 int index(Node node) const { 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 static int index(Node node){359 int index(Node node) const { 360 360 return Parent::index(node); 361 361 } -
lemon/smart_graph.h
r827 r783 498 498 } 499 499 500 static void next(Node& node){500 void next(Node& node) const { 501 501 --node._id; 502 502 } … … 506 506 } 507 507 508 static void next(Arc& arc){508 void next(Arc& arc) const { 509 509 --arc._id; 510 510 } … … 514 514 } 515 515 516 static void next(Edge& arc){516 void next(Edge& arc) const { 517 517 --arc._id; 518 518 } -
test/digraph_test.cc
r827 r787 20 20 #include <lemon/list_graph.h> 21 21 #include <lemon/smart_graph.h> 22 #include <lemon/static_graph.h>23 22 #include <lemon/full_graph.h> 24 23 … … 330 329 checkConcept<ClearableDigraphComponent<>, SmartDigraph>(); 331 330 } 332 { // Checking StaticDigraph333 checkConcept<Digraph, StaticDigraph>();334 checkConcept<ClearableDigraphComponent<>, StaticDigraph>();335 }336 331 { // Checking FullDigraph 337 332 checkConcept<Digraph, FullDigraph>(); … … 387 382 check(!g.valid(g.nodeFromId(-1)), "Wrong validity check"); 388 383 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::Node407 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::Arc436 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.");496 384 } 497 385 … … 548 436 checkDigraphValidity<SmartDigraph>(); 549 437 } 550 { // Checking StaticDigraph551 checkStaticDigraph();552 }553 438 { // Checking FullDigraph 554 439 checkFullDigraph(8);
Note: See TracChangeset
for help on using the changeset viewer.