File indexing completed on 2025-01-18 09:37:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_GRAPH_PROFILE_HPP
0013 #define BOOST_GRAPH_PROFILE_HPP
0014
0015 #include <boost/graph/graph_traits.hpp>
0016 #include <boost/detail/numeric_traits.hpp>
0017 #include <boost/graph/bandwidth.hpp>
0018
0019 namespace boost
0020 {
0021
0022 template < typename Graph, typename VertexIndexMap >
0023 typename graph_traits< Graph >::vertices_size_type profile(
0024 const Graph& g, VertexIndexMap index)
0025 {
0026 typename graph_traits< Graph >::vertices_size_type b = 0;
0027 typename graph_traits< Graph >::vertex_iterator i, end;
0028 for (boost::tie(i, end) = vertices(g); i != end; ++i)
0029 {
0030 b += ith_bandwidth(*i, g, index) + 1;
0031 }
0032
0033 return b;
0034 }
0035
0036 template < typename Graph >
0037 typename graph_traits< Graph >::vertices_size_type profile(const Graph& g)
0038 {
0039 return profile(g, get(vertex_index, g));
0040 }
0041
0042 }
0043
0044 #endif