Changeset 19:3151a1026db9 in lemon0.x for src/work/marci_property_vector.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_property_vector.hh
r9 r19 3 3 4 4 #include <vector> 5 6 #include <marci_graph_traits.hh>7 5 8 6 namespace marci { … … 11 9 int number_of(iterator _it) { 12 10 int i=0; 13 for( ; _it. is_valid(); ++_it) { ++i; }11 for( ; _it.valid(); ++_it) { ++i; } 14 12 return i; 15 13 } … … 17 15 template <typename graph_type, typename T> 18 16 class node_property_vector { 19 typedef typename graph_traits<graph_type>::node_iterator node_iterator;20 typedef typename graph_traits<graph_type>::each_node_iterator each_node_iterator;17 typedef typename list_graph::node_iterator node_iterator; 18 typedef typename list_graph::each_node_iterator each_node_iterator; 21 19 graph_type& G; 22 20 std::vector<T> container; … … 24 22 node_property_vector(graph_type& _G) : G(_G) { 25 23 int i=0; 26 for(each_node_iterator it=G.first_node(); it. is_valid(); ++it) ++i;24 for(each_node_iterator it=G.first_node(); it.valid(); ++it) ++i; 27 25 container.resize(i); 28 26 } 29 27 node_property_vector(graph_type& _G, T a) : G(_G) { 30 for(each_node_iterator it=G.first_node(); it. is_valid(); ++it) { container.push_back(a); }28 for(each_node_iterator it=G.first_node(); it.valid(); ++it) { container.push_back(a); } 31 29 } 32 30 void put(node_iterator nit, const T& a) { container[G.id(nit)]=a; } … … 36 34 template <typename graph_type, typename T> 37 35 class edge_property_vector { 38 typedef typename graph_t raits<graph_type>::edge_iterator edge_iterator;39 typedef typename graph_t raits<graph_type>::each_edge_iterator each_edge_iterator;36 typedef typename graph_type::edge_iterator edge_iterator; 37 typedef typename graph_type::each_edge_iterator each_edge_iterator; 40 38 graph_type& G; 41 39 std::vector<T> container; … … 43 41 edge_property_vector(graph_type& _G) : G(_G) { 44 42 int i=0; 45 for(each_edge_iterator it=G.first_edge(); it. is_valid(); ++it) ++i;43 for(each_edge_iterator it=G.first_edge(); it.valid(); ++it) ++i; 46 44 container.resize(i); 47 45 } 48 46 edge_property_vector(graph_type& _G, T a) : G(_G) { 49 for(each_edge_iterator it=G.first_edge(); it. is_valid(); ++it) {47 for(each_edge_iterator it=G.first_edge(); it.valid(); ++it) { 50 48 container.push_back(a); 51 49 }
Note: See TracChangeset
for help on using the changeset viewer.