issues with setting properties on reverse graph

Trying to set graph properties on reverse graph does not seem to be working.
I am using boost 1.40.0
A simple program where we set graph_name to "graph" on a reverse graph does
not work
int main()
{
using namespace boost;
using std::string;
typedef adjacency_list

On Mon, 16 Nov 2009, Mangal wrote:
Trying to set graph properties on reverse graph does not seem to be working. I am using boost 1.40.0 A simple program where we set graph_name to "graph" on a reverse graph does not work int main() { using namespace boost; using std::string; typedef adjacency_list
, property > graph_t; typedef reverse_graph
reverse_graph_t; graph_t g; reverse_graph_t sg = reverse_graph_t(g); std::string Name = "graph"; set_property(sg, graph_name, Name) ;
std::cout << "name: " << get_property(sg, graph_name) << std::endl; return 1;
}
Name comes out to be empty in this case.
any ideas???
Does it work if you set the name on the original graph? What about setting it on the original graph and reading it from the reverse_graph? What about setting it on the reverse_graph and reading it from the original? -- Jeremiah Willcock

yes it works when I set it on the original graph. setting it in the original graph and reading in reverse_graph works. (which is what I do in my application) I had a function template<Graph> void myfun( Graph & g) { //some code get_property(g, graph_MyProperty) = propertyValue } and wanted to use it like myfun(originalGraph) myfun(reverseGraph) setting property on the reverse_graph does not seem to be doing anything, infact when trying to access the property somewhere else throws a null reference exception Jeremiah Willcock wrote:
On Mon, 16 Nov 2009, Mangal wrote:
Trying to set graph properties on reverse graph does not seem to be working. I am using boost 1.40.0 A simple program where we set graph_name to "graph" on a reverse graph does not work int main() { using namespace boost; using std::string; typedef adjacency_list
, property > graph_t; typedef reverse_graph
reverse_graph_t; graph_t g; reverse_graph_t sg = reverse_graph_t(g); std::string Name = "graph"; set_property(sg, graph_name, Name) ;
std::cout << "name: " << get_property(sg, graph_name) << std::endl; return 1;
}
Name comes out to be empty in this case.
any ideas???
Does it work if you set the name on the original graph? What about setting it on the original graph and reading it from the reverse_graph? What about setting it on the reverse_graph and reading it from the original?
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- View this message in context: http://old.nabble.com/issues-with-setting-properties-on-reverse-graph-tp2638... Sent from the Boost - Users mailing list archive at Nabble.com.

On Tue, 24 Nov 2009, Mangal wrote:
yes it works when I set it on the original graph. setting it in the original graph and reading in reverse_graph works. (which is what I do in my application)
I had a function template<Graph> void myfun( Graph & g) { //some code get_property(g, graph_MyProperty) = propertyValue }
and wanted to use it like myfun(originalGraph) myfun(reverseGraph)
setting property on the reverse_graph does not seem to be doing anything, infact when trying to access the property somewhere else throws a null reference exception
Could you please try building your reverse_graph as:
reverse_graph

in the first example that i posted i made the following change to the
definition of reverse_graph
typedef reverse_graph
On Tue, 24 Nov 2009, Mangal wrote:
yes it works when I set it on the original graph. setting it in the original graph and reading in reverse_graph works. (which is what I do in my application)
I had a function template<Graph> void myfun( Graph & g) { //some code get_property(g, graph_MyProperty) = propertyValue }
and wanted to use it like myfun(originalGraph) myfun(reverseGraph)
setting property on the reverse_graph does not seem to be doing anything, infact when trying to access the property somewhere else throws a null reference exception
Could you please try building your reverse_graph as:
reverse_graph
and see if that changes the behavior?
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- View this message in context: http://old.nabble.com/issues-with-setting-properties-on-reverse-graph-tp2638... Sent from the Boost - Users mailing list archive at Nabble.com.

so this is what I see is happening if I use get_property(graph, propertyname) = propertyvalue to set the property on the graph then setting the property on reverse graphs does not work (even with the new typedef in the sample code i posted) however using set_property(graph, propertyname, propertyvalue) works when used with the new typedef. (even in my application) Thanks Jeremiah Mangal wrote:
in the first example that i posted i made the following change to the definition of reverse_graph
typedef reverse_graph
reverse_graph_t; and now setting the name property on reverse graph works. accessing it using the original graph also works. However in my app which uses a new property defined by me the new typedef still throws at runtime I will work with it a little more and if I can't figure it out will let you know
Thanks for the help
Jeremiah Willcock wrote:
On Tue, 24 Nov 2009, Mangal wrote:
yes it works when I set it on the original graph. setting it in the original graph and reading in reverse_graph works. (which is what I do in my application)
I had a function template<Graph> void myfun( Graph & g) { //some code get_property(g, graph_MyProperty) = propertyValue }
and wanted to use it like myfun(originalGraph) myfun(reverseGraph)
setting property on the reverse_graph does not seem to be doing anything, infact when trying to access the property somewhere else throws a null reference exception
Could you please try building your reverse_graph as:
reverse_graph
and see if that changes the behavior?
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- View this message in context: http://old.nabble.com/issues-with-setting-properties-on-reverse-graph-tp2638... Sent from the Boost - Users mailing list archive at Nabble.com.

On Tue, 24 Nov 2009, Mangal wrote:
so this is what I see is happening
if I use get_property(graph, propertyname) = propertyvalue to set the property on the graph then setting the property on reverse graphs does not work (even with the new typedef in the sample code i posted)
however using set_property(graph, propertyname, propertyvalue) works when used with the new typedef. (even in my application)
Thanks Jeremiah
Please try r57910; that should fix the get_property() issue. -- Jeremiah Willcock

that fixed the issue I actually just manually edited reverse_graph.pp and properties.hpp with your changes and it compiles and runs fine now. Thanks Jeremiah Jeremiah Willcock wrote:
On Tue, 24 Nov 2009, Mangal wrote:
so this is what I see is happening
if I use get_property(graph, propertyname) = propertyvalue to set the property on the graph then setting the property on reverse graphs does not work (even with the new typedef in the sample code i posted)
however using set_property(graph, propertyname, propertyvalue) works when used with the new typedef. (even in my application)
Thanks Jeremiah
Please try r57910; that should fix the get_property() issue.
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- View this message in context: http://old.nabble.com/issues-with-setting-properties-on-reverse-graph-tp2638... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
Jeremiah Willcock
-
Mangal