lemon/dijkstra.h
changeset 293 47fbc814aa31
parent 286 da414906fe21
parent 281 e9b4fbe163f5
child 290 f6899946c1ac
equal deleted inserted replaced
15:3f3220c1c7b4 16:b906cdd943b5
   142     ///Instantiates a \ref PredMap.
   142     ///Instantiates a \ref PredMap.
   143 
   143 
   144     ///This function instantiates a \ref PredMap.
   144     ///This function instantiates a \ref PredMap.
   145     ///\param g is the digraph, to which we would like to define the
   145     ///\param g is the digraph, to which we would like to define the
   146     ///\ref PredMap.
   146     ///\ref PredMap.
   147     ///\todo The digraph alone may be insufficient for the initialization
       
   148     static PredMap *createPredMap(const Digraph &g)
   147     static PredMap *createPredMap(const Digraph &g)
   149     {
   148     {
   150       return new PredMap(g);
   149       return new PredMap(g);
   151     }
   150     }
   152 
   151 
   153     ///The type of the map that indicates which nodes are processed.
   152     ///The type of the map that indicates which nodes are processed.
   154 
   153 
   155     ///The type of the map that indicates which nodes are processed.
   154     ///The type of the map that indicates which nodes are processed.
   156     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
   155     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
   157     ///By default it is a NullMap.
   156     ///By default it is a NullMap.
   158     ///\todo If it is set to a real map,
       
   159     ///Dijkstra::processed() should read this.
       
   160     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
   157     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
   161     ///Instantiates a \ref ProcessedMap.
   158     ///Instantiates a \ref ProcessedMap.
   162 
   159 
   163     ///This function instantiates a \ref ProcessedMap.
   160     ///This function instantiates a \ref ProcessedMap.
   164     ///\param g is the digraph, to which
   161     ///\param g is the digraph, to which
   295     //Pointer to the heap.
   292     //Pointer to the heap.
   296     Heap *_heap;
   293     Heap *_heap;
   297     //Indicates if _heap is locally allocated (true) or not.
   294     //Indicates if _heap is locally allocated (true) or not.
   298     bool local_heap;
   295     bool local_heap;
   299 
   296 
   300     ///Creates the maps if necessary.
   297     //Creates the maps if necessary.
   301     ///\todo Better memory allocation (instead of new).
       
   302     void create_maps()
   298     void create_maps()
   303     {
   299     {
   304       if(!_pred) {
   300       if(!_pred) {
   305         local_pred = true;
   301         local_pred = true;
   306         _pred = Traits::createPredMap(*G);
   302         _pred = Traits::createPredMap(*G);
   963     ///Instantiates a \ref HeapCrossRef.
   959     ///Instantiates a \ref HeapCrossRef.
   964 
   960 
   965     ///This function instantiates a \ref HeapCrossRef.
   961     ///This function instantiates a \ref HeapCrossRef.
   966     /// \param g is the digraph, to which we would like to define the
   962     /// \param g is the digraph, to which we would like to define the
   967     /// HeapCrossRef.
   963     /// HeapCrossRef.
   968     /// \todo The digraph alone may be insufficient for the initialization
       
   969     static HeapCrossRef *createHeapCrossRef(const Digraph &g)
   964     static HeapCrossRef *createHeapCrossRef(const Digraph &g)
   970     {
   965     {
   971       return new HeapCrossRef(g);
   966       return new HeapCrossRef(g);
   972     }
   967     }
   973 
   968 
   999     ///Instantiates a \ref PredMap.
   994     ///Instantiates a \ref PredMap.
  1000 
   995 
  1001     ///This function instantiates a \ref PredMap.
   996     ///This function instantiates a \ref PredMap.
  1002     ///\param g is the digraph, to which we would like to define the
   997     ///\param g is the digraph, to which we would like to define the
  1003     ///\ref PredMap.
   998     ///\ref PredMap.
  1004     ///\todo The digraph alone may be insufficient to initialize
       
  1005     static PredMap *createPredMap(const Digraph &g)
   999     static PredMap *createPredMap(const Digraph &g)
  1006     {
  1000     {
  1007       return new PredMap(g);
  1001       return new PredMap(g);
  1008     }
  1002     }
  1009 
  1003 
  1010     ///The type of the map that indicates which nodes are processed.
  1004     ///The type of the map that indicates which nodes are processed.
  1011 
  1005 
  1012     ///The type of the map that indicates which nodes are processed.
  1006     ///The type of the map that indicates which nodes are processed.
  1013     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
  1007     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
  1014     ///By default it is a NullMap.
  1008     ///By default it is a NullMap.
  1015     ///\todo If it is set to a real map,
       
  1016     ///Dijkstra::processed() should read this.
       
  1017     ///\todo named parameter to set this type, function to read and write.
       
  1018     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
  1009     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
  1019     ///Instantiates a \ref ProcessedMap.
  1010     ///Instantiates a \ref ProcessedMap.
  1020 
  1011 
  1021     ///This function instantiates a \ref ProcessedMap.
  1012     ///This function instantiates a \ref ProcessedMap.
  1022     ///\param g is the digraph, to which
  1013     ///\param g is the digraph, to which
  1058   /// we have created a wizard class.
  1049   /// we have created a wizard class.
  1059   /// This \ref DijkstraWizard class needs default traits,
  1050   /// This \ref DijkstraWizard class needs default traits,
  1060   /// as well as the \ref Dijkstra class.
  1051   /// as well as the \ref Dijkstra class.
  1061   /// The \ref DijkstraWizardBase is a class to be the default traits of the
  1052   /// The \ref DijkstraWizardBase is a class to be the default traits of the
  1062   /// \ref DijkstraWizard class.
  1053   /// \ref DijkstraWizard class.
  1063   /// \todo More named parameters are required...
       
  1064   template<class GR,class LM>
  1054   template<class GR,class LM>
  1065   class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LM>
  1055   class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LM>
  1066   {
  1056   {
  1067     typedef DijkstraWizardDefaultTraits<GR,LM> Base;
  1057     typedef DijkstraWizardDefaultTraits<GR,LM> Base;
  1068   protected:
  1058   protected: