diff -r 94387da47f79 -r c5fd2d996909 lemon/dijkstra.h --- a/lemon/dijkstra.h Thu Mar 05 10:13:20 2009 +0000 +++ b/lemon/dijkstra.h Sun Mar 29 23:08:20 2009 +0200 @@ -38,8 +38,10 @@ /// /// This operation traits class defines all computational operations and /// constants which are used in the Dijkstra algorithm. - template + template struct DijkstraDefaultOperationTraits { + /// \e + typedef V Value; /// \brief Gives back the zero value of the type. static Value zero() { return static_cast(0); @@ -58,8 +60,8 @@ ///Default traits class of Dijkstra class. ///\tparam GR The type of the digraph. - ///\tparam LM The type of the length map. - template + ///\tparam LEN The type of the length map. + template struct DijkstraDefaultTraits { ///The type of the digraph the algorithm runs on. @@ -69,9 +71,9 @@ ///The type of the map that stores the arc lengths. ///It must meet the \ref concepts::ReadMap "ReadMap" concept. - typedef LM LengthMap; + typedef LEN LengthMap; ///The type of the length of the arcs. - typedef typename LM::Value Value; + typedef typename LEN::Value Value; /// Operation traits for %Dijkstra algorithm. @@ -100,7 +102,7 @@ /// ///\sa BinHeap ///\sa Dijkstra - typedef BinHeap > Heap; + typedef BinHeap > Heap; ///Instantiates a \c Heap. ///This function instantiates a \ref Heap. @@ -150,7 +152,7 @@ ///The type of the map that stores the distances of the nodes. ///It must meet the \ref concepts::WriteMap "WriteMap" concept. - typedef typename Digraph::template NodeMap DistMap; + typedef typename Digraph::template NodeMap DistMap; ///Instantiates a \c DistMap. ///This function instantiates a \ref DistMap. @@ -180,18 +182,18 @@ /// ///\tparam GR The type of the digraph the algorithm runs on. ///The default type is \ref ListDigraph. - ///\tparam LM A \ref concepts::ReadMap "readable" arc map that specifies + ///\tparam LEN A \ref concepts::ReadMap "readable" arc map that specifies ///the lengths of the arcs. ///It is read once for each arc, so the map may involve in ///relatively time consuming process to compute the arc lengths if ///it is necessary. The default map type is \ref ///concepts::Digraph::ArcMap "GR::ArcMap". #ifdef DOXYGEN - template + template #else template , - typename TR=DijkstraDefaultTraits > + typename LEN=typename GR::template ArcMap, + typename TR=DijkstraDefaultTraits > #endif class Dijkstra { public: @@ -913,8 +915,8 @@ ///Default traits class of dijkstra() function. ///\tparam GR The type of the digraph. - ///\tparam LM The type of the length map. - template + ///\tparam LEN The type of the length map. + template struct DijkstraWizardDefaultTraits { ///The type of the digraph the algorithm runs on. @@ -923,9 +925,9 @@ ///The type of the map that stores the arc lengths. ///It must meet the \ref concepts::ReadMap "ReadMap" concept. - typedef LM LengthMap; + typedef LEN LengthMap; ///The type of the length of the arcs. - typedef typename LM::Value Value; + typedef typename LEN::Value Value; /// Operation traits for Dijkstra algorithm. @@ -1007,7 +1009,7 @@ ///The type of the map that stores the distances of the nodes. ///It must meet the \ref concepts::WriteMap "WriteMap" concept. - typedef typename Digraph::template NodeMap DistMap; + typedef typename Digraph::template NodeMap DistMap; ///Instantiates a DistMap. ///This function instantiates a DistMap. @@ -1033,10 +1035,10 @@ /// as well as the \ref Dijkstra class. /// The \ref DijkstraWizardBase is a class to be the default traits of the /// \ref DijkstraWizard class. - template - class DijkstraWizardBase : public DijkstraWizardDefaultTraits + template + class DijkstraWizardBase : public DijkstraWizardDefaultTraits { - typedef DijkstraWizardDefaultTraits Base; + typedef DijkstraWizardDefaultTraits Base; protected: //The type of the nodes in the digraph. typedef typename Base::Digraph::Node Node; @@ -1070,9 +1072,9 @@ /// others are initiated to \c 0. /// \param g The digraph the algorithm runs on. /// \param l The length map. - DijkstraWizardBase(const GR &g,const LM &l) : + DijkstraWizardBase(const GR &g,const LEN &l) : _g(reinterpret_cast(const_cast(&g))), - _length(reinterpret_cast(const_cast(&l))), + _length(reinterpret_cast(const_cast(&l))), _processed(0), _pred(0), _dist(0), _path(0), _di(0) {} }; @@ -1281,11 +1283,11 @@ ///to the end of the parameter list. ///\sa DijkstraWizard ///\sa Dijkstra - template - DijkstraWizard > - dijkstra(const GR &digraph, const LM &length) + template + DijkstraWizard > + dijkstra(const GR &digraph, const LEN &length) { - return DijkstraWizard >(digraph,length); + return DijkstraWizard >(digraph,length); } } //END OF NAMESPACE LEMON