2 //=======================================================================
3 // Copyright 2002 Marc Wintermantel (wintermantel@even-ag.ch)
4 // ETH Zurich, Center of Structure Technologies (www.imes.ethz.ch/st)
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 //=======================================================================
11 #ifndef BOOST_GRAPH_PROFILE_HPP
12 #define BOOST_GRAPH_PROFILE_HPP
14 #include <boost/graph/graph_traits.hpp>
15 #include <boost/detail/numeric_traits.hpp>
16 #include <boost/graph/bandwidth.hpp>
20 template <typename Graph, typename VertexIndexMap>
21 typename graph_traits<Graph>::vertices_size_type
22 profile(const Graph& g, VertexIndexMap index)
24 typename graph_traits<Graph>::vertices_size_type b = 0;
25 typename graph_traits<Graph>::vertex_iterator i, end;
26 for (tie(i, end) = vertices(g); i != end; ++i){
27 b += ith_bandwidth(*i, g, index) + 1;
33 template <typename Graph>
34 typename graph_traits<Graph>::vertices_size_type
35 profile(const Graph& g)
37 return profile(g, get(vertex_index, g));
43 #endif // BOOST_GRAPH_PROFILE_HPP