Changeset 525:9605e051942f in lemon for lemon/dijkstra.h
- Timestamp:
- 02/23/09 12:10:26 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/dijkstra.h
r463 r525 74 74 typedef typename LM::Value Value; 75 75 76 /// Operation traits for Dijkstra algorithm.76 /// Operation traits for %Dijkstra algorithm. 77 77 78 78 /// This class defines the operations that are used in the algorithm. … … 85 85 /// Usually it is \c Digraph::NodeMap<int>. 86 86 typedef typename Digraph::template NodeMap<int> HeapCrossRef; 87 ///Instantiates a \ refHeapCrossRef.87 ///Instantiates a \c HeapCrossRef. 88 88 89 89 ///This function instantiates a \ref HeapCrossRef. … … 95 95 } 96 96 97 ///The heap type used by the Dijkstra algorithm.97 ///The heap type used by the %Dijkstra algorithm. 98 98 99 99 ///The heap type used by the Dijkstra algorithm. … … 102 102 ///\sa Dijkstra 103 103 typedef BinHeap<typename LM::Value, HeapCrossRef, std::less<Value> > Heap; 104 ///Instantiates a \ refHeap.104 ///Instantiates a \c Heap. 105 105 106 106 ///This function instantiates a \ref Heap. … … 117 117 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 118 118 typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap; 119 ///Instantiates a PredMap.120 121 ///This function instantiates a PredMap.119 ///Instantiates a \c PredMap. 120 121 ///This function instantiates a \ref PredMap. 122 122 ///\param g is the digraph, to which we would like to define the 123 /// PredMap.123 ///\ref PredMap. 124 124 static PredMap *createPredMap(const Digraph &g) 125 125 { … … 133 133 ///By default it is a NullMap. 134 134 typedef NullMap<typename Digraph::Node,bool> ProcessedMap; 135 ///Instantiates a ProcessedMap.136 137 ///This function instantiates a ProcessedMap.135 ///Instantiates a \c ProcessedMap. 136 137 ///This function instantiates a \ref ProcessedMap. 138 138 ///\param g is the digraph, to which 139 ///we would like to define the ProcessedMap139 ///we would like to define the \ref ProcessedMap. 140 140 #ifdef DOXYGEN 141 141 static ProcessedMap *createProcessedMap(const Digraph &g) … … 152 152 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 153 153 typedef typename Digraph::template NodeMap<typename LM::Value> DistMap; 154 ///Instantiates a DistMap.155 156 ///This function instantiates a DistMap.154 ///Instantiates a \c DistMap. 155 156 ///This function instantiates a \ref DistMap. 157 157 ///\param g is the digraph, to which we would like to define 158 ///the DistMap158 ///the \ref DistMap. 159 159 static DistMap *createDistMap(const Digraph &g) 160 160 { … … 217 217 ///The heap type used by the algorithm. 218 218 typedef typename TR::Heap Heap; 219 ///The operation traits class. 219 ///\brief The \ref DijkstraDefaultOperationTraits "operation traits class" 220 ///of the algorithm. 220 221 typedef typename TR::OperationTraits OperationTraits; 221 222 … … 233 234 const Digraph *G; 234 235 //Pointer to the length map. 235 const LengthMap * length;236 const LengthMap *_length; 236 237 //Pointer to the map of predecessors arcs. 237 238 PredMap *_pred; … … 298 299 }; 299 300 ///\brief \ref named-templ-param "Named parameter" for setting 300 /// PredMap type.301 ///\c PredMap type. 301 302 /// 302 303 ///\ref named-templ-param "Named parameter" for setting 303 /// PredMap type.304 ///\c PredMap type. 304 305 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 305 306 template <class T> … … 319 320 }; 320 321 ///\brief \ref named-templ-param "Named parameter" for setting 321 /// DistMap type.322 ///\c DistMap type. 322 323 /// 323 324 ///\ref named-templ-param "Named parameter" for setting 324 /// DistMap type.325 ///\c DistMap type. 325 326 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 326 327 template <class T> … … 340 341 }; 341 342 ///\brief \ref named-templ-param "Named parameter" for setting 342 /// ProcessedMap type.343 ///\c ProcessedMap type. 343 344 /// 344 345 ///\ref named-templ-param "Named parameter" for setting 345 /// ProcessedMap type.346 ///\c ProcessedMap type. 346 347 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 347 348 template <class T> … … 359 360 }; 360 361 ///\brief \ref named-templ-param "Named parameter" for setting 361 /// ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.362 ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>. 362 363 /// 363 364 ///\ref named-templ-param "Named parameter" for setting 364 /// ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.365 ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>. 365 366 ///If you don't set it explicitly, it will be automatically allocated. 366 367 struct SetStandardProcessedMap … … 440 441 /// 441 442 ///\ref named-templ-param "Named parameter" for setting 442 ///\ refOperationTraits type.443 ///\c OperationTraits type. 443 444 template <class T> 444 445 struct SetOperationTraits … … 459 460 460 461 ///Constructor. 461 ///\param _g The digraph the algorithm runs on.462 ///\param _length The length map used by the algorithm.463 Dijkstra(const Digraph& _g, const LengthMap& _length) :464 G(& _g), length(&_length),462 ///\param g The digraph the algorithm runs on. 463 ///\param length The length map used by the algorithm. 464 Dijkstra(const Digraph& g, const LengthMap& length) : 465 G(&g), _length(&length), 465 466 _pred(NULL), local_pred(false), 466 467 _dist(NULL), local_dist(false), … … 486 487 Dijkstra &lengthMap(const LengthMap &m) 487 488 { 488 length = &m;489 _length = &m; 489 490 return *this; 490 491 } … … 639 640 switch(_heap->state(w)) { 640 641 case Heap::PRE_HEAP: 641 _heap->push(w,OperationTraits::plus(oldvalue, (* length)[e]));642 _heap->push(w,OperationTraits::plus(oldvalue, (*_length)[e])); 642 643 _pred->set(w,e); 643 644 break; 644 645 case Heap::IN_HEAP: 645 646 { 646 Value newvalue = OperationTraits::plus(oldvalue, (* length)[e]);647 Value newvalue = OperationTraits::plus(oldvalue, (*_length)[e]); 647 648 if ( OperationTraits::less(newvalue, (*_heap)[w]) ) { 648 649 _heap->decrease(w, newvalue);
Note: See TracChangeset
for help on using the changeset viewer.