
Ok. Using named parameters works (i.e., no compile errors). Now I'd have to wait for your fix for the edge() issue. I am using the release load 1.42. Since this is minor change (I hope), can I simply use your fix as a patch without switching to use development branch? If yes, can you send me the fix by email? Many thanks, Dan
Date: Fri, 16 Apr 2010 15:42:23 -0400 From: jewillco@osl.iu.edu To: boost@lists.boost.org Subject: Re: [boost] CSR graph in max flow
On Fri, 16 Apr 2010, Dan Jiang wrote:
Hi Jeremiah, Here is the code and error. Thanks again for your help. -Dan ========================================== typedef compressed_sparse_row_graph<directedS> Traits; struct EdgeProp{ float capacity; float residual_capacity; Traits::edge_descriptor reverse_edge; }; typedef compressed_sparse_row_graph<directedS, property<vertex_index_t, DWORD32>, EdgeProp, no_property, // Graph Property DWORD32, // Vertex Type DWORD32> // EdgeIndex Type BOOST_Graph; The code that errors out: flow = (float)push_relabel_max_flow(g, s, t);
Since you are using bundled properties, you need to give the capacity, residual, and reverse edge maps explicitly as arguments to push_relabel_max_flow. Please add those as separate arguments (using the named parameter mechanism) and see if that helps. I don't know why the maps default to identity_property_map -- that seems like it will basically never work. Also, the push_relabel_max_flow code shouldn't be using operator[]. Are you using the Boost trunk or a release version? I can put some fixes into the trunk for some of these issues.
-- Jeremiah Willcock _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
_________________________________________________________________ Hotmail & Messenger. Get them on your phone now. http://go.microsoft.com/?linkid=9724463