|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
[BGL] Access bundle graph propertiesHow does one access a bundle graph property in adjacency_list ?
for example struct VertexProperties { int index; bool status; }; struct EdgeProperties { int index; bool status; }; struct GraphProperties { int something; }; boost::adjacency_list < boost::listS, boost::vecS, boost::directedS, VertexProperties, EdgeProperties, GraphProperties > graph; if 'v' is a vertex then I can do 'grap[v].status' to get that vertex property. But what about the graph properties? I've tried 'graph.something' but that didn't work :( Any suggestions ? regards, Ioannis _______________________________________________ Boost-users mailing list Boost-users@... http://lists.boost.org/mailman/listinfo.cgi/boost-users |
|
|
Re: [BGL] Access bundle graph propertiesThis might help...
http://www.boost.org/libs/graph/doc/bundles.html -----Original Message----- From: Ioannis Nousias [mailto:s0238762@...] Sent: Monday, February 18, 2008 3:55 PM To: boost-users@... Subject: [Boost-users] [BGL] Access bundle graph properties How does one access a bundle graph property in adjacency_list ? for example struct VertexProperties { int index; bool status; }; struct EdgeProperties { int index; bool status; }; struct GraphProperties { int something; }; boost::adjacency_list < boost::listS, boost::vecS, boost::directedS, VertexProperties, EdgeProperties, GraphProperties > graph; if 'v' is a vertex then I can do 'grap[v].status' to get that vertex property. But what about the graph properties? I've tried 'graph.something' but that didn't work :( Any suggestions ? regards, Ioannis _______________________________________________ Boost-users mailing list Boost-users@... http://lists.boost.org/mailman/listinfo.cgi/boost-users |
|
|
Re: [BGL] Access bundle graph propertiesthat's the page I was reading, but it doesn't mention bundle graph
properties. It talks about vertex and edge bundle properties only. By the way. I use the following for now: graph.m_property.something; which works, but I know it's wrong from an interface point of view (the member m_property is meant to be protected, but for some implementation detail, it isn't) Ferng, Andrew D wrote: > This might help... > http://www.boost.org/libs/graph/doc/bundles.html > > > > -----Original Message----- > From: Ioannis Nousias [mailto:s0238762@...] > Sent: Monday, February 18, 2008 3:55 PM > To: boost-users@... > Subject: [Boost-users] [BGL] Access bundle graph properties > > How does one access a bundle graph property in adjacency_list ? > > for example > > struct VertexProperties > { > int index; > bool status; > }; > > struct EdgeProperties > { > int index; > bool status; > }; > > struct GraphProperties > { > int something; > }; > > boost::adjacency_list > < > boost::listS, > boost::vecS, > boost::directedS, > VertexProperties, > EdgeProperties, > GraphProperties > > graph; > > > if 'v' is a vertex then I can do 'grap[v].status' to get that vertex > property. But what about the graph properties? I've tried > 'graph.something' but that didn't work :( > > Any suggestions ? > > regards, > Ioannis > _______________________________________________ > Boost-users mailing list > Boost-users@... > http://lists.boost.org/mailman/listinfo.cgi/boost-users > > > _______________________________________________ Boost-users mailing list Boost-users@... http://lists.boost.org/mailman/listinfo.cgi/boost-users |
|
|
Re: [BGL] Access bundle graph propertiesHi,
I think you should use the public method get_property of the adjacency_list to acces properly the graph property. See http://www.boost.org/libs/graph/doc/adjacency_list.html template <class GraphProperties, class GraphPropertyTag> typename graph_property<adjacency_list, GraphPropertyTag>::type& get_property(adjacency_list& g, GraphPropertyTag); Return the property specified by GraphPropertyTag that is attached to the graph object g. The graph_property traits class is defined in boost/graph/adjacency_list.hpp. Cheers, ~Benoît _______________________________________________ Boost-users mailing list Boost-users@... http://lists.boost.org/mailman/listinfo.cgi/boost-users |
|
|
Re: [BGL] Access bundle graph propertiesHi
I'm also facing the same problem. For me also m_property works fine but what does it actually means and also if anybody else let us know a better and more cleaner way to access the graph properties that would be gr8
|
| Free embeddable forum powered by Nabble | Forum Help |