Ticket #4157: boost-graph-fixes.patch
File boost-graph-fixes.patch, 5.5 KB (added by , 12 years ago) |
---|
-
libs/graph/test/kolmogorov_max_flow_test.cpp
242 242 typename std::list<tVertex>::const_iterator it = find(tSuper::m_orphans.begin(), tSuper::m_orphans.end(), v); 243 243 // a node is active, if its in the active_list AND (is has_a_parent, or its already in the orphans_list or its the sink, or its the source) 244 244 bool is_active = (tSuper::m_in_active_list_map[v] && (tSuper::has_parent(v) || it != tSuper::m_orphans.end() )); 245 if( get_tree(v) != tColorTraits::gray() && !is_active){245 if(this->get_tree(v) != tColorTraits::gray() && !is_active){ 246 246 typename graph_traits<Graph>::out_edge_iterator ei,e_end; 247 247 for(tie(ei, e_end) = out_edges(v, tSuper::m_g); ei != e_end; ++ei){ 248 248 const tVertex& other_node = target(*ei, tSuper::m_g); 249 if( get_tree(other_node) !=get_tree(v)){250 if( get_tree(v) == tColorTraits::black())249 if(this->get_tree(other_node) != this->get_tree(v)){ 250 if(this->get_tree(v) == tColorTraits::black()) 251 251 BOOST_CHECK(tSuper::m_res_cap_map[*ei] == 0); 252 252 else 253 253 BOOST_CHECK(tSuper::m_res_cap_map[tSuper::m_rev_edge_map[*ei]] == 0); … … 257 257 } 258 258 259 259 void invariant_five(const tVertex& v) const{ 260 BOOST_CHECK( get_tree(v) != tColorTraits::gray() || tSuper::m_time_map[v] <= tSuper::m_time);260 BOOST_CHECK(this->get_tree(v) != tColorTraits::gray() || tSuper::m_time_map[v] <= tSuper::m_time); 261 261 } 262 262 263 263 void invariant_six(const tVertex& v) const{ 264 if( get_tree(v) == tColorTraits::gray() || tSuper::m_time_map[v] != tSuper::m_time)264 if(this->get_tree(v) == tColorTraits::gray() || tSuper::m_time_map[v] != tSuper::m_time) 265 265 return; 266 266 else{ 267 267 tVertex current_node = v; 268 268 tDistanceVal distance = 0; 269 tColorValue color = get_tree(v);269 tColorValue color = this->get_tree(v); 270 270 tVertex terminal = (color == tColorTraits::black()) ? tSuper::m_source : tSuper::m_sink; 271 271 while(current_node != terminal){ 272 272 BOOST_CHECK(tSuper::has_parent(current_node)); 273 tEdge e = get_edge_to_parent(current_node);273 tEdge e = this->get_edge_to_parent(current_node); 274 274 ++distance; 275 275 current_node = (color == tColorTraits::black())? source(e, tSuper::m_g) : target(e, tSuper::m_g); 276 276 if(distance > tSuper::m_dist_map[v]) … … 281 281 } 282 282 283 283 void invariant_seven(const tVertex& v) const{ 284 if( get_tree(v) == tColorTraits::gray())284 if(this->get_tree(v) == tColorTraits::gray()) 285 285 return; 286 286 else{ 287 tColorValue color = get_tree(v);287 tColorValue color = this->get_tree(v); 288 288 long time = tSuper::m_time_map[v]; 289 289 tVertex current_node = v; 290 290 while(tSuper::has_parent(current_node)){ 291 tEdge e = get_edge_to_parent(current_node);291 tEdge e = this->get_edge_to_parent(current_node); 292 292 current_node = (color == tColorTraits::black()) ? source(e, tSuper::m_g) : target(e, tSuper::m_g); 293 293 BOOST_CHECK(tSuper::m_time_map[current_node] >= time); 294 294 } … … 296 296 }//invariant_seven 297 297 298 298 void invariant_eight(const tVertex& v) const{ 299 if( get_tree(v) == tColorTraits::gray())299 if(this->get_tree(v) == tColorTraits::gray()) 300 300 return; 301 301 else{ 302 tColorValue color = get_tree(v);302 tColorValue color = this->get_tree(v); 303 303 long time = tSuper::m_time_map[v]; 304 304 tDistanceVal distance = tSuper::m_dist_map[v]; 305 305 tVertex current_node = v; 306 306 while(tSuper::has_parent(current_node)){ 307 tEdge e = get_edge_to_parent(current_node);307 tEdge e = this->get_edge_to_parent(current_node); 308 308 current_node = (color == tColorTraits::black()) ? source(e, tSuper::m_g) : target(e, tSuper::m_g); 309 309 if(tSuper::m_time_map[current_node] == time) 310 310 BOOST_CHECK(tSuper::m_dist_map[current_node] < distance); -
boost/graph/eccentricity.hpp
53 53 typedef typename property_traits<EccentricityMap>::value_type Eccentricity; 54 54 BOOST_USING_STD_MIN(); 55 55 BOOST_USING_STD_MAX(); 56 56 57 57 Eccentricity 58 58 r = numeric_values<Eccentricity>::infinity(), 59 59 d = numeric_values<Eccentricity>::zero(); … … 68 68 r = min BOOST_PREVENT_MACRO_SUBSTITUTION (r, e); 69 69 d = max BOOST_PREVENT_MACRO_SUBSTITUTION (d, e); 70 70 } 71 return make_pair(r, d);71 return std::make_pair(r, d); 72 72 } 73 73 74 74 template <typename Graph, typename EccentricityMap> … … 81 81 typedef typename graph_traits<Graph>::vertex_iterator VertexIterator; 82 82 function_requires< ReadablePropertyMapConcept<EccentricityMap, Vertex> >(); 83 83 typedef typename property_traits<EccentricityMap>::value_type Eccentricity; 84 BOOST_USING_STD_MIN(); 85 BOOST_USING_STD_MAX(); 84 86 85 87 VertexIterator i, end; 86 88 tie(i, end) = vertices(g);