# HG changeset patch # User Peter Kovacs # Date 1220299240 -7200 # Node ID 8d76a7bf9961cee39791b621a71b8abb914f86c5 # Parent f0b89f24274560f96db7740ebb807719f5e5e369 Rename Def* to Set* in Bfs, Dfs, Dijkstra (ticket #134) - DefXyzMap --> SetXyzMap - DefHeap --> SetHeap - DefStandardHeap --> SetStandardHeap - DefOperationTraits --> SetOperationTraits - DefProcessedMapToBeDefaultMap --> SetStandardProcessedMap - Bug fix: SetStandardProcessedMap shouldn't be template diff -r f0b89f242745 -r 8d76a7bf9961 lemon/bfs.h --- a/lemon/bfs.h Mon Aug 18 20:33:11 2008 +0200 +++ b/lemon/bfs.h Mon Sep 01 22:00:40 2008 +0200 @@ -230,7 +230,7 @@ ///@{ template - struct DefPredMapTraits : public Traits { + struct SetPredMapTraits : public Traits { typedef T PredMap; static PredMap *createPredMap(const Digraph &) { @@ -243,12 +243,12 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref PredMap type. template - struct DefPredMap : public Bfs< Digraph, DefPredMapTraits > { - typedef Bfs< Digraph, DefPredMapTraits > Create; + struct SetPredMap : public Bfs< Digraph, SetPredMapTraits > { + typedef Bfs< Digraph, SetPredMapTraits > Create; }; template - struct DefDistMapTraits : public Traits { + struct SetDistMapTraits : public Traits { typedef T DistMap; static DistMap *createDistMap(const Digraph &) { @@ -261,12 +261,12 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref DistMap type. template - struct DefDistMap : public Bfs< Digraph, DefDistMapTraits > { - typedef Bfs< Digraph, DefDistMapTraits > Create; + struct SetDistMap : public Bfs< Digraph, SetDistMapTraits > { + typedef Bfs< Digraph, SetDistMapTraits > Create; }; template - struct DefReachedMapTraits : public Traits { + struct SetReachedMapTraits : public Traits { typedef T ReachedMap; static ReachedMap *createReachedMap(const Digraph &) { @@ -279,12 +279,12 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref ReachedMap type. template - struct DefReachedMap : public Bfs< Digraph, DefReachedMapTraits > { - typedef Bfs< Digraph, DefReachedMapTraits > Create; + struct SetReachedMap : public Bfs< Digraph, SetReachedMapTraits > { + typedef Bfs< Digraph, SetReachedMapTraits > Create; }; template - struct DefProcessedMapTraits : public Traits { + struct SetProcessedMapTraits : public Traits { typedef T ProcessedMap; static ProcessedMap *createProcessedMap(const Digraph &) { @@ -297,11 +297,11 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref ProcessedMap type. template - struct DefProcessedMap : public Bfs< Digraph, DefProcessedMapTraits > { - typedef Bfs< Digraph, DefProcessedMapTraits > Create; + struct SetProcessedMap : public Bfs< Digraph, SetProcessedMapTraits > { + typedef Bfs< Digraph, SetProcessedMapTraits > Create; }; - struct DefDigraphProcessedMapTraits : public Traits { + struct SetStandardProcessedMapTraits : public Traits { typedef typename Digraph::template NodeMap ProcessedMap; static ProcessedMap *createProcessedMap(const Digraph &g) { @@ -314,10 +314,9 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref ProcessedMap type to be Digraph::NodeMap. ///If you don't set it explicitly, it will be automatically allocated. - template - struct DefProcessedMapToBeDefaultMap : - public Bfs< Digraph, DefDigraphProcessedMapTraits> { - typedef Bfs< Digraph, DefDigraphProcessedMapTraits> Create; + struct SetStandardProcessedMap : + public Bfs< Digraph, SetStandardProcessedMapTraits > { + typedef Bfs< Digraph, SetStandardProcessedMapTraits > Create; }; ///@} @@ -1065,10 +1064,10 @@ } template - struct DefPredMapBase : public Base { + struct SetPredMapBase : public Base { typedef T PredMap; static PredMap *createPredMap(const Digraph &) { return 0; }; - DefPredMapBase(const TR &b) : TR(b) {} + SetPredMapBase(const TR &b) : TR(b) {} }; ///\brief \ref named-templ-param "Named parameter" ///for setting \ref PredMap object. @@ -1076,17 +1075,17 @@ /// \ref named-templ-param "Named parameter" ///for setting \ref PredMap object. template - BfsWizard > predMap(const T &t) + BfsWizard > predMap(const T &t) { Base::_pred=reinterpret_cast(const_cast(&t)); - return BfsWizard >(*this); + return BfsWizard >(*this); } template - struct DefReachedMapBase : public Base { + struct SetReachedMapBase : public Base { typedef T ReachedMap; static ReachedMap *createReachedMap(const Digraph &) { return 0; }; - DefReachedMapBase(const TR &b) : TR(b) {} + SetReachedMapBase(const TR &b) : TR(b) {} }; ///\brief \ref named-templ-param "Named parameter" ///for setting \ref ReachedMap object. @@ -1094,17 +1093,17 @@ /// \ref named-templ-param "Named parameter" ///for setting \ref ReachedMap object. template - BfsWizard > reachedMap(const T &t) + BfsWizard > reachedMap(const T &t) { Base::_reached=reinterpret_cast(const_cast(&t)); - return BfsWizard >(*this); + return BfsWizard >(*this); } template - struct DefProcessedMapBase : public Base { + struct SetProcessedMapBase : public Base { typedef T ProcessedMap; static ProcessedMap *createProcessedMap(const Digraph &) { return 0; }; - DefProcessedMapBase(const TR &b) : TR(b) {} + SetProcessedMapBase(const TR &b) : TR(b) {} }; ///\brief \ref named-templ-param "Named parameter" ///for setting \ref ProcessedMap object. @@ -1112,17 +1111,17 @@ /// \ref named-templ-param "Named parameter" ///for setting \ref ProcessedMap object. template - BfsWizard > processedMap(const T &t) + BfsWizard > processedMap(const T &t) { Base::_processed=reinterpret_cast(const_cast(&t)); - return BfsWizard >(*this); + return BfsWizard >(*this); } template - struct DefDistMapBase : public Base { + struct SetDistMapBase : public Base { typedef T DistMap; static DistMap *createDistMap(const Digraph &) { return 0; }; - DefDistMapBase(const TR &b) : TR(b) {} + SetDistMapBase(const TR &b) : TR(b) {} }; ///\brief \ref named-templ-param "Named parameter" ///for setting \ref DistMap object. @@ -1130,10 +1129,10 @@ /// \ref named-templ-param "Named parameter" ///for setting \ref DistMap object. template - BfsWizard > distMap(const T &t) + BfsWizard > distMap(const T &t) { Base::_dist=reinterpret_cast(const_cast(&t)); - return BfsWizard >(*this); + return BfsWizard >(*this); } }; @@ -1349,7 +1348,7 @@ ///@{ template - struct DefReachedMapTraits : public Traits { + struct SetReachedMapTraits : public Traits { typedef T ReachedMap; static ReachedMap *createReachedMap(const Digraph &digraph) { throw UninitializedParameter(); @@ -1360,9 +1359,9 @@ /// /// \ref named-templ-param "Named parameter" for setting ReachedMap type. template - struct DefReachedMap : public BfsVisit< Digraph, Visitor, - DefReachedMapTraits > { - typedef BfsVisit< Digraph, Visitor, DefReachedMapTraits > Create; + struct SetReachedMap : public BfsVisit< Digraph, Visitor, + SetReachedMapTraits > { + typedef BfsVisit< Digraph, Visitor, SetReachedMapTraits > Create; }; ///@} diff -r f0b89f242745 -r 8d76a7bf9961 lemon/dfs.h --- a/lemon/dfs.h Mon Aug 18 20:33:11 2008 +0200 +++ b/lemon/dfs.h Mon Sep 01 22:00:40 2008 +0200 @@ -230,7 +230,7 @@ ///@{ template - struct DefPredMapTraits : public Traits { + struct SetPredMapTraits : public Traits { typedef T PredMap; static PredMap *createPredMap(const Digraph &) { @@ -243,12 +243,12 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref PredMap type. template - struct DefPredMap : public Dfs > { - typedef Dfs > Create; + struct SetPredMap : public Dfs > { + typedef Dfs > Create; }; template - struct DefDistMapTraits : public Traits { + struct SetDistMapTraits : public Traits { typedef T DistMap; static DistMap *createDistMap(const Digraph &) { @@ -261,12 +261,12 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref DistMap type. template - struct DefDistMap : public Dfs< Digraph, DefDistMapTraits > { - typedef Dfs > Create; + struct SetDistMap : public Dfs< Digraph, SetDistMapTraits > { + typedef Dfs > Create; }; template - struct DefReachedMapTraits : public Traits { + struct SetReachedMapTraits : public Traits { typedef T ReachedMap; static ReachedMap *createReachedMap(const Digraph &) { @@ -279,12 +279,12 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref ReachedMap type. template - struct DefReachedMap : public Dfs< Digraph, DefReachedMapTraits > { - typedef Dfs< Digraph, DefReachedMapTraits > Create; + struct SetReachedMap : public Dfs< Digraph, SetReachedMapTraits > { + typedef Dfs< Digraph, SetReachedMapTraits > Create; }; template - struct DefProcessedMapTraits : public Traits { + struct SetProcessedMapTraits : public Traits { typedef T ProcessedMap; static ProcessedMap *createProcessedMap(const Digraph &) { @@ -297,11 +297,11 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref ProcessedMap type. template - struct DefProcessedMap : public Dfs< Digraph, DefProcessedMapTraits > { - typedef Dfs< Digraph, DefProcessedMapTraits > Create; + struct SetProcessedMap : public Dfs< Digraph, SetProcessedMapTraits > { + typedef Dfs< Digraph, SetProcessedMapTraits > Create; }; - struct DefDigraphProcessedMapTraits : public Traits { + struct SetStandardProcessedMapTraits : public Traits { typedef typename Digraph::template NodeMap ProcessedMap; static ProcessedMap *createProcessedMap(const Digraph &g) { @@ -314,10 +314,9 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref ProcessedMap type to be Digraph::NodeMap. ///If you don't set it explicitly, it will be automatically allocated. - template - struct DefProcessedMapToBeDefaultMap : - public Dfs< Digraph, DefDigraphProcessedMapTraits> { - typedef Dfs< Digraph, DefDigraphProcessedMapTraits> Create; + struct SetStandardProcessedMap : + public Dfs< Digraph, SetStandardProcessedMapTraits > { + typedef Dfs< Digraph, SetStandardProcessedMapTraits > Create; }; ///@} @@ -1000,10 +999,10 @@ } template - struct DefPredMapBase : public Base { + struct SetPredMapBase : public Base { typedef T PredMap; static PredMap *createPredMap(const Digraph &) { return 0; }; - DefPredMapBase(const TR &b) : TR(b) {} + SetPredMapBase(const TR &b) : TR(b) {} }; ///\brief \ref named-templ-param "Named parameter" ///for setting \ref PredMap object. @@ -1011,17 +1010,17 @@ ///\ref named-templ-param "Named parameter" ///for setting \ref PredMap object. template - DfsWizard > predMap(const T &t) + DfsWizard > predMap(const T &t) { Base::_pred=reinterpret_cast(const_cast(&t)); - return DfsWizard >(*this); + return DfsWizard >(*this); } template - struct DefReachedMapBase : public Base { + struct SetReachedMapBase : public Base { typedef T ReachedMap; static ReachedMap *createReachedMap(const Digraph &) { return 0; }; - DefReachedMapBase(const TR &b) : TR(b) {} + SetReachedMapBase(const TR &b) : TR(b) {} }; ///\brief \ref named-templ-param "Named parameter" ///for setting \ref ReachedMap object. @@ -1029,17 +1028,17 @@ /// \ref named-templ-param "Named parameter" ///for setting \ref ReachedMap object. template - DfsWizard > reachedMap(const T &t) + DfsWizard > reachedMap(const T &t) { Base::_reached=reinterpret_cast(const_cast(&t)); - return DfsWizard >(*this); + return DfsWizard >(*this); } template - struct DefProcessedMapBase : public Base { + struct SetProcessedMapBase : public Base { typedef T ProcessedMap; static ProcessedMap *createProcessedMap(const Digraph &) { return 0; }; - DefProcessedMapBase(const TR &b) : TR(b) {} + SetProcessedMapBase(const TR &b) : TR(b) {} }; ///\brief \ref named-templ-param "Named parameter" ///for setting \ref ProcessedMap object. @@ -1047,17 +1046,17 @@ /// \ref named-templ-param "Named parameter" ///for setting \ref ProcessedMap object. template - DfsWizard > processedMap(const T &t) + DfsWizard > processedMap(const T &t) { Base::_processed=reinterpret_cast(const_cast(&t)); - return DfsWizard >(*this); + return DfsWizard >(*this); } template - struct DefDistMapBase : public Base { + struct SetDistMapBase : public Base { typedef T DistMap; static DistMap *createDistMap(const Digraph &) { return 0; }; - DefDistMapBase(const TR &b) : TR(b) {} + SetDistMapBase(const TR &b) : TR(b) {} }; ///\brief \ref named-templ-param "Named parameter" ///for setting \ref DistMap object. @@ -1065,10 +1064,10 @@ ///\ref named-templ-param "Named parameter" ///for setting \ref DistMap object. template - DfsWizard > distMap(const T &t) + DfsWizard > distMap(const T &t) { Base::_dist=reinterpret_cast(const_cast(&t)); - return DfsWizard >(*this); + return DfsWizard >(*this); } }; @@ -1296,7 +1295,7 @@ ///@{ template - struct DefReachedMapTraits : public Traits { + struct SetReachedMapTraits : public Traits { typedef T ReachedMap; static ReachedMap *createReachedMap(const Digraph &digraph) { throw UninitializedParameter(); @@ -1307,9 +1306,9 @@ /// /// \ref named-templ-param "Named parameter" for setting ReachedMap type. template - struct DefReachedMap : public DfsVisit< Digraph, Visitor, - DefReachedMapTraits > { - typedef DfsVisit< Digraph, Visitor, DefReachedMapTraits > Create; + struct SetReachedMap : public DfsVisit< Digraph, Visitor, + SetReachedMapTraits > { + typedef DfsVisit< Digraph, Visitor, SetReachedMapTraits > Create; }; ///@} diff -r f0b89f242745 -r 8d76a7bf9961 lemon/dijkstra.h --- a/lemon/dijkstra.h Mon Aug 18 20:33:11 2008 +0200 +++ b/lemon/dijkstra.h Mon Sep 01 22:00:40 2008 +0200 @@ -331,7 +331,7 @@ ///@{ template - struct DefPredMapTraits : public Traits { + struct SetPredMapTraits : public Traits { typedef T PredMap; static PredMap *createPredMap(const Digraph &) { @@ -344,13 +344,13 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref PredMap type. template - struct DefPredMap - : public Dijkstra< Digraph, LengthMap, DefPredMapTraits > { - typedef Dijkstra< Digraph, LengthMap, DefPredMapTraits > Create; + struct SetPredMap + : public Dijkstra< Digraph, LengthMap, SetPredMapTraits > { + typedef Dijkstra< Digraph, LengthMap, SetPredMapTraits > Create; }; template - struct DefDistMapTraits : public Traits { + struct SetDistMapTraits : public Traits { typedef T DistMap; static DistMap *createDistMap(const Digraph &) { @@ -363,13 +363,13 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref DistMap type. template - struct DefDistMap - : public Dijkstra< Digraph, LengthMap, DefDistMapTraits > { - typedef Dijkstra< Digraph, LengthMap, DefDistMapTraits > Create; + struct SetDistMap + : public Dijkstra< Digraph, LengthMap, SetDistMapTraits > { + typedef Dijkstra< Digraph, LengthMap, SetDistMapTraits > Create; }; template - struct DefProcessedMapTraits : public Traits { + struct SetProcessedMapTraits : public Traits { typedef T ProcessedMap; static ProcessedMap *createProcessedMap(const Digraph &) { @@ -382,12 +382,12 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref ProcessedMap type. template - struct DefProcessedMap - : public Dijkstra< Digraph, LengthMap, DefProcessedMapTraits > { - typedef Dijkstra< Digraph, LengthMap, DefProcessedMapTraits > Create; + struct SetProcessedMap + : public Dijkstra< Digraph, LengthMap, SetProcessedMapTraits > { + typedef Dijkstra< Digraph, LengthMap, SetProcessedMapTraits > Create; }; - struct DefDigraphProcessedMapTraits : public Traits { + struct SetStandardProcessedMapTraits : public Traits { typedef typename Digraph::template NodeMap ProcessedMap; static ProcessedMap *createProcessedMap(const Digraph &g) { @@ -400,15 +400,14 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref ProcessedMap type to be Digraph::NodeMap. ///If you don't set it explicitly, it will be automatically allocated. - template - struct DefProcessedMapToBeDefaultMap - : public Dijkstra< Digraph, LengthMap, DefDigraphProcessedMapTraits> { - typedef Dijkstra< Digraph, LengthMap, DefDigraphProcessedMapTraits> + struct SetStandardProcessedMap + : public Dijkstra< Digraph, LengthMap, SetStandardProcessedMapTraits > { + typedef Dijkstra< Digraph, LengthMap, SetStandardProcessedMapTraits > Create; }; template - struct DefHeapTraits : public Traits { + struct SetHeapTraits : public Traits { typedef CR HeapCrossRef; typedef H Heap; static HeapCrossRef *createHeapCrossRef(const Digraph &) { @@ -425,13 +424,13 @@ ///\ref named-templ-param "Named parameter" for setting heap and cross ///reference type. template > - struct DefHeap - : public Dijkstra< Digraph, LengthMap, DefHeapTraits > { - typedef Dijkstra< Digraph, LengthMap, DefHeapTraits > Create; + struct SetHeap + : public Dijkstra< Digraph, LengthMap, SetHeapTraits > { + typedef Dijkstra< Digraph, LengthMap, SetHeapTraits > Create; }; template - struct DefStandardHeapTraits : public Traits { + struct SetStandardHeapTraits : public Traits { typedef CR HeapCrossRef; typedef H Heap; static HeapCrossRef *createHeapCrossRef(const Digraph &G) { @@ -450,14 +449,14 @@ ///object if the cross reference's constructor waits for the digraph as ///parameter and the heap's constructor waits for the cross reference. template > - struct DefStandardHeap - : public Dijkstra< Digraph, LengthMap, DefStandardHeapTraits > { - typedef Dijkstra< Digraph, LengthMap, DefStandardHeapTraits > + struct SetStandardHeap + : public Dijkstra< Digraph, LengthMap, SetStandardHeapTraits > { + typedef Dijkstra< Digraph, LengthMap, SetStandardHeapTraits > Create; }; template - struct DefOperationTraitsTraits : public Traits { + struct SetOperationTraitsTraits : public Traits { typedef T OperationTraits; }; @@ -467,9 +466,9 @@ ///\ref named-templ-param "Named parameter" for setting ///\ref OperationTraits type. template - struct DefOperationTraits - : public Dijkstra > { - typedef Dijkstra > + struct SetOperationTraits + : public Dijkstra > { + typedef Dijkstra > Create; }; @@ -1199,10 +1198,10 @@ } template - struct DefPredMapBase : public Base { + struct SetPredMapBase : public Base { typedef T PredMap; static PredMap *createPredMap(const Digraph &) { return 0; }; - DefPredMapBase(const TR &b) : TR(b) {} + SetPredMapBase(const TR &b) : TR(b) {} }; ///\brief \ref named-templ-param "Named parameter" ///for setting \ref PredMap object. @@ -1210,17 +1209,17 @@ ///\ref named-templ-param "Named parameter" ///for setting \ref PredMap object. template - DijkstraWizard > predMap(const T &t) + DijkstraWizard > predMap(const T &t) { Base::_pred=reinterpret_cast(const_cast(&t)); - return DijkstraWizard >(*this); + return DijkstraWizard >(*this); } template - struct DefProcessedMapBase : public Base { + struct SetProcessedMapBase : public Base { typedef T ProcessedMap; static ProcessedMap *createProcessedMap(const Digraph &) { return 0; }; - DefProcessedMapBase(const TR &b) : TR(b) {} + SetProcessedMapBase(const TR &b) : TR(b) {} }; ///\brief \ref named-templ-param "Named parameter" ///for setting \ref ProcessedMap object. @@ -1228,17 +1227,17 @@ /// \ref named-templ-param "Named parameter" ///for setting \ref ProcessedMap object. template - DijkstraWizard > processedMap(const T &t) + DijkstraWizard > processedMap(const T &t) { Base::_processed=reinterpret_cast(const_cast(&t)); - return DijkstraWizard >(*this); + return DijkstraWizard >(*this); } template - struct DefDistMapBase : public Base { + struct SetDistMapBase : public Base { typedef T DistMap; static DistMap *createDistMap(const Digraph &) { return 0; }; - DefDistMapBase(const TR &b) : TR(b) {} + SetDistMapBase(const TR &b) : TR(b) {} }; ///\brief \ref named-templ-param "Named parameter" ///for setting \ref DistMap object. @@ -1246,10 +1245,10 @@ ///\ref named-templ-param "Named parameter" ///for setting \ref DistMap object. template - DijkstraWizard > distMap(const T &t) + DijkstraWizard > distMap(const T &t) { Base::_dist=reinterpret_cast(const_cast(&t)); - return DijkstraWizard >(*this); + return DijkstraWizard >(*this); } }; diff -r f0b89f242745 -r 8d76a7bf9961 test/heap_test.cc --- a/test/heap_test.cc Mon Aug 18 20:33:11 2008 +0200 +++ b/test/heap_test.cc Mon Sep 01 22:00:40 2008 +0200 @@ -131,7 +131,7 @@ void dijkstraHeapTest(const Digraph& digraph, const IntArcMap& length, Node source) { - typename Dijkstra::template DefStandardHeap:: + typename Dijkstra::template SetStandardHeap:: Create dijkstra(digraph, length); dijkstra.run(source);