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