lemon/dfs.h
changeset 280 e7f8647ce760
parent 258 0310c8984732
child 281 e9b4fbe163f5
equal deleted inserted replaced
10:f51d64d593c2 12:0c70c82d512e
    52     ///Instantiates a \ref PredMap.
    52     ///Instantiates a \ref PredMap.
    53 
    53 
    54     ///This function instantiates a \ref PredMap.
    54     ///This function instantiates a \ref PredMap.
    55     ///\param g is the digraph, to which we would like to define the
    55     ///\param g is the digraph, to which we would like to define the
    56     ///\ref PredMap.
    56     ///\ref PredMap.
    57     ///\todo The digraph alone may be insufficient to initialize
       
    58     static PredMap *createPredMap(const Digraph &g)
    57     static PredMap *createPredMap(const Digraph &g)
    59     {
    58     {
    60       return new PredMap(g);
    59       return new PredMap(g);
    61     }
    60     }
    62 
    61 
    63     ///The type of the map that indicates which nodes are processed.
    62     ///The type of the map that indicates which nodes are processed.
    64 
    63 
    65     ///The type of the map that indicates which nodes are processed.
    64     ///The type of the map that indicates which nodes are processed.
    66     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    65     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    67     ///By default it is a NullMap.
       
    68     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    66     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    69     ///Instantiates a \ref ProcessedMap.
    67     ///Instantiates a \ref ProcessedMap.
    70 
    68 
    71     ///This function instantiates a \ref ProcessedMap.
    69     ///This function instantiates a \ref ProcessedMap.
    72     ///\param g is the digraph, to which
    70     ///\param g is the digraph, to which
   193     bool local_processed;
   191     bool local_processed;
   194 
   192 
   195     std::vector<typename Digraph::OutArcIt> _stack;
   193     std::vector<typename Digraph::OutArcIt> _stack;
   196     int _stack_head;
   194     int _stack_head;
   197 
   195 
   198     ///Creates the maps if necessary.
   196     //Creates the maps if necessary.
   199     ///\todo Better memory allocation (instead of new).
       
   200     void create_maps()
   197     void create_maps()
   201     {
   198     {
   202       if(!_pred) {
   199       if(!_pred) {
   203         local_pred = true;
   200         local_pred = true;
   204         _pred = Traits::createPredMap(*G);
   201         _pred = Traits::createPredMap(*G);
   780     ///Instantiates a \ref PredMap.
   777     ///Instantiates a \ref PredMap.
   781 
   778 
   782     ///This function instantiates a \ref PredMap.
   779     ///This function instantiates a \ref PredMap.
   783     ///\param g is the digraph, to which we would like to define the
   780     ///\param g is the digraph, to which we would like to define the
   784     ///\ref PredMap.
   781     ///\ref PredMap.
   785     ///\todo The digraph alone may be insufficient to initialize
       
   786 #ifdef DOXYGEN
   782 #ifdef DOXYGEN
   787     static PredMap *createPredMap(const Digraph &g)
   783     static PredMap *createPredMap(const Digraph &g)
   788 #else
   784 #else
   789     static PredMap *createPredMap(const Digraph &)
   785     static PredMap *createPredMap(const Digraph &)
   790 #endif
   786 #endif
  1277     bool local_reached;
  1273     bool local_reached;
  1278 
  1274 
  1279     std::vector<typename Digraph::Arc> _stack;
  1275     std::vector<typename Digraph::Arc> _stack;
  1280     int _stack_head;
  1276     int _stack_head;
  1281 
  1277 
  1282     ///Creates the maps if necessary.
  1278     //Creates the maps if necessary.
  1283     ///\todo Better memory allocation (instead of new).
       
  1284     void create_maps() {
  1279     void create_maps() {
  1285       if(!_reached) {
  1280       if(!_reached) {
  1286         local_reached = true;
  1281         local_reached = true;
  1287         _reached = Traits::createReachedMap(*_digraph);
  1282         _reached = Traits::createReachedMap(*_digraph);
  1288       }
  1283       }