Changeset 606:c5fd2d996909 in lemon for lemon/dijkstra.h
 Timestamp:
 03/29/09 23:08:20 (11 years ago)
 Branch:
 default
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/dijkstra.h
r525 r606 39 39 /// This operation traits class defines all computational operations and 40 40 /// constants which are used in the Dijkstra algorithm. 41 template <typename V alue>41 template <typename V> 42 42 struct DijkstraDefaultOperationTraits { 43 /// \e 44 typedef V Value; 43 45 /// \brief Gives back the zero value of the type. 44 46 static Value zero() { … … 59 61 ///Default traits class of Dijkstra class. 60 62 ///\tparam GR The type of the digraph. 61 ///\tparam L MThe type of the length map.62 template< class GR, class LM>63 ///\tparam LEN The type of the length map. 64 template<typename GR, typename LEN> 63 65 struct DijkstraDefaultTraits 64 66 { … … 70 72 ///The type of the map that stores the arc lengths. 71 73 ///It must meet the \ref concepts::ReadMap "ReadMap" concept. 72 typedef L MLengthMap;74 typedef LEN LengthMap; 73 75 ///The type of the length of the arcs. 74 typedef typename L M::Value Value;76 typedef typename LEN::Value Value; 75 77 76 78 /// Operation traits for %Dijkstra algorithm. … … 101 103 ///\sa BinHeap 102 104 ///\sa Dijkstra 103 typedef BinHeap<typename L M::Value, HeapCrossRef, std::less<Value> > Heap;105 typedef BinHeap<typename LEN::Value, HeapCrossRef, std::less<Value> > Heap; 104 106 ///Instantiates a \c Heap. 105 107 … … 151 153 ///The type of the map that stores the distances of the nodes. 152 154 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 153 typedef typename Digraph::template NodeMap<typename L M::Value> DistMap;155 typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap; 154 156 ///Instantiates a \c DistMap. 155 157 … … 181 183 ///\tparam GR The type of the digraph the algorithm runs on. 182 184 ///The default type is \ref ListDigraph. 183 ///\tparam L MA \ref concepts::ReadMap "readable" arc map that specifies185 ///\tparam LEN A \ref concepts::ReadMap "readable" arc map that specifies 184 186 ///the lengths of the arcs. 185 187 ///It is read once for each arc, so the map may involve in … … 188 190 ///concepts::Digraph::ArcMap "GR::ArcMap<int>". 189 191 #ifdef DOXYGEN 190 template <typename GR, typename L M, typename TR>192 template <typename GR, typename LEN, typename TR> 191 193 #else 192 194 template <typename GR=ListDigraph, 193 typename L M=typename GR::template ArcMap<int>,194 typename TR=DijkstraDefaultTraits<GR,L M> >195 typename LEN=typename GR::template ArcMap<int>, 196 typename TR=DijkstraDefaultTraits<GR,LEN> > 195 197 #endif 196 198 class Dijkstra { … … 914 916 ///Default traits class of dijkstra() function. 915 917 ///\tparam GR The type of the digraph. 916 ///\tparam L MThe type of the length map.917 template<class GR, class L M>918 ///\tparam LEN The type of the length map. 919 template<class GR, class LEN> 918 920 struct DijkstraWizardDefaultTraits 919 921 { … … 924 926 ///The type of the map that stores the arc lengths. 925 927 ///It must meet the \ref concepts::ReadMap "ReadMap" concept. 926 typedef L MLengthMap;928 typedef LEN LengthMap; 927 929 ///The type of the length of the arcs. 928 typedef typename L M::Value Value;930 typedef typename LEN::Value Value; 929 931 930 932 /// Operation traits for Dijkstra algorithm. … … 1008 1010 ///The type of the map that stores the distances of the nodes. 1009 1011 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 1010 typedef typename Digraph::template NodeMap<typename L M::Value> DistMap;1012 typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap; 1011 1013 ///Instantiates a DistMap. 1012 1014 … … 1034 1036 /// The \ref DijkstraWizardBase is a class to be the default traits of the 1035 1037 /// \ref DijkstraWizard class. 1036 template< class GR,class LM>1037 class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,L M>1038 template<typename GR, typename LEN> 1039 class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LEN> 1038 1040 { 1039 typedef DijkstraWizardDefaultTraits<GR,L M> Base;1041 typedef DijkstraWizardDefaultTraits<GR,LEN> Base; 1040 1042 protected: 1041 1043 //The type of the nodes in the digraph. … … 1071 1073 /// \param g The digraph the algorithm runs on. 1072 1074 /// \param l The length map. 1073 DijkstraWizardBase(const GR &g,const L M&l) :1075 DijkstraWizardBase(const GR &g,const LEN &l) : 1074 1076 _g(reinterpret_cast<void*>(const_cast<GR*>(&g))), 1075 _length(reinterpret_cast<void*>(const_cast<L M*>(&l))),1077 _length(reinterpret_cast<void*>(const_cast<LEN*>(&l))), 1076 1078 _processed(0), _pred(0), _dist(0), _path(0), _di(0) {} 1077 1079 … … 1282 1284 ///\sa DijkstraWizard 1283 1285 ///\sa Dijkstra 1284 template< class GR, class LM>1285 DijkstraWizard<DijkstraWizardBase<GR,L M> >1286 dijkstra(const GR &digraph, const L M&length)1286 template<typename GR, typename LEN> 1287 DijkstraWizard<DijkstraWizardBase<GR,LEN> > 1288 dijkstra(const GR &digraph, const LEN &length) 1287 1289 { 1288 return DijkstraWizard<DijkstraWizardBase<GR,L M> >(digraph,length);1290 return DijkstraWizard<DijkstraWizardBase<GR,LEN> >(digraph,length); 1289 1291 } 1290 1292
Note: See TracChangeset
for help on using the changeset viewer.