I want to use the parallel version of dijkstra_shortest_paths, here is my
code, it works very well with the sequential version of BGL, but can not be
compiled with parallel BGL.
typedef boost::adjacency_list < boost::vecS, boost::vecS,
boost::undirectedS,
boost::no_property, boost::property < boost::edge_weight_t, double > >
graph_t;
typedef boost::graph_traits < graph_t >::vertex_descriptor
vertex_descriptor;
typedef boost::graph_traits < graph_t >::edge_descriptor edge_descriptor;
typedef std::pair Edge;
template <class Vertex>
struct target_visitor : public default_dijkstra_visitor
{
target_visitor(vector<bool>* vec,int total) :
vec_(vec),num_(0),total_(total),examined_(0) { }
template <class Graph>
void examine_vertex(Vertex v, Graph& g)
{
examined_++;
if ((*vec_)[v])
{
//visited, set false to prevent multi visit
(*vec_)[v]=false;
num_++;
//cout<<"v:"<size()<<",examined_ point
size is:"<&
p,std::vector<double>& d){
vertex_descriptor sou = vertex(source, g_);
assert(num_vertices(g_)==mesh_->m_vecVertex.size());
property_map::type weightmap = get(edge_weight, g_);
property_map::type indexmap = get(vertex_index,
g_);
try
{
dijkstra_shortest_paths(g_, sou, &p[0], &d[0], weightmap, indexmap,
std::less<double>(), closed_plus<double>(),
(std::numeric_limits<double>::max)(), 0,
target_visitor(&tar,num));
//dijkstra_shortest_paths(g_, sou,
predecessor_map(&p[0]).distance_map(&d[0]));
}
catch (std::exception e)
{
}
}
The compile errors are:
Error 11 error C2664: 'boost::put' : cannot convert parameter 2 from
'boost::detail::parallel::global_descriptor<LocalDescriptor>' to 'ptrdiff_t'
C:\boost_1_49_0\boost_1_49_0\boost\graph\distributed\crauser_et_al_shortest_paths.hpp
584
Error 12 error C2664: 'boost::put' : cannot convert parameter 2 from
'boost::detail::parallel::global_descriptor<LocalDescriptor>' to 'ptrdiff_t'
C:\boost_1_49_0\boost_1_49_0\boost\graph\distributed\crauser_et_al_shortest_paths.hpp
585
Error 13 error C2664: 'boost::put' : cannot convert parameter 2 from
'boost::detail::parallel::global_descriptor<LocalDescriptor>' to 'ptrdiff_t'
C:\boost_1_49_0\boost_1_49_0\boost\graph\distributed\crauser_et_al_shortest_paths.hpp
587
--
Best Regards
Areslp