Changeset 12:0810e3fc64a4 in lemon-0.x for src
- Timestamp:
- 01/12/04 12:49:16 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@25
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci_graph_demo.cc
r9 r12 30 30 31 31 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; 32 std::cout << "number of nodes: " << number_of <each_node_iterator>(G.first_node()) << std::endl;32 std::cout << "number of nodes: " << number_of(G.first_node()) << std::endl; 33 33 34 34 for(each_node_iterator i=G.first_node(); i.is_valid(); ++i) { … … 39 39 } 40 40 std::cout << std::endl; 41 42 std::cout<< " "; 43 for(out_edge_iterator j=G.first_out_edge(i); j.is_valid(); ++j) { 44 std::cout << G.a_node(j) << "->" << G.b_node(j) << " "; } 45 std::cout<<std::endl; 46 41 47 std::cout << " indegree: (in_edge_oterator) " << number_of(G.first_in_edge(i)) << " "; 42 48 for(in_edge_iterator j=G.first_in_edge(i); j.is_valid(); ++j) { 43 49 std::cout << j << " "; } 44 50 std::cout << std::endl; 51 52 std::cout<< " "; 53 for(in_edge_iterator j=G.first_in_edge(i); j.is_valid(); ++j) { 54 std::cout << G.a_node(j) << "->" << G.b_node(j) << " "; } 55 std::cout<<std::endl; 56 45 57 std::cout << " degree: (sym_edge_iterator) " << number_of(G.first_sym_edge(i)) << " "; 46 58 for(sym_edge_iterator j=G.first_sym_edge(i); j.is_valid(); ++j) { 47 59 std::cout << j << " "; } 60 std::cout<<std::endl; 61 62 std::cout<< " "; 63 for(sym_edge_iterator j=G.first_sym_edge(i); j.is_valid(); ++j) { 64 std::cout << G.a_node(j) << "->" << G.b_node(j) << " "; } 48 65 std::cout<<std::endl; 49 66 }
Note: See TracChangeset
for help on using the changeset viewer.