Changeset 916:c0734a8c282c in lemon0.x for src
 Timestamp:
 09/28/04 18:40:55 (16 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1227
 Location:
 src
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

src/hugo/list_graph.h
r911 r916 103 103 first_free_edge(_g.first_free_edge) {} 104 104 105 /// \bug In the vector can be hole if a node is erased from the graph. 105 106 ///Number of nodes. 106 107 int nodeNum() const { return nodes.size(); } … … 580 581 OutEdgeIt() {} 581 582 OutEdgeIt(const SymListGraph& g, Edge e) { 582 if ( e.id & 1== 0) {583 if ((e.id & 1) == 0) { 583 584 out = Parent::OutEdgeIt(g, SymEdge(e)); 584 585 in = Parent::InEdgeIt(g, g.tail(e)); … … 617 618 InEdgeIt() {} 618 619 InEdgeIt(const SymListGraph& g, Edge e) { 619 if ( e.id & 1== 0) {620 if ((e.id & 1) == 0) { 620 621 out = Parent::OutEdgeIt(g, SymEdge(e)); 621 622 in = Parent::InEdgeIt(g, g.tail(e)); … … 733 734 734 735 Node tail(Edge e) const { 735 return e.id & 1== 0 ?736 return (e.id & 1) == 0 ? 736 737 Parent::tail(SymEdge(e)) : Parent::head(SymEdge(e)); 737 738 } 738 739 739 740 Node head(Edge e) const { 740 return e.id & 1== 0 ?741 return (e.id & 1) == 0 ? 741 742 Parent::head(SymEdge(e)) : Parent::tail(SymEdge(e)); 742 743 } … … 823 824 } 824 825 825 /// Finds an symmetric edge between two nodes.826 827 /// Finds an symmetric edge from node \c u to node \c v.828 ///829 /// If \c prev is \ref INVALID (this is the default value), then830 /// It finds the first edge from \c u to \c v. Otherwise it looks for831 /// the next edge from \c u to \c v after \c prev.832 /// \return The found edge or INVALID if there is no such an edge.826 // /// Finds an symmetric edge between two nodes. 827 828 // /// Finds an symmetric edge from node \c u to node \c v. 829 // /// 830 // /// If \c prev is \ref INVALID (this is the default value), then 831 // /// It finds the first edge from \c u to \c v. Otherwise it looks for 832 // /// the next edge from \c u to \c v after \c prev. 833 // /// \return The found edge or INVALID if there is no such an edge. 833 834 834 835 // SymEdge findEdge(Node u, Node v, SymEdge prev = INVALID) … … 874 875 875 876 static Edge backward(SymEdge e) { 876 return Edge((id(e) << 1) &1);877 return Edge((id(e) << 1)  1); 877 878 } 878 879 
src/hugo/smart_graph.h
r909 r916 395 395 OutEdgeIt() {} 396 396 OutEdgeIt(const SymSmartGraph& g, Edge e) { 397 if ( e.id & 1== 0) {397 if ((e.id & 1) == 0) { 398 398 out = Parent::OutEdgeIt(g, SymEdge(e)); 399 399 in = Parent::InEdgeIt(g, g.tail(e)); … … 432 432 InEdgeIt() {} 433 433 InEdgeIt(const SymSmartGraph& g, Edge e) { 434 if ( e.id & 1== 0) {434 if ((e.id & 1) == 0) { 435 435 out = Parent::OutEdgeIt(g, SymEdge(e)); 436 436 in = Parent::InEdgeIt(g, g.tail(e)); … … 541 541 542 542 Node tail(Edge e) const { 543 return e.id & 1== 0 ?543 return (e.id & 1) == 0 ? 544 544 Parent::tail(SymEdge(e)) : Parent::head(SymEdge(e)); 545 545 } 546 546 547 547 Node head(Edge e) const { 548 return e.id & 1== 0 ?548 return (e.id & 1) == 0 ? 549 549 Parent::head(SymEdge(e)) : Parent::tail(SymEdge(e)); 550 550 } … … 631 631 } 632 632 633 /// Finds an symmetric edge between two nodes.634 635 /// Finds an symmetric edge from node \c u to node \c v.636 ///637 /// If \c prev is \ref INVALID (this is the default value), then638 /// It finds the first edge from \c u to \c v. Otherwise it looks for639 /// the next edge from \c u to \c v after \c prev.640 /// \return The found edge or INVALID if there is no such an edge.633 // /// Finds an symmetric edge between two nodes. 634 635 // /// Finds an symmetric edge from node \c u to node \c v. 636 // /// 637 // /// If \c prev is \ref INVALID (this is the default value), then 638 // /// It finds the first edge from \c u to \c v. Otherwise it looks for 639 // /// the next edge from \c u to \c v after \c prev. 640 // /// \return The found edge or INVALID if there is no such an edge. 641 641 642 642 // SymEdge findEdge(Node u, Node v, SymEdge prev = INVALID) … … 668 668 669 669 static Edge backward(SymEdge e) { 670 return Edge((id(e) << 1) &1);670 return Edge((id(e) << 1)  1); 671 671 } 672 672 
src/test/graph_test.h
r906 r916 299 299 for(int i=0;i<nn;i++) { 300 300 check(e!=INVALID,"Wrong OutEdge list linking."); 301 check(n==G.tail(e), "Wrong OutEdge list linking."); 301 302 ++e; 302 303 } … … 311 312 for(int i=0;i<nn;i++) { 312 313 check(e!=INVALID,"Wrong InEdge list linking."); 314 check(n==G.head(e), "Wrong InEdge list linking."); 313 315 ++e; 314 316 }
Note: See TracChangeset
for help on using the changeset viewer.