1 // Copyright (C) 2004-2006 The Trustees of Indiana University. 2 3 // Use, modification and distribution is subject to the Boost Software 4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 7 // Authors: Douglas Gregor 8 // Andrew Lumsdaine 9 #ifndef BOOST_GRAPH_PARALLEL_DIJKSTRA_DETAIL_HPP 10 #define BOOST_GRAPH_PARALLEL_DIJKSTRA_DETAIL_HPP 11 12 #ifndef BOOST_GRAPH_USE_MPI 13 #error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included" 14 #endif 15 16 #include <boost/property_map/property_map.hpp> 17 18 namespace boost { namespace graph { namespace distributed { namespace detail { 19 20 /********************************************************************** 21 * Dijkstra queue message data * 22 **********************************************************************/ 23 template<typename DistanceMap, typename PredecessorMap> 24 class dijkstra_msg_value 25 { 26 typedef typename property_traits<DistanceMap>::value_type distance_type; 27 typedef typename property_traits<PredecessorMap>::value_type 28 predecessor_type; 29 30 public: 31 typedef std::pair<distance_type, predecessor_type> type; 32 create(distance_type dist,predecessor_type pred)33 static type create(distance_type dist, predecessor_type pred) 34 { return std::make_pair(dist, pred); } 35 }; 36 37 template<typename DistanceMap> 38 class dijkstra_msg_value<DistanceMap, dummy_property_map> 39 { 40 typedef typename property_traits<DistanceMap>::key_type vertex_descriptor; 41 public: 42 typedef typename property_traits<DistanceMap>::value_type type; 43 create(type dist,vertex_descriptor)44 static type create(type dist, vertex_descriptor) { return dist; } 45 }; 46 /**********************************************************************/ 47 48 } } } } // end namespace boost::graph::distributed::detail 49 50 #endif // BOOST_GRAPH_PARALLEL_DIJKSTRA_DETAIL_HPP 51