
Thanks Moritz for the information and the examples. It is expecially merging heaps I am interested in and it seems that relaxed_heap has a combine method to merge heaps. Thanks alot for the help. Line ________________________________ Fra: boost-users-bounces@lists.boost.org på vegne af moritz Hilger Sendt: fr 11-07-2008 09:55 Til: boost-users@lists.boost.org Emne: Re: [Boost-users] Relaxed heaps Hi Line, afaik there is no real documentation for the relaxed heap. It resides in boost/pending/relaxed_heap.hpp. There's also a binary heap in mutable_queue.hpp. Find below some basic code on how to initialize the heaps typedef graph_traits<graph_t>::vertex_descriptor vertex_t; typedef property_map<graph_t, vertex_index_t>::const_type vertex_index_map_t; // set up distance map typedef iterator_property_map<std::vector<cost_t>::iterator, vertex_index_map_t> distance_map_t; std::vector<cost_t> distance_vector(num_vertices(graph),std::numeric_limits<cost_t>::max()); distance_map_t distances(distance_vector.begin(), vertex_indices); typedef indirect_cmp<distance_map_t, compare_t> indirect_cmp_t; indirect_cmp_t icmp(distances, compare_t()); #ifdef MUTABLE typedef mutable_queue<vertex_t, std::vector<vertex_t>, indirect_cmp_t, vertex_index_map_t> Queue; #endif #ifdef RELAXED typedef relaxed_heap<vertex_t, indirect_cmp_t, vertex_index_map_t> Queue; #endif Queue Q(num_vertices(g), icmp, vertex_indices); afterwards you can insert elements into the heap via Q.push( ... ), get a reference to the first element via Q.top(), remove the first with Q.pop(), update an element's position with Q.update( ... ), ask if Q.empty() etc. Regards, Moritz On Fri, Jul 11, 2008 at 1:55 AM, Line Blander Reinhardt <lbr@imm.dtu.dk> wrote:
Hi all I would like to know where I can get some information about how to use the relaxed heaps in Boost? I would also like to know which file/files it is located in? Are there any bugs on relaxed heaps that has been fixed since 1.33.1 ?
Thanks alot for your help. Line
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users