.
authormarci
Mon, 12 Jan 2004 11:49:16 +0000
changeset 120810e3fc64a4
parent 11 33a84426c221
child 13 d33813af6e50
.
src/work/marci_graph_demo.cc
     1.1 --- a/src/work/marci_graph_demo.cc	Mon Jan 12 11:48:49 2004 +0000
     1.2 +++ b/src/work/marci_graph_demo.cc	Mon Jan 12 11:49:16 2004 +0000
     1.3 @@ -29,7 +29,7 @@
     1.4      }  
     1.5  
     1.6    std::cout << "We construct a directed graph on the node set {0,1,2,...,7}," <<std::endl << "i-->j is arc iff i<j and (i+j)%3." << std::endl;
     1.7 -  std::cout << "number of nodes: " << number_of<each_node_iterator>(G.first_node()) << std::endl;
     1.8 +  std::cout << "number of nodes: " << number_of(G.first_node()) << std::endl;
     1.9  
    1.10    for(each_node_iterator i=G.first_node(); i.is_valid(); ++i) {
    1.11      std::cout << "node " << G.id(i) << std::endl;
    1.12 @@ -38,14 +38,31 @@
    1.13        std::cout << "(" << G.id(G.tail(j)) << "--" << G.id(j) << "->" << G.id(G.head(j)) << ") ";
    1.14      }
    1.15      std::cout << std::endl; 
    1.16 +
    1.17 +    std::cout<< " ";
    1.18 +    for(out_edge_iterator j=G.first_out_edge(i); j.is_valid(); ++j) { 
    1.19 +      std::cout << G.a_node(j) << "->" << G.b_node(j) << " "; } 
    1.20 +    std::cout<<std::endl;
    1.21 +
    1.22      std::cout << " indegree: (in_edge_oterator) " << number_of(G.first_in_edge(i)) << " ";
    1.23      for(in_edge_iterator j=G.first_in_edge(i); j.is_valid(); ++j) { 
    1.24        std::cout << j << " "; } 
    1.25      std::cout << std::endl;
    1.26 +
    1.27 +    std::cout<< " ";
    1.28 +    for(in_edge_iterator j=G.first_in_edge(i); j.is_valid(); ++j) { 
    1.29 +      std::cout << G.a_node(j) << "->" << G.b_node(j) << " "; } 
    1.30 +    std::cout<<std::endl;
    1.31 +
    1.32      std::cout << " degree: (sym_edge_iterator) " << number_of(G.first_sym_edge(i)) << " ";
    1.33      for(sym_edge_iterator j=G.first_sym_edge(i); j.is_valid(); ++j) { 
    1.34        std::cout << j << " "; } 
    1.35      std::cout<<std::endl;
    1.36 +
    1.37 +    std::cout<< " ";
    1.38 +    for(sym_edge_iterator j=G.first_sym_edge(i); j.is_valid(); ++j) { 
    1.39 +      std::cout << G.a_node(j) << "->" << G.b_node(j) << " "; } 
    1.40 +    std::cout<<std::endl;
    1.41    }
    1.42  
    1.43    std::cout << "all edges: ";