[BGL] How to set a complex edge property using add_edge

View: New views
2 Messages — Rating Filter:   Alert me  

[BGL] How to set a complex edge property using add_edge

by Cosimo Calabrese :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi to all,

I'm trying to use the add_edge( u, v, *p*, g ) overload of this
function, but I've founded only example where the edge property of the
graph is a single property.


// ...
typedef adjacency_list<vecS, vecS, directedS, no_property,
                        property<edge_weight_t, int> > Graph;
Graph g( 10 );
// add an edge with weight = 1
property<edge_weight_t, int> edge_property( 1 );
add_edge( 0, 1, edge property, g);
// ...


What about if I've multiple edge property?


// ...
typedef property < edge_ID_t, long,
           property < edge_weight_t, long,
             property < edge_other_prop_t, bool > > > edge_prop;
typedef adjacency_list<vecS, vecS, directedS,
                        no_property, edge_prop> Graph;
// ...


How can I set an edge_prop variable with all the edge properties?


Thanks in advance,
Cosimo Calabrese.

_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Re: [BGL] How to set a complex edge property using add_edge

by Geoff Hilton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Cosimo Calabrese wrote:

> Hi to all,
>
> I'm trying to use the add_edge( u, v, *p*, g ) overload of this
> function, but I've founded only example where the edge property of the
> graph is a single property.
>
>
> // ...
> typedef adjacency_list<vecS, vecS, directedS, no_property,
>                        property<edge_weight_t, int> > Graph;
> Graph g( 10 );
> // add an edge with weight = 1
> property<edge_weight_t, int> edge_property( 1 );
> add_edge( 0, 1, edge property, g);
> // ...
>
>
> What about if I've multiple edge property?
>
>
> // ...
> typedef property < edge_ID_t, long,
>           property < edge_weight_t, long,
>             property < edge_other_prop_t, bool > > > edge_prop;
> typedef adjacency_list<vecS, vecS, directedS,
>                        no_property, edge_prop> Graph;
> // ...
>
>
> How can I set an edge_prop variable with all the edge properties?
>
>
> Thanks in advance,
> Cosimo Calabrese.
look up bundled properties (
http://www.boost.org/doc/libs/1_40_0/libs/graph/doc/bundles.html )

_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users