Changeset 774:4297098d9677 in lemon0.x for src/work/sage_graph.h
 Timestamp:
 08/30/04 14:01:47 (17 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1066
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/sage_graph.h
r642 r774 10 10 namespace hugo { 11 11 12 template <typename It>13 int count(It it) {14 int i=0;15 for( ; it.valid(); ++it) { ++i; }16 return i;17 }12 // template <typename It> 13 // int count(It it) { 14 // int i=0; 15 // for( ; it.valid(); ++it) { ++i; } 16 // return i; 17 // } 18 18 19 19 class SageGraph { … … 386 386 public: //for everybody but marci 387 387 NodeIt(const SageGraph& G) : Node(G._first_node) { } 388 NodeIt(const SageGraph& G, const Node& n) : Node(n) { } 388 389 public: 389 390 NodeIt() : Node() { } … … 391 392 protected: 392 393 NodeIt(node_item* v) : Node(v) { } 394 public: 393 395 NodeIt& operator++() { node=node>_next_node; return *this; } 394 396 //FIXME:: … … 426 428 class EdgeIt : public Edge { 427 429 friend class SageGraph; 428 //protected: 429 public: //for alpar 430 public: 431 EdgeIt() : Edge() { } 432 EdgeIt(const Invalid& i) : Edge(i) { } 430 433 EdgeIt(const SageGraph& G) { 431 434 node_item* v=G._first_node; … … 433 436 while (v && !edge) { v=v>_next_node; if (v) edge=v>_first_out_edge; } 434 437 } 435 public: 436 EdgeIt() : Edge() { } 437 EdgeIt(const Invalid& i) : Edge(i) { } 438 protected: 439 EdgeIt(edge_item* _e) : Edge(_e) { } 438 EdgeIt(const SageGraph& G, const Edge& e) : Edge(e) { } 439 // protected: 440 // EdgeIt(edge_item* _e) : Edge(_e) { } 441 public: 440 442 EdgeIt& operator++() { 441 443 node_item* v=edge>_tail; … … 448 450 class OutEdgeIt : public Edge { 449 451 friend class SageGraph; 450 //node_item* v; 451 //protected: 452 protected: //for alpar 453 OutEdgeIt(const Node& _v) /*: v(_v.node)*/ { edge=_v.node>_first_out_edge; } 454 public: 455 OutEdgeIt() : Edge()/*, v(0)*/ { } 452 public: 453 OutEdgeIt() : Edge() { } 456 454 OutEdgeIt(const Invalid& i) : Edge(i) { } 457 OutEdgeIt(const SageGraph&, Node _v) /*: v(_v.node)*/ { edge=_v.node>_first_out_edge;}458 protected:455 OutEdgeIt(const SageGraph&, Node _v) : Edge(_v.node>_first_out_edge) { } 456 OutEdgeIt(const SageGraph&, const Edge& e) : Edge(e) { } 459 457 OutEdgeIt& operator++() { edge=edge>_next_out; return *this; } 460 458 protected: … … 465 463 class InEdgeIt : public Edge { 466 464 friend class SageGraph; 467 //node_item* v; 468 //protected: 469 protected: //for alpar 470 InEdgeIt(const Node& _v) /*: v(_v.node)*/ { edge=_v.node>_first_in_edge; } 471 public: 472 InEdgeIt() : Edge()/*, v(0)*/ { } 473 InEdgeIt(const Invalid& i) : Edge(i) { } 474 InEdgeIt(const SageGraph&, Node _v) /*: v(_v.node)*/ { edge=_v.node>_first_in_edge; } 475 protected: 465 public: 466 InEdgeIt() : Edge() { } 467 InEdgeIt(Invalid i) : Edge(i) { } 468 InEdgeIt(const SageGraph&, Node _v) : Edge(_v.node>_first_in_edge) { } 469 InEdgeIt(const SageGraph&, const Edge& e) : Edge(e) { } 476 470 InEdgeIt& operator++() { edge=edge>_next_in; return *this; } 477 471 protected:
Note: See TracChangeset
for help on using the changeset viewer.