]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/graph/example/reverse-graph-eg.cpp
1 //=======================================================================
2 // Copyright 2001 Jeremy G. Siek, Andrew Lumsdaine, Lie-Quan Lee,
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //=======================================================================
8 #include <boost/config.hpp>
15 #include <boost/graph/adjacency_list.hpp>
16 #include <boost/graph/reverse_graph.hpp>
17 #include <boost/graph/graph_utility.hpp>
22 using namespace boost
;
23 typedef adjacency_list
< vecS
, vecS
, bidirectionalS
> Graph
;
38 std::cout
<< "original graph:" << std::endl
;
39 print_graph(G
, get(vertex_index
, G
));
42 std::cout
<< std::endl
<< "reversed graph:" << std::endl
;
43 #if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 // avoid VC++ bug...
44 reverse_graph
<Graph
> R(G
);
45 print_graph(R
, get(vertex_index
, G
));
47 print_graph(make_reverse_graph(G
), get(vertex_index
, G
));