1 | // |
2 | //======================================================================= |
3 | // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. |
4 | // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek |
5 | // |
6 | // Distributed under the Boost Software License, Version 1.0. (See |
7 | // accompanying file LICENSE_1_0.txt or copy at |
8 | // http://www.boost.org/LICENSE_1_0.txt) |
9 | //======================================================================= |
10 | // |
11 | #ifndef BOOST_GRAPH_TRANSPOSE_HPP |
12 | #define BOOST_GRAPH_TRANSPOSE_HPP |
13 | |
14 | #include <boost/config.hpp> |
15 | #include <boost/graph/graph_traits.hpp> |
16 | #include <boost/graph/reverse_graph.hpp> |
17 | #include <boost/graph/copy.hpp> |
18 | |
19 | |
20 | namespace boost { |
21 | |
22 | template <class VertexListGraph, class MutableGraph> |
23 | void transpose_graph(const VertexListGraph& G, MutableGraph& G_T) |
24 | { |
25 | reverse_graph<VertexListGraph> R(G); |
26 | copy_graph(R, G_T); |
27 | } |
28 | |
29 | template <class VertexListGraph, class MutableGraph, |
30 | class P, class T, class R> |
31 | void transpose_graph(const VertexListGraph& G, MutableGraph& G_T, |
32 | const bgl_named_params<P, T, R>& params) |
33 | { |
34 | reverse_graph<VertexListGraph> Rev(G); |
35 | copy_graph(Rev, G_T, params); |
36 | } |
37 | |
38 | } // namespace boost |
39 | |
40 | #endif // BOOST_GRAPH_TRANSPOSE_HPP |
41 | |