lemon/kruskal.h
changeset 1991 d7442141d9ef
parent 1956 a055123339d5
child 1993 2115143eceea
equal deleted inserted replaced
13:493667f47749 14:4f0593bfbbe0
    21 
    21 
    22 #include <algorithm>
    22 #include <algorithm>
    23 #include <vector>
    23 #include <vector>
    24 #include <lemon/unionfind.h>
    24 #include <lemon/unionfind.h>
    25 #include <lemon/utility.h>
    25 #include <lemon/utility.h>
       
    26 #include <lemon/traits.h>
    26 
    27 
    27 /**
    28 /**
    28 @defgroup spantree Minimum Cost Spanning Tree Algorithms
    29 @defgroup spantree Minimum Cost Spanning Tree Algorithms
    29 @ingroup galgs
    30 @ingroup galgs
    30 \brief This group containes the algorithms for finding a minimum cost spanning
    31 \brief This group containes the algorithms for finding a minimum cost spanning
   226 	return a.second < b.second;
   227 	return a.second < b.second;
   227       }
   228       }
   228     };
   229     };
   229 
   230 
   230     template<class _GR>
   231     template<class _GR>
   231     typename enable_if<typename _GR::UTag,void>::type
   232     typename enable_if<UndirectedTagIndicator<_GR>,void>::type
   232     fillWithEdges(const _GR& g, const Map& m,dummy<0> = 0) 
   233     fillWithEdges(const _GR& g, const Map& m,dummy<0> = 0) 
   233     {
   234     {
   234       for(typename GR::UEdgeIt e(g);e!=INVALID;++e) 
   235       for(typename GR::UEdgeIt e(g);e!=INVALID;++e) 
   235 	push_back(value_type(g.direct(e, true), m[e]));
   236 	push_back(value_type(g.direct(e, true), m[e]));
   236     }
   237     }
   237 
   238 
   238     template<class _GR>
   239     template<class _GR>
   239     typename disable_if<typename _GR::UTag,void>::type
   240     typename disable_if<UndirectedTagIndicator<_GR>,void>::type
   240     fillWithEdges(const _GR& g, const Map& m,dummy<1> = 1) 
   241     fillWithEdges(const _GR& g, const Map& m,dummy<1> = 1) 
   241     {
   242     {
   242       for(typename GR::EdgeIt e(g);e!=INVALID;++e) 
   243       for(typename GR::EdgeIt e(g);e!=INVALID;++e) 
   243 	push_back(value_type(e, m[e]));
   244 	push_back(value_type(e, m[e]));
   244     }
   245     }