diff -r d9c115e2eeaf -r 5b1ffef43d4c src/work/alpar/dijkstra.h --- a/src/work/alpar/dijkstra.h Mon Nov 01 17:57:19 2004 +0000 +++ b/src/work/alpar/dijkstra.h Mon Nov 01 19:00:19 2004 +0000 @@ -30,23 +30,24 @@ /// \addtogroup flowalgs /// @{ + ///Default traits class of Dijkstra class. + + ///Default traits class of Dijkstra class. + ///\param GR Graph type. + ///\param LM Type of length map. template struct DijkstraDefaultTraits { - ///\e + ///The graph type the algorithm runs on. typedef GR Graph; - ///\e - typedef typename Graph::Node Node; - ///\e - typedef typename Graph::Edge Edge; ///The type of the map that stores the edge lengths. ///It must meet the \ref ReadMap concept. /// typedef LM LengthMap; - ///The type of the length of the edges. + //The type of the length of the edges. typedef typename LM::ValueType ValueType; - ///The heap type used by the dijkstra algorithm. + ///The heap type used by Dijkstra algorithm. typedef BinHeap, @@ -57,12 +58,12 @@ /// ///It must meet the \ref WriteMap concept. /// - typedef typename Graph::template NodeMap PredMap; - /// + typedef typename Graph::template NodeMap PredMap; + ///Instantiates a PredMap. ///\todo Please document... /// - static PredMap *createPredMap(const Graph &G) + static PredMap *createPredMap(const GR &G) { return new PredMap(G); } @@ -71,12 +72,12 @@ /// ///It must meet the \ref WriteMap concept. /// - typedef typename Graph::template NodeMap PredNodeMap; - /// + typedef typename Graph::template NodeMap PredNodeMap; + ///Instantiates a PredNodeMap. ///\todo Please document... /// - static PredNodeMap *createPredNodeMap(const Graph &G) + static PredNodeMap *createPredNodeMap(const GR &G) { return new PredNodeMap(G); } @@ -84,12 +85,12 @@ ///It must meet the \ref WriteMap concept. /// - typedef typename Graph::template NodeMap DistMap; - /// + typedef typename Graph::template NodeMap DistMap; + ///Instantiates a DistMap. ///\todo Please document... /// - static DistMap *createDistMap(const Graph &G) + static DistMap *createDistMap(const GR &G) { return new DistMap(G); } @@ -108,22 +109,25 @@ ///It is also possible to change the underlying priority heap. /// ///\param GR The graph type the algorithm runs on. The default value is - ///\ref ListGraph + ///\ref ListGraph. The value of GR is not used directly by %Dijsktra, it + ///is only passed to \ref DijkstraDefaultTraits. ///\param LM This read-only ///EdgeMap ///determines the ///lengths of the edges. It is read once for each edge, so the map ///may involve in relatively time consuming process to compute the edge ///length if it is necessary. The default map type is - ///\ref skeleton::StaticGraph::EdgeMap "Graph::EdgeMap" - ///\param Heap The heap type used by the %Dijkstra - ///algorithm. The default - ///is using \ref BinHeap "binary heap". + ///\ref skeleton::StaticGraph::EdgeMap "Graph::EdgeMap". + ///The value of LM is not used directly by %Dijsktra, it + ///is only passed to \ref DijkstraDefaultTraits. + ///\param TR Traits class to set various data types used by the algorithm. + ///The default traits class is + ///\ref DijkstraDefaultTraits "DijkstraDefaultTraits". + ///See \ref DijkstraDefaultTraits for the documentation of + ///a Dijkstra traits class. /// ///\author Jacint Szabo and Alpar Juttner ///\todo We need a typedef-names should be standardized. (-: - ///\todo Type of \c PredMap, \c PredNodeMap and \c DistMap - ///should not be fixed. (Problematic to solve). #ifdef DOXYGEN template class SetPredMap : public Dijkstra< Graph, LengthMap, @@ -237,7 +243,10 @@ exit(1); } }; - ///\ref named-templ-param "Named parameter" for setting PredNodeMap's type + ///\ref named-templ-param "Named parameter" for setting PredNodeMap type + + ///\ingroup flowalgs + ///\ref named-templ-param "Named parameter" for setting PredNodeMap type template class SetPredNodeMap : public Dijkstra< Graph, LengthMap, @@ -255,7 +264,10 @@ exit(1); } }; - ///\ref named-templ-param "Named parameter" for setting DistMap's type + ///\ref named-templ-param "Named parameter" for setting DistMap type + + ///\ingroup flowalgs + ///\ref named-templ-param "Named parameter" for setting DistMap type template class SetDistMap : public Dijkstra< Graph, LengthMap, @@ -265,7 +277,7 @@ ///\param _G the graph the algorithm will run on. ///\param _length the length map used by the algorithm. - Dijkstra(const Graph& _G, const LM& _length) : + Dijkstra(const Graph& _G, const LengthMap& _length) : G(&_G), length(&_length), predecessor(NULL), local_predecessor(false), pred_node(NULL), local_pred_node(false), @@ -284,7 +296,7 @@ ///Sets the length map. ///\return (*this) - Dijkstra &setLengthMap(const LM &m) + Dijkstra &setLengthMap(const LengthMap &m) { length = &m; return *this; @@ -349,7 +361,7 @@ ///shortest path to each node. The algorithm computes ///- The shortest path tree. ///- The distance of each node from the root. - + ///\todo heap_map's type could also be in the traits class. void run(Node s) { init_maps(); @@ -361,7 +373,7 @@ pred_node->set(u,INVALID); } - typename GR::template NodeMap heap_map(*G,-1); + typename Graph::template NodeMap heap_map(*G,-1); Heap heap(heap_map); @@ -583,7 +595,7 @@ ///\e - ///\e + ///\todo Please document... /// template _Dijkstra >