lemon/floyd_warshall.h
changeset 1716 d8c28868f074
parent 1699 29428f7b8b66
child 1723 fb4f801dd692
equal deleted inserted replaced
0:478781ce5cd5 1:74b5a9fe8b70
   168   /// FloydWarshallDefaultTraits for the documentation of a FloydWarshall 
   168   /// FloydWarshallDefaultTraits for the documentation of a FloydWarshall 
   169   /// traits class.
   169   /// traits class.
   170   ///
   170   ///
   171   /// \author Balazs Dezso
   171   /// \author Balazs Dezso
   172 
   172 
   173 
   173 #ifdef DOXYGEN
       
   174   template <typename _Graph, typename _LengthMap typename _Traits >
       
   175 #else
   174   template <typename _Graph=ListGraph,
   176   template <typename _Graph=ListGraph,
   175 	    typename _LengthMap=typename _Graph::template EdgeMap<int>,
   177 	    typename _LengthMap=typename _Graph::template EdgeMap<int>,
   176 	    typename _Traits=FloydWarshallDefaultTraits<_Graph,_LengthMap> >
   178 	    typename _Traits=FloydWarshallDefaultTraits<_Graph,_LengthMap> >
       
   179 #endif
   177   class FloydWarshall {
   180   class FloydWarshall {
   178   public:
   181   public:
   179     
   182     
   180     /// \brief \ref Exception for uninitialized parameters.
   183     /// \brief \ref Exception for uninitialized parameters.
   181     ///
   184     ///
   254     /// \brief \ref named-templ-param "Named parameter" for setting PredMap 
   257     /// \brief \ref named-templ-param "Named parameter" for setting PredMap 
   255     /// type
   258     /// type
   256     /// \ref named-templ-param "Named parameter" for setting PredMap type
   259     /// \ref named-templ-param "Named parameter" for setting PredMap type
   257     ///
   260     ///
   258     template <class T>
   261     template <class T>
   259     class DefPredMap 
   262     struct DefPredMap 
   260       : public FloydWarshall< Graph, LengthMap, DefPredMapTraits<T> > {};
   263       : public FloydWarshall< Graph, LengthMap, DefPredMapTraits<T> > {
       
   264       typedef FloydWarshall< Graph, LengthMap, DefPredMapTraits<T> > Create;
       
   265     };
   261     
   266     
   262     template <class T>
   267     template <class T>
   263     struct DefDistMapTraits : public Traits {
   268     struct DefDistMapTraits : public Traits {
   264       typedef T DistMap;
   269       typedef T DistMap;
   265       static DistMap *createDistMap(const Graph& graph) {
   270       static DistMap *createDistMap(const Graph& graph) {
   270     /// type
   275     /// type
   271     ///
   276     ///
   272     /// \ref named-templ-param "Named parameter" for setting DistMap type
   277     /// \ref named-templ-param "Named parameter" for setting DistMap type
   273     ///
   278     ///
   274     template <class T>
   279     template <class T>
   275     class DefDistMap 
   280     struct DefDistMap 
   276       : public FloydWarshall< Graph, LengthMap, DefDistMapTraits<T> > {};
   281       : public FloydWarshall< Graph, LengthMap, DefDistMapTraits<T> > {
       
   282       typedef FloydWarshall< Graph, LengthMap, DefDistMapTraits<T> > Create;
       
   283     };
   277     
   284     
   278     template <class T>
   285     template <class T>
   279     struct DefOperationTraitsTraits : public Traits {
   286     struct DefOperationTraitsTraits : public Traits {
   280       typedef T OperationTraits;
   287       typedef T OperationTraits;
   281     };
   288     };
   283     /// \brief \ref named-templ-param "Named parameter" for setting 
   290     /// \brief \ref named-templ-param "Named parameter" for setting 
   284     /// OperationTraits type
   291     /// OperationTraits type
   285     ///
   292     ///
   286     /// \ref named-templ-param "Named parameter" for setting PredMap type
   293     /// \ref named-templ-param "Named parameter" for setting PredMap type
   287     template <class T>
   294     template <class T>
   288     class DefOperationTraits
   295     struct DefOperationTraits
   289       : public FloydWarshall< Graph, LengthMap, DefOperationTraitsTraits<T> > {
   296       : public FloydWarshall< Graph, LengthMap, DefOperationTraitsTraits<T> > {
       
   297       typedef FloydWarshall< Graph, LengthMap, DefOperationTraitsTraits<T> >
       
   298       Create;
   290     };
   299     };
   291     
   300     
   292     ///@}
   301     ///@}
   293 
   302 
       
   303   protected:
       
   304 
       
   305     FloydWarshall() {}
       
   306 
   294   public:      
   307   public:      
       
   308 
       
   309     typedef FloydWarshall Create;
   295     
   310     
   296     /// \brief Constructor.
   311     /// \brief Constructor.
   297     ///
   312     ///
   298     /// \param _graph the graph the algorithm will run on.
   313     /// \param _graph the graph the algorithm will run on.
   299     /// \param _length the length map used by the algorithm.
   314     /// \param _length the length map used by the algorithm.