Changeset 19:3151a1026db9 in lemon0.x for src/work/marci_list_graph.hh
 Timestamp:
 01/20/04 18:39:13 (17 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@32
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/marci_list_graph.hh
r16 r19 20 20 int node_id; 21 21 int edge_id; 22 int _node_num; 23 int _edge_num; 22 24 23 25 node_item* _first_node; … … 81 83 _last_node=p; 82 84 if (!_first_node) _first_node=p; 85 ++_node_num; 83 86 return p; 84 87 } … … 99 102 _head>_last_in_edge=e; 100 103 if (!_head>_first_in_edge) { _head>_first_in_edge=e; } 104 ++_edge_num; 101 105 return e; 102 106 } … … 106 110 /* default constructor */ 107 111 108 list_graph() : node_id(0), edge_id(0), _first_node(0), _last_node(0) { } 109 112 list_graph() : node_id(0), edge_id(0), _node_num(0), _edge_num(0), _first_node(0), _last_node(0) { } 113 114 int node_num() { return _node_num; } 115 int edge_num() { return _edge_num; } 116 110 117 /* functions to construct iterators from the graph, or from each other */ 111 118 … … 210 217 node_iterator() : node(0) { } 211 218 node_iterator(node_item* _node) : node(_node) { } 212 bool is_valid() { return (node!=0); }219 bool valid() { return (node!=0); } 213 220 void make_invalid() { node=0; } 214 221 friend bool operator==(const node_iterator& u, const node_iterator& v) { … … 240 247 edge_iterator() : edge(0) { } 241 248 edge_iterator(edge_item* _edge) : edge(_edge) { } 242 bool is_valid() { return (edge!=0); }249 bool valid() { return (edge!=0); } 243 250 void make_invalid() { edge=0; } 244 251 friend bool operator==(const edge_iterator& u, const edge_iterator& v) {
Note: See TracChangeset
for help on using the changeset viewer.