.. _program_listing_file_src_graph_dijkstra.hpp: Program Listing for File graph_dijkstra.hpp =========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/graph_dijkstra.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /*** * $Id$ ** * File: graph_dijkstra.hpp * Created: May 9, 2012 * * Author: Olga Wodo, Baskar Ganapathysubramanian * Copyright (c) 2012 Olga Wodo, Baskar Ganapathysubramanian * See accompanying LICENSE. * * This file is part of GraSPI. */ #ifndef GRAPH_DIJKSTRA_HPP #define GRAPH_DIJKSTRA_HPP #include "graspi_types.hpp" #include #include namespace graspi { template inline void determine_shortest_distances(graph_t*G, const edge_weights_t& W, vertex_t source, const Pred& pred, std::vector& d){ boost::filtered_graph FG(*G,pred); unsigned int n = boost::num_vertices(*G); std::vector p(n); std::fill(d.begin(), d.end(), 0.0); for (unsigned int i = 0; i < n; ++i) p[i] = i; boost::dijkstra_shortest_paths(FG, source, boost::predecessor_map(&p[0]) . distance_map(&d[0]).weight_map(W)); } }//graspi-namespace #endif