Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79833 - trunk/libs/graph/example
From: jewillco_at_[hidden]
Date: 2012-08-01 11:31:23


Author: jewillco
Date: 2012-08-01 11:31:23 EDT (Wed, 01 Aug 2012)
New Revision: 79833
URL: http://svn.boost.org/trac/boost/changeset/79833

Log:
Fixed subgraph_properties example and added more examples to Jamfile.v2
Text files modified:
   trunk/libs/graph/example/Jamfile.v2 | 2 ++
   trunk/libs/graph/example/subgraph_properties.cpp | 22 +++++++++++-----------
   2 files changed, 13 insertions(+), 11 deletions(-)

Modified: trunk/libs/graph/example/Jamfile.v2
==============================================================================
--- trunk/libs/graph/example/Jamfile.v2 (original)
+++ trunk/libs/graph/example/Jamfile.v2 2012-08-01 11:31:23 EDT (Wed, 01 Aug 2012)
@@ -41,3 +41,5 @@
 exe two_graphs_common_spanning_trees : two_graphs_common_spanning_trees.cpp ;
 exe strong_components : strong_components.cpp ../build//boost_graph ;
 exe strong-components : strong-components.cpp ;
+exe subgraph : subgraph.cpp ;
+exe subgraph_properties : subgraph_properties.cpp ;

Modified: trunk/libs/graph/example/subgraph_properties.cpp
==============================================================================
--- trunk/libs/graph/example/subgraph_properties.cpp (original)
+++ trunk/libs/graph/example/subgraph_properties.cpp 2012-08-01 11:31:23 EDT (Wed, 01 Aug 2012)
@@ -69,20 +69,20 @@
   
   std::cout << std::endl << "After initializing properties for G1:" << std::endl;
   std::cout << " Global and local properties for vertex G0[C]..." << std::endl;
- std::cout << " G0[C]= " << boost::get(vertex_name, G0, C) << std::endl;// prints: "G0[C]= C"
- std::cout << " G1[A1]= " << boost::get(vertex_name, G1, A1) << std::endl;// prints: "G1[A1]= A1"
+ std::cout << " G0[C]= " << boost::get(vertex_name, G0, vertex(C, G0)) << std::endl;// prints: "G0[C]= C"
+ std::cout << " G1[A1]= " << boost::get(vertex_name, G1, vertex(A1, G1)) << std::endl;// prints: "G1[A1]= A1"
   
   name1[B1] = "B1";
   
   std::cout << " Global and local properties for vertex G0[E]..." << std::endl;
- std::cout << " G0[E]= " << boost::get(vertex_name, G0, E) << std::endl;// prints: "G0[E]= E"
- std::cout << " G1[B1]= " << boost::get(vertex_name, G1, B1) << std::endl;// prints: "G1[B1]= B1"
+ std::cout << " G0[E]= " << boost::get(vertex_name, G0, vertex(E, G0)) << std::endl;// prints: "G0[E]= E"
+ std::cout << " G1[B1]= " << boost::get(vertex_name, G1, vertex(B1, G1)) << std::endl;// prints: "G1[B1]= B1"
   
   name1[C1] = "C1";
   
   std::cout << " Global and local properties for vertex G0[F]..." << std::endl;
- std::cout << " G0[F]= " << boost::get(vertex_name, G0, F) << std::endl;// prints: "G0[F]= F"
- std::cout << " G1[C1]= " << boost::get(vertex_name, G1, C1) << std::endl;// prints: "G1[C1]= C1"
+ std::cout << " G0[F]= " << boost::get(vertex_name, G0, vertex(F, G0)) << std::endl;// prints: "G0[F]= F"
+ std::cout << " G1[C1]= " << boost::get(vertex_name, G1, vertex(C1, G1)) << std::endl;// prints: "G1[C1]= C1"
   
   Graph& G2 = G0.create_subgraph();
   enum { A2, B2 }; // for conveniently refering to vertices in G2
@@ -95,15 +95,15 @@
   
   std::cout << std::endl << std::endl << "After initializing properties for G2:" << std::endl;
   std::cout << " Global and local properties for vertex G0[A]" << std::endl;
- std::cout << " G0[A]= " << boost::get(vertex_name, G0, A) << std::endl;// prints: "G0[A]= A"
- std::cout << " G2[A2]= " << boost::get(vertex_name, G2, A2) << std::endl;// prints: "G2[A2]= A2"
+ std::cout << " G0[A]= " << boost::get(vertex_name, G0, vertex(A, G0)) << std::endl;// prints: "G0[A]= A"
+ std::cout << " G2[A2]= " << boost::get(vertex_name, G2, vertex(A2, G2)) << std::endl;// prints: "G2[A2]= A2"
   
   name2[B2] = "B2";
   
   std::cout << " Global and local properties for vertex G0[C]..." << std::endl;
- std::cout << " G0[C]= " << boost::get(vertex_name, G0, C) << std::endl;// prints: "G0[C]= C"
- std::cout << " G1[A1]= " << boost::get(vertex_name, G1, A1) << std::endl;// prints: "G1[A1]= A1"
- std::cout << " G2[B2]= " << boost::get(vertex_name, G2, B2) << std::endl;// prints: "G2[B2]= B2"
+ std::cout << " G0[C]= " << boost::get(vertex_name, G0, vertex(C, G0)) << std::endl;// prints: "G0[C]= C"
+ std::cout << " G1[A1]= " << boost::get(vertex_name, G1, vertex(A1, G1)) << std::endl;// prints: "G1[A1]= A1"
+ std::cout << " G2[B2]= " << boost::get(vertex_name, G2, vertex(B2, G2)) << std::endl;// prints: "G2[B2]= B2"
   
   return 0;
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk