Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:37:35

0001 //
0002 //=======================================================================
0003 // Copyright 2002 Marc Wintermantel (wintermantel@even-ag.ch)
0004 // ETH Zurich, Center of Structure Technologies
0005 // (https://web.archive.org/web/20050307090307/http://www.structures.ethz.ch/)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See
0008 // accompanying file LICENSE_1_0.txt or copy at
0009 // http://www.boost.org/LICENSE_1_0.txt)
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 } // namespace boost
0043 
0044 #endif // BOOST_GRAPH_PROFILE_HPP