# HG changeset patch # User alpar # Date 1091646282 0 # Node ID a8c2e828ce0b440c6a123a28a319cda1cf3d227f # Parent 2471ef33b4a02c4a829fb96a72a46d910e0678cd - 'KruskalPairVec' is changed to 'KruskalMapInput'. - Changes in KruskalMapVec. Still does not work. diff -r 2471ef33b4a0 -r a8c2e828ce0b src/work/johanna/kruskal.h --- a/src/work/johanna/kruskal.h Wed Aug 04 18:56:12 2004 +0000 +++ b/src/work/johanna/kruskal.h Wed Aug 04 19:04:42 2004 +0000 @@ -117,7 +117,7 @@ /// Kruskal input source. /// template - class KruskalPairVec + class KruskalMapInput : public std::vector< std::pair > { @@ -143,14 +143,14 @@ public: // FIXME: kell ez? - // KruskalPairVec(Parent const& p) : Parent(p) {} + // KruskalMapInput(Parent const& p) : Parent(p) {} void sort() { std::sort(this->begin(), this->end(), comparePair()); } // FIXME: nem nagyon illik ez ide... - KruskalPairVec(Graph const& G, Map const& m) { + KruskalMapInput(Graph const& G, Map const& m) { typedef typename Graph::EdgeIt EdgeIt; this->clear(); @@ -169,21 +169,46 @@ }; -// template -// class KruskalMapVec : public std::vector { +// template +// class KruskalMapVec { // public: -// typedef typename Map::KeyType KeyType; -// typedef typename Map::ValueType ValueType; +// typedef std::pair value_type; + +// typedef std::vector Container; +// Container container; +// std::vector container +// const Map &m; + + +// class iterator +// { +// Container::iterator i; +// public: +// iterator &operator ++() {++i;return *this;} +// valuetype operator *() {return value_type(container(i),m[container(i)]);} +// bool operator==(iterator b) {return i==b.i;} +// iterator() {} +// iterator(Container::iterator _i) i(_i) {} +// }; +// class const_iterator +// { +// Container::const_iterator i; +// public: +// iterator &operator ++() {++i;return *this;} +// valuetype operator *() {return value_type(container(i),m[container(i)]);} +// bool operator==(iterator b) {return i==b.i;} +// const_iterator() {} +// const_iterator(Container::iterator _i) i(_i) {} +// }; -// typedef typename std::vector Parent; -// typedef typename Parent::iterator iterator; -// typedef typename Parent::const_iterator const_iterator; - +// iterator begin() { return iterator(container.begin());} +// const_iterator begin() const { return iterator(container.begin());} +// iterator end() { return iterator(container.end());} +// const_iterator end() const { return iterator(container.end());} + // private: - -// const Map &m; - + // class compareKeys { // const Map &m; // public: @@ -221,6 +246,7 @@ // ValueType& second(iterator i) { return m[*i]; } // }; + /* ** ** Wrapper fuggvenyek ** ** */ @@ -236,7 +262,7 @@ EdgeCostMap const& edge_costs, RetEdgeBoolMap &ret_bool_map) { - typedef KruskalPairVec InputVec; + typedef KruskalMapInput InputVec; InputVec iv(G, edge_costs); return kruskal(G, iv, ret_bool_map); @@ -260,7 +286,7 @@ typedef SequenceOutput OutMap; OutMap out(ret_iterator); - typedef KruskalPairVec InputVec; + typedef KruskalMapInput InputVec; InputVec iv(G, edge_costs);