COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
01/20/04 18:39:13 (21 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@32
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci_property_vector.hh

    r9 r19  
    33
    44#include <vector>
    5 
    6 #include <marci_graph_traits.hh>
    75
    86namespace marci {
     
    119  int number_of(iterator _it) {
    1210    int i=0;
    13     for( ; _it.is_valid(); ++_it) { ++i; }
     11    for( ; _it.valid(); ++_it) { ++i; }
    1412    return i;
    1513  }
     
    1715  template <typename graph_type, typename T>
    1816  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;
    2119    graph_type& G;
    2220    std::vector<T> container;
     
    2422    node_property_vector(graph_type& _G) : G(_G) {
    2523      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;
    2725      container.resize(i);
    2826    }
    2927    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); }
    3129    }
    3230    void put(node_iterator nit, const T& a) { container[G.id(nit)]=a; }
     
    3634  template <typename graph_type, typename T>
    3735  class edge_property_vector {
    38     typedef typename graph_traits<graph_type>::edge_iterator edge_iterator;
    39     typedef typename graph_traits<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;
    4038    graph_type& G;
    4139    std::vector<T> container;
     
    4341    edge_property_vector(graph_type& _G) : G(_G) {
    4442      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;
    4644      container.resize(i);
    4745    }
    4846    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) {
    5048        container.push_back(a);
    5149      }
Note: See TracChangeset for help on using the changeset viewer.