Boost logo

Boost Users :

Subject: [Boost-users] [PBGL] add_edge return type
From: Cosimo Calabrese (cosimo.calabrese_at_[hidden])
Date: 2011-04-12 05:31:34


Hi to all,

I'm trying to use the PBGL lib on VS2010, WinXP, with OpenMPI support;
I've compiled without any problem the "dijkstra_shortest_paths.cpp" that
I've found in \boost\libs\graph_parallel\example.

So I've tried to add a new edge to the graph, and to assign a property
value to it. The "classical" mode that I always have used in sequential
BGL is:

     boost::graph_traits<Graph>::edge_descriptor ed;
     bool inserted;
     boost::tie( ed, inserted ) =
         boost::add_edge( boost::vertex( 0, g ),
                          boost::vertex( 0, g ),
                          g );

But the compiler scream... it seems that I can't initialize a tie object
in that manner (I've reported the compiler log below).

Instead if I first add an edge (with no assignment to tie object), and
retrive it with boost::edge function, all works:

     boost::property_map<Graph, boost::edge_weight_t>::type weightMap =
         boost::get( boost::edge_weight, g );
     boost::graph_traits<Graph>::edge_descriptor ed;
     bool exists;
     boost::add_edge( boost::vertex( 0, g ), boost::vertex( 0, g ), g );
     boost::tie( ed, exists ) =
         boost::edge( boost::vertex( 0, g ), boost::vertex( 0, g ), g );
     weightMap[ ed ] = 10;

What's wrong?

Thanks,
Cosimo Calabrese.

1>src\main.cpp(75): error C2679: '=' binario: non è stato trovato alcun
operatore che accetti un operando destro di tipo
'boost::adjacency_list<OutEdgeListS,VertexListS,DirectedS,VertexProperty,EdgeProperty>::lazy_add_edge'.
È anche possibile che non vi siano conversioni accettabili.
1> with
1> [
1> OutEdgeListS=boost::vecS,
1>
VertexListS=boost::distributedS<boost::graph::distributed::mpi_process_group,boost::vecS>,
1> DirectedS=boost::undirectedS,
1> VertexProperty=vertex_prop,
1> EdgeProperty=boost::property<boost::edge_weight_t,float>
1> ]
1> D:\dev\lib\boost\boost/tuple/detail/tuple_basic.hpp(588):
potrebbe essere 'boost::tuples::tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9>
&boost::tuples::tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9>::operator =(const
boost::tuples::tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> &)'
1> with
1> [
1>
T0=boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag,unsigned
int>> &,
1> T1=bool &,
1> T2=boost::tuples::detail::tie_traits<void>::type,
1> T3=boost::tuples::detail::tie_traits<void>::type,
1> T4=boost::tuples::detail::tie_traits<void>::type,
1> T5=boost::tuples::detail::tie_traits<void>::type,
1> T6=boost::tuples::detail::tie_traits<void>::type,
1> T7=boost::tuples::detail::tie_traits<void>::type,
1> T8=boost::tuples::detail::tie_traits<void>::type,
1> T9=boost::tuples::detail::tie_traits<void>::type
1> ]
1> durante la ricerca di corrispondenza con l'elenco di
argomenti '(boost::tuples::tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9>,
boost::adjacency_list<OutEdgeListS,VertexListS,DirectedS,VertexProperty,EdgeProperty>::lazy_add_edge)'
1> with
1> [
1>
T0=boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag,unsigned
int>> &,
1> T1=bool &,
1> T2=boost::tuples::detail::tie_traits<void>::type,
1> T3=boost::tuples::detail::tie_traits<void>::type,
1> T4=boost::tuples::detail::tie_traits<void>::type,
1> T5=boost::tuples::detail::tie_traits<void>::type,
1> T6=boost::tuples::detail::tie_traits<void>::type,
1> T7=boost::tuples::detail::tie_traits<void>::type,
1> T8=boost::tuples::detail::tie_traits<void>::type,
1> T9=boost::tuples::detail::tie_traits<void>::type
1> ]
1> and
1> [
1> OutEdgeListS=boost::vecS,
1>
VertexListS=boost::distributedS<boost::graph::distributed::mpi_process_group,boost::vecS>,
1> DirectedS=boost::undirectedS,
1> VertexProperty=vertex_prop,
1> EdgeProperty=boost::property<boost::edge_weight_t,float>
1> ]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net