lemon/kruskal.h
changeset 156 e561aa7675de
parent 103 b68a7e348e00
child 167 d57ae6f0a335
equal deleted inserted replaced
0:bbfeab2f727c 1:f0d094aa7f63
   210         return KruskalOutputSelector<Graph, Sequence, Out>::
   210         return KruskalOutputSelector<Graph, Sequence, Out>::
   211           kruskal(graph, seq, out);
   211           kruskal(graph, seq, out);
   212       }
   212       }
   213     };
   213     };
   214 
   214 
       
   215     template <typename T>
       
   216     struct RemoveConst {
       
   217       typedef T type;
       
   218     };
       
   219 
       
   220     template <typename T>
       
   221     struct RemoveConst<const T> {
       
   222       typedef T type;
       
   223     };
       
   224 
   215     template <typename Graph, typename In, typename Out>
   225     template <typename Graph, typename In, typename Out>
   216     struct KruskalOutputSelector<Graph, In, Out,
   226     struct KruskalOutputSelector<Graph, In, Out,
   217       typename enable_if<SequenceOutputIndicator<Out>, void>::type > 
   227       typename enable_if<SequenceOutputIndicator<Out>, void>::type > 
   218     {
   228     {
   219       typedef typename In::value_type::second_type Value;
   229       typedef typename In::value_type::second_type Value;
   220 
   230 
   221       static Value kruskal(const Graph& graph, const In& in, Out& out) {
   231       static Value kruskal(const Graph& graph, const In& in, Out& out) {
   222         typedef StoreBoolMap<Out> Map;
   232         typedef StoreBoolMap<typename RemoveConst<Out>::type> Map;
   223         Map map(out);
   233         Map map(out);
   224         return _kruskal_bits::kruskal(graph, in, map);
   234         return _kruskal_bits::kruskal(graph, in, map);
   225       }
   235       }
   226 
   236 
   227     };
   237     };