1.1 --- a/src/work/marci_property_vector.hh Tue Jan 20 11:21:42 2004 +0000
1.2 +++ b/src/work/marci_property_vector.hh Tue Jan 20 17:39:13 2004 +0000
1.3 @@ -3,31 +3,29 @@
1.4
1.5 #include <vector>
1.6
1.7 -#include <marci_graph_traits.hh>
1.8 -
1.9 namespace marci {
1.10
1.11 template <typename iterator>
1.12 int number_of(iterator _it) {
1.13 int i=0;
1.14 - for( ; _it.is_valid(); ++_it) { ++i; }
1.15 + for( ; _it.valid(); ++_it) { ++i; }
1.16 return i;
1.17 }
1.18
1.19 template <typename graph_type, typename T>
1.20 class node_property_vector {
1.21 - typedef typename graph_traits<graph_type>::node_iterator node_iterator;
1.22 - typedef typename graph_traits<graph_type>::each_node_iterator each_node_iterator;
1.23 + typedef typename list_graph::node_iterator node_iterator;
1.24 + typedef typename list_graph::each_node_iterator each_node_iterator;
1.25 graph_type& G;
1.26 std::vector<T> container;
1.27 public:
1.28 node_property_vector(graph_type& _G) : G(_G) {
1.29 int i=0;
1.30 - for(each_node_iterator it=G.first_node(); it.is_valid(); ++it) ++i;
1.31 + for(each_node_iterator it=G.first_node(); it.valid(); ++it) ++i;
1.32 container.resize(i);
1.33 }
1.34 node_property_vector(graph_type& _G, T a) : G(_G) {
1.35 - for(each_node_iterator it=G.first_node(); it.is_valid(); ++it) { container.push_back(a); }
1.36 + for(each_node_iterator it=G.first_node(); it.valid(); ++it) { container.push_back(a); }
1.37 }
1.38 void put(node_iterator nit, const T& a) { container[G.id(nit)]=a; }
1.39 T get(node_iterator nit) { return container[G.id(nit)]; }
1.40 @@ -35,18 +33,18 @@
1.41
1.42 template <typename graph_type, typename T>
1.43 class edge_property_vector {
1.44 - typedef typename graph_traits<graph_type>::edge_iterator edge_iterator;
1.45 - typedef typename graph_traits<graph_type>::each_edge_iterator each_edge_iterator;
1.46 + typedef typename graph_type::edge_iterator edge_iterator;
1.47 + typedef typename graph_type::each_edge_iterator each_edge_iterator;
1.48 graph_type& G;
1.49 std::vector<T> container;
1.50 public:
1.51 edge_property_vector(graph_type& _G) : G(_G) {
1.52 int i=0;
1.53 - for(each_edge_iterator it=G.first_edge(); it.is_valid(); ++it) ++i;
1.54 + for(each_edge_iterator it=G.first_edge(); it.valid(); ++it) ++i;
1.55 container.resize(i);
1.56 }
1.57 edge_property_vector(graph_type& _G, T a) : G(_G) {
1.58 - for(each_edge_iterator it=G.first_edge(); it.is_valid(); ++it) {
1.59 + for(each_edge_iterator it=G.first_edge(); it.valid(); ++it) {
1.60 container.push_back(a);
1.61 }
1.62 }