Changeset 813:65144c52969c in lemon-0.x
- Timestamp:
- 09/07/04 12:35:31 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1109
- Location:
- src/hugo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/full_graph.h
r798 r813 59 59 : NodeNum(_g.nodeNum()), EdgeNum(NodeNum*NodeNum) { } 60 60 61 int nodeNum() const { return NodeNum; } //FIXME: What is this? 62 int edgeNum() const { return EdgeNum; } //FIXME: What is this? 63 64 int maxNodeId() const { return NodeNum; } //FIXME: What is this? 65 int maxEdgeId() const { return EdgeNum; } //FIXME: What is this? 61 ///Number of nodes. 62 int nodeNum() const { return NodeNum; } 63 ///Number of edges. 64 int edgeNum() const { return EdgeNum; } 65 66 /// Maximum node ID. 67 68 /// Maximum node ID. 69 ///\sa id(Node) 70 int maxNodeId() const { return NodeNum-1; } 71 /// Maximum edge ID. 72 73 /// Maximum edge ID. 74 ///\sa id(Edge) 75 int maxEdgeId() const { return EdgeNum-1; } 66 76 67 77 Node tail(Edge e) const { return e.n%NodeNum; } … … 77 87 e=InEdgeIt(*this,v); return e; } 78 88 89 /// Node ID. 90 91 /// The ID of a valid Node is a nonnegative integer not greater than 92 /// \ref maxNodeId(). The range of the ID's is not surely continuous 93 /// and the greatest node ID can be actually less then \ref maxNodeId(). 94 /// 95 /// The ID of the \ref INVALID node is -1. 96 ///\return The ID of the node \c v. 79 97 static int id(Node v) { return v.n; } 98 /// Edge ID. 99 100 /// The ID of a valid Edge is a nonnegative integer not greater than 101 /// \ref maxEdgeId(). The range of the ID's is not surely continuous 102 /// and the greatest edge ID can be actually less then \ref maxEdgeId(). 103 /// 104 /// The ID of the \ref INVALID edge is -1. 105 ///\return The ID of the edge \c e. 80 106 static int id(Edge e) { return e.n; } 81 107 -
src/hugo/list_graph.h
r798 r813 94 94 first_free_edge(_g.first_free_edge) {} 95 95 96 int nodeNum() const { return nodes.size(); } //FIXME: What is this? 97 int edgeNum() const { return edges.size(); } //FIXME: What is this? 98 99 ///Set the expected number of edges 96 ///Number of nodes. 97 int nodeNum() const { return nodes.size(); } 98 ///Number of edges. 99 int edgeNum() const { return edges.size(); } 100 101 ///Set the expected maximum number of edges. 100 102 101 103 ///With this function, it is possible to set the expected number of edges. … … 104 106 void reserveEdge(int n) { edges.reserve(n); }; 105 107 106 ///\bug This function does something different than 107 ///its name would suggests... 108 int maxNodeId() const { return nodes.size(); } //FIXME: What is this? 109 ///\bug This function does something different than 110 ///its name would suggests... 111 int maxEdgeId() const { return edges.size(); } //FIXME: What is this? 108 /// Maximum node ID. 109 110 /// Maximum node ID. 111 ///\sa id(Node) 112 int maxNodeId() const { return nodes.size()-1; } 113 /// Maximum edge ID. 114 115 /// Maximum edge ID. 116 ///\sa id(Edge) 117 int maxEdgeId() const { return edges.size()-1; } 112 118 113 119 Node tail(Edge e) const { return edges[e.n].tail; } … … 123 129 e=InEdgeIt(*this,v); return e; } 124 130 131 /// Node ID. 132 133 /// The ID of a valid Node is a nonnegative integer not greater than 134 /// \ref maxNodeId(). The range of the ID's is not surely continuous 135 /// and the greatest node ID can be actually less then \ref maxNodeId(). 136 /// 137 /// The ID of the \ref INVALID node is -1. 138 ///\return The ID of the node \c v. 125 139 static int id(Node v) { return v.n; } 140 /// Edge ID. 141 142 /// The ID of a valid Edge is a nonnegative integer not greater than 143 /// \ref maxEdgeId(). The range of the ID's is not surely continuous 144 /// and the greatest edge ID can be actually less then \ref maxEdgeId(). 145 /// 146 /// The ID of the \ref INVALID edge is -1. 147 ///\return The ID of the edge \c e. 126 148 static int id(Edge e) { return e.n; } 127 149 128 150 /// Adds a new node to the graph. 129 151 130 /// \ todo It adds the nodes in a reversed order.152 /// \warning It adds the new node to the front of the list. 131 153 /// (i.e. the lastly added node becomes the first.) 132 154 Node addNode() { … … 521 543 first_free_node(_g.first_free_node) {} 522 544 523 int nodeNum() const { return nodes.size(); } //FIXME: What is this? 524 int edgeNum() const { return 0; } //FIXME: What is this? 525 526 ///\bug This function does something different than 527 ///its name would suggests... 528 int maxNodeId() const { return nodes.size(); } //FIXME: What is this? 529 ///\bug This function does something different than 530 ///its name would suggests... 531 int maxEdgeId() const { return 0; } //FIXME: What is this? 545 ///Number of nodes. 546 int nodeNum() const { return nodes.size(); } 547 ///Number of edges. 548 int edgeNum() const { return 0; } 549 550 /// Maximum node ID. 551 552 /// Maximum node ID. 553 ///\sa id(Node) 554 int maxNodeId() const { return nodes.size()-1; } 555 /// Maximum edge ID. 556 557 /// Maximum edge ID. 558 ///\sa id(Edge) 559 int maxEdgeId() const { return 0; } 532 560 533 561 Node tail(Edge e) const { return INVALID; } … … 543 571 e=InEdgeIt(*this,v); return e; } 544 572 573 /// Node ID. 574 575 /// The ID of a valid Node is a nonnegative integer not greater than 576 /// \ref maxNodeId(). The range of the ID's is not surely continuous 577 /// and the greatest node ID can be actually less then \ref maxNodeId(). 578 /// 579 /// The ID of the \ref INVALID node is -1. 580 ///\return The ID of the node \c v. 545 581 int id(Node v) const { return v.n; } 582 /// Edge ID. 583 584 /// The ID of a valid Edge is a nonnegative integer not greater than 585 /// \ref maxEdgeId(). The range of the ID's is not surely continuous 586 /// and the greatest edge ID can be actually less then \ref maxEdgeId(). 587 /// 588 /// The ID of the \ref INVALID edge is -1. 589 ///\return The ID of the edge \c e. 546 590 int id(Edge e) const { return -1; } 547 591 548 592 /// Adds a new node to the graph. 549 593 550 /// \ todo It adds the nodes in a reversed order.594 /// \warning It adds the new node to the front of the list. 551 595 /// (i.e. the lastly added node becomes the first.) 552 596 Node addNode() { … … 828 872 first_free_edge(_g.first_free_edge) {} 829 873 830 int nodeNum() const { return G.nodeNum(); } //FIXME: What is this? 831 int edgeNum() const { return edges.size(); } //FIXME: What is this? 832 833 ///\bug This function does something different than 834 ///its name would suggests... 835 int maxNodeId() const { return G.maxNodeId(); } //FIXME: What is this? 836 ///\bug This function does something different than 837 ///its name would suggests... 838 int maxEdgeId() const { return edges.size(); } //FIXME: What is this? 874 ///Number of nodes. 875 int nodeNum() const { return G.nodeNum(); } 876 ///Number of edges. 877 int edgeNum() const { return edges.size(); } 878 879 /// Maximum node ID. 880 881 /// Maximum node ID. 882 ///\sa id(Node) 883 int maxNodeId() const { return G.maxNodeId(); } 884 /// Maximum edge ID. 885 886 /// Maximum edge ID. 887 ///\sa id(Edge) 888 int maxEdgeId() const { return edges.size()-1; } 839 889 840 890 Node tail(Edge e) const { return edges[e.n].tail; } … … 850 900 e=InEdgeIt(*this,v); return e; } 851 901 902 /// Node ID. 903 904 /// The ID of a valid Node is a nonnegative integer not greater than 905 /// \ref maxNodeId(). The range of the ID's is not surely continuous 906 /// and the greatest node ID can be actually less then \ref maxNodeId(). 907 /// 908 /// The ID of the \ref INVALID node is -1. 909 ///\return The ID of the node \c v. 910 int id(Node v) { return G.id(v); } 911 /// Edge ID. 912 913 /// The ID of a valid Edge is a nonnegative integer not greater than 914 /// \ref maxEdgeId(). The range of the ID's is not surely continuous 915 /// and the greatest edge ID can be actually less then \ref maxEdgeId(). 916 /// 917 /// The ID of the \ref INVALID edge is -1. 918 ///\return The ID of the edge \c e. 852 919 int id(Edge e) const { return e.n; } 853 920 -
src/hugo/smart_graph.h
r798 r813 81 81 SmartGraph(const SmartGraph &_g) : nodes(_g.nodes), edges(_g.edges) { } 82 82 83 int nodeNum() const { return nodes.size(); } //FIXME: What is this? 84 int edgeNum() const { return edges.size(); } //FIXME: What is this? 85 86 ///\bug This function does something different than 87 ///its name would suggests... 88 int maxNodeId() const { return nodes.size(); } //FIXME: What is this? 89 ///\bug This function does something different than 90 ///its name would suggests... 91 int maxEdgeId() const { return edges.size(); } //FIXME: What is this? 83 ///Number of nodes. 84 int nodeNum() const { return nodes.size(); } 85 ///Number of edges. 86 int edgeNum() const { return edges.size(); } 87 88 /// Maximum node ID. 89 90 /// Maximum node ID. 91 ///\sa id(Node) 92 int maxNodeId() const { return nodes.size()-1; } 93 /// Maximum edge ID. 94 95 /// Maximum edge ID. 96 ///\sa id(Edge) 97 int maxEdgeId() const { return edges.size()-1; } 92 98 93 99 Node tail(Edge e) const { return edges[e.n].tail; } … … 103 109 e=InEdgeIt(*this,v); return e; } 104 110 111 /// Node ID. 112 113 /// The ID of a valid Node is a nonnegative integer not greater than 114 /// \ref maxNodeId(). The range of the ID's is not surely continuous 115 /// and the greatest node ID can be actually less then \ref maxNodeId(). 116 /// 117 /// The ID of the \ref INVALID node is -1. 118 ///\return The ID of the node \c v. 105 119 static int id(Node v) { return v.n; } 120 /// Edge ID. 121 122 /// The ID of a valid Edge is a nonnegative integer not greater than 123 /// \ref maxEdgeId(). The range of the ID's is not surely continuous 124 /// and the greatest edge ID can be actually less then \ref maxEdgeId(). 125 /// 126 /// The ID of the \ref INVALID edge is -1. 127 ///\return The ID of the edge \c e. 106 128 static int id(Edge e) { return e.n; } 107 129
Note: See TracChangeset
for help on using the changeset viewer.