*** smallest_last_ordering.hpp.orig 2006-03-17 16:48:41.566123258 +0100 --- smallest_last_ordering.hpp 2006-03-17 16:43:39.209673155 +0100 *************** *** 6,11 **** --- 6,19 ---- // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //======================================================================= + + // Revision History: + // 17 March 2006: Fixed a bug: when updating the degree a vertex + // could be moved to a wrong bucket. (Roman Dementiev) + // + + + #ifndef BOOST_SMALLEST_LAST_VERTEX_ORDERING_HPP #define BOOST_SMALLEST_LAST_VERTEX_ORDERING_HPP /* *************** *** 29,46 **** void smallest_last_vertex_ordering(const VertexListGraph& G, Order order, Degree degree, Marker marker) { ! typedef typename graph_traits GraphTraits; typedef typename GraphTraits::vertex_descriptor Vertex; //typedef typename GraphTraits::size_type size_type; typedef std::size_t size_type; const size_type num = num_vertices(G); ! typedef typename vertex_property_map::type ID; typedef bucket_sorter BucketSorter; BucketSorter degree_bucket_sorter(num, num, degree, ! get_vertex_property(G, vertex_index)); smallest_last_vertex_ordering(G, order, degree, marker, degree_bucket_sorter); } --- 37,54 ---- void smallest_last_vertex_ordering(const VertexListGraph& G, Order order, Degree degree, Marker marker) { ! typedef typename boost::graph_traits GraphTraits; typedef typename GraphTraits::vertex_descriptor Vertex; //typedef typename GraphTraits::size_type size_type; typedef std::size_t size_type; const size_type num = num_vertices(G); ! typedef typename boost::detail::vertex_property_map::type ID; typedef bucket_sorter BucketSorter; BucketSorter degree_bucket_sorter(num, num, degree, ! get(vertex_index,G)); smallest_last_vertex_ordering(G, order, degree, marker, degree_bucket_sorter); } *************** *** 51,57 **** smallest_last_vertex_ordering(const VertexListGraph& G, Order order, Degree degree, Marker marker, BucketSorter& degree_buckets) { ! typedef typename graph_traits GraphTraits; typedef typename GraphTraits::vertex_descriptor Vertex; //typedef typename GraphTraits::size_type size_type; typedef std::size_t size_type; --- 59,65 ---- smallest_last_vertex_ordering(const VertexListGraph& G, Order order, Degree degree, Marker marker, BucketSorter& degree_buckets) { ! typedef typename boost::graph_traits GraphTraits; typedef typename GraphTraits::vertex_descriptor Vertex; //typedef typename GraphTraits::size_type size_type; typedef std::size_t size_type; *************** *** 88,102 **** if ( get(marker,*v) > current_order ) { //*v is unordered vertex put(marker, *v, current_order); //mark the columns adjacent to node ! //It is possible minimum degree goes down //Here we keep tracking it. put(degree, *v, get(degree, *v) - 1); BOOST_USING_STD_MIN(); minimum_degree = min BOOST_PREVENT_MACRO_SUBSTITUTION(minimum_degree, get(degree, *v)); ! //update the position of *v in the bucket sorter ! degree_buckets.update(*v); } current_order--; --- 96,113 ---- if ( get(marker,*v) > current_order ) { //*v is unordered vertex put(marker, *v, current_order); //mark the columns adjacent to node ! ! //delete *v from the bucket sorter ! degree_buckets.remove(*v); ! //It is possible minimum degree goes down //Here we keep tracking it. put(degree, *v, get(degree, *v) - 1); BOOST_USING_STD_MIN(); minimum_degree = min BOOST_PREVENT_MACRO_SUBSTITUTION(minimum_degree, get(degree, *v)); ! //reinsert *v in the bucket sorter with the new degree ! degree_buckets.push(*v); } current_order--;