PageRenderTime 20ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/graph/distributed/detail/dijkstra_shortest_paths.hpp

http://hadesmem.googlecode.com/
C++ Header | 50 lines | 28 code | 12 blank | 10 comment | 0 complexity | 748fa8a261cac5f88b4c49482470a9a5 MD5 | raw file
 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
18namespace boost { namespace graph { namespace distributed { namespace detail {
19
20/**********************************************************************
21 * Dijkstra queue message data                                        *
22 **********************************************************************/
23template<typename DistanceMap, typename PredecessorMap>
24class 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
30public:
31  typedef std::pair<distance_type, predecessor_type> type;
32
33  static type create(distance_type dist, predecessor_type pred)
34  { return std::make_pair(dist, pred); }
35};
36
37template<typename DistanceMap>
38class dijkstra_msg_value<DistanceMap, dummy_property_map>
39{
40  typedef typename property_traits<DistanceMap>::key_type vertex_descriptor;
41public:
42  typedef typename property_traits<DistanceMap>::value_type type;
43
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