RE: [Boost-Users] BFS-visitor with gcc3.0.1

Thank you very much... just worked perfect! Yours truly, Marc -----Original Message----- From: Jeremy Siek [mailto:jsiek@cs.indiana.edu] Sent: Thursday, March 21, 2002 10:53 PM To: Boost-Users@yahoogroups.com Subject: RE: [Boost-Users] BFS-visitor with gcc3.0.1 Sure. Here's the gist: typedef vector<...>::iterator vec_iter; typedef graph_traits<Graph>::vertices_size_type size_type; typedef property_map<Graph, vertex_index_t>::const_type VertexID; boost::iterator_property_map<vec_iter, VertexID, size_type, size_type&> dist_pmap(dist.begin(), get(vertex_index, g)); Also, in the BGL book there is an example of iterator property map on page 79-80. And the web pages have a slighly different example: http://www.boost.org/libs/property_map/iterator_property_map.html Cheers, Jeremy On Thu, 21 Mar 2002, Wintermantel , Marc wrote: marc.w> Hello Jeremy, marc.w> marc.w> marc.w> Thank you for your quick answer. Unfortunately I'm not so experienced marc.w> with these property maps. Could you give me a hint how to wrap this marc.w> iterator_property_map around my vector::iterator? marc.w> marc.w> marc.w> marc.w> Yours truly, marc.w> marc.w> marc.w> marc.w> Marc Wintermantel marc.w> marc.w> marc.w> marc.w> -----Original Message----- marc.w> From: Jeremy Siek [mailto:jsiek@cs.indiana.edu] marc.w> Sent: Wednesday, March 20, 2002 2:40 PM marc.w> To: Boost-Users@yahoogroups.com marc.w> Subject: Re: [Boost-Users] BFS-visitor with gcc3.0.1 marc.w> marc.w> marc.w> marc.w> Hi Marc, marc.w> marc.w> I think your problem is that BGL has get() and put() property map marc.w> functions defined for pointers, but vector::iterator is not guaranteed marc.w> to marc.w> be a pointer. marc.w> marc.w> The fix is to wrap vector::iterator using the iterator_property_map marc.w> class. marc.w> marc.w> Cheers, marc.w> Jeremy marc.w> marc.w> On Wed, 20 Mar 2002, Wintermantel , Marc wrote: marc.w> marc.w> marc.w> Hello, marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> I tried to complile the following code that worked under gcc marc.w> 2.95.3 marc.w> marc.w> under gcc 3.0.1 and got tons of error messages: marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> typedef adjacency_list< marc.w> marc.w> marc.w> marc.w> setS, marc.w> marc.w> marc.w> marc.w> vecS, marc.w> marc.w> marc.w> marc.w> undirectedS, marc.w> marc.w> marc.w> marc.w> property< marc.w> marc.w> marc.w> marc.w> vertex_color_t, marc.w> marc.w> marc.w> marc.w> default_color_type, marc.w> marc.w> marc.w> marc.w> property< marc.w> marc.w> marc.w> marc.w> vertex_degree_t, marc.w> marc.w> marc.w> marc.w> int, marc.w> marc.w> marc.w> marc.w> property< marc.w> marc.w> marc.w> marc.w> vertex_current_degree_t, marc.w> marc.w> marc.w> marc.w> int, marc.w> marc.w> marc.w> marc.w> property< marc.w> marc.w> marc.w> marc.w> vertex_priority_t, marc.w> marc.w> marc.w> marc.w> int > > > > > Graph; marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> ... marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> std::vector<graph_traits<Graph>::vertices_size_type> marc.w> marc.w> dist(num_vertices(G), 0); marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> breadth_first_search marc.w> marc.w> marc.w> marc.w> (G, e, visitor marc.w> marc.w> marc.w> marc.w> ( marc.w> marc.w> marc.w> marc.w> make_bfs_visitor(record_distances(dist.begin(), marc.w> marc.w> on_tree_edge() ) ) marc.w> marc.w> marc.w> marc.w> ) marc.w> marc.w> marc.w> marc.w> ); marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> ... marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> The errors have something to deal with the visitors, more I marc.w> could not marc.w> marc.w> read out of the errors. When I use a simple array in the form marc.w> int d[n] marc.w> marc.w> it works. marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> Yours truly, marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> Marc Wintermantel marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> Marc Wintermantel marc.w> marc.w> marc.w> marc.w> IMES - Structures Technology marc.w> marc.w> marc.w> marc.w> ETH Zurich, LEO C4 marc.w> marc.w> marc.w> marc.w> Leonhardstrasse 27 marc.w> marc.w> marc.w> marc.w> CH- 8092 Zurich marc.w> marc.w> marc.w> marc.w> Tel. ++41 1 633 35 32 marc.w> marc.w> marc.w> marc.w> Fax. ++41 1 632 17 02 marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> [Non-text portions of this message have been removed] marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> Info: <http://www.boost.org> marc.w> marc.w> Wiki: marc.w> <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> marc.w> marc.w> Unsubscribe: <mailto:boost-users-unsubscribe@yahoogroups.com> marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> Your use of Yahoo! Groups is subject to marc.w> http://docs.yahoo.com/info/terms/ marc.w> marc.w> marc.w> marc.w> marc.w> marc.w> ---------------------------------------------------------------------- marc.w> Jeremy Siek http://php.indiana.edu/~jsiek/ marc.w> Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu marc.w> C++ Booster (http://www.boost.org) office phone: (812) 855-3608 marc.w> ---------------------------------------------------------------------- ---------------------------------------------------------------------- Jeremy Siek http://php.indiana.edu/~jsiek/ Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu C++ Booster (http://www.boost.org) office phone: (812) 855-3608 ---------------------------------------------------------------------- Yahoo! Groups Sponsor ADVERTISEMENT <http://rd.yahoo.com/M=215002.1818248.3328688.1261774/D=egroupweb/S=1705 006788:HM/A=847665/R=0/*http:/ads.x10.com/?bHlhaG9vbW9uc3RlcjcuZGF0=1016 747598%3eM=215002.1818248.3328688.1261774/D=egroupweb/S=1705006788:HM/A= 847665/R=1> <http://us.adserver.yahoo.com/l?M=215002.1818248.3328688.1261774/D=egrou pmail/S=1705006788:HM/A=847665/rand=218683910> Info: <http://www.boost.org> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> Unsubscribe: <mailto:boost-users-unsubscribe@yahoogroups.com> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . [Non-text portions of this message have been removed]
participants (1)
-
Wintermantel , Marc