lemon/dfs.h
changeset 287 bb40b6db0a58
parent 286 da414906fe21
parent 281 e9b4fbe163f5
child 288 47b3a3b67837
child 290 f6899946c1ac
equal deleted inserted replaced
14:c4ddec17510e 15:5639e33caa76
    53     ///Instantiates a \ref PredMap.
    53     ///Instantiates a \ref PredMap.
    54 
    54 
    55     ///This function instantiates a \ref PredMap.
    55     ///This function instantiates a \ref PredMap.
    56     ///\param g is the digraph, to which we would like to define the
    56     ///\param g is the digraph, to which we would like to define the
    57     ///\ref PredMap.
    57     ///\ref PredMap.
    58     ///\todo The digraph alone may be insufficient to initialize
       
    59     static PredMap *createPredMap(const Digraph &g)
    58     static PredMap *createPredMap(const Digraph &g)
    60     {
    59     {
    61       return new PredMap(g);
    60       return new PredMap(g);
    62     }
    61     }
    63 
    62 
    64     ///The type of the map that indicates which nodes are processed.
    63     ///The type of the map that indicates which nodes are processed.
    65 
    64 
    66     ///The type of the map that indicates which nodes are processed.
    65     ///The type of the map that indicates which nodes are processed.
    67     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    66     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    68     ///By default it is a NullMap.
       
    69     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    67     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    70     ///Instantiates a \ref ProcessedMap.
    68     ///Instantiates a \ref ProcessedMap.
    71 
    69 
    72     ///This function instantiates a \ref ProcessedMap.
    70     ///This function instantiates a \ref ProcessedMap.
    73     ///\param g is the digraph, to which
    71     ///\param g is the digraph, to which
   194     bool local_processed;
   192     bool local_processed;
   195 
   193 
   196     std::vector<typename Digraph::OutArcIt> _stack;
   194     std::vector<typename Digraph::OutArcIt> _stack;
   197     int _stack_head;
   195     int _stack_head;
   198 
   196 
   199     ///Creates the maps if necessary.
   197     //Creates the maps if necessary.
   200     ///\todo Better memory allocation (instead of new).
       
   201     void create_maps()
   198     void create_maps()
   202     {
   199     {
   203       if(!_pred) {
   200       if(!_pred) {
   204         local_pred = true;
   201         local_pred = true;
   205         _pred = Traits::createPredMap(*G);
   202         _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     static PredMap *createPredMap(const Digraph &g)
   782     static PredMap *createPredMap(const Digraph &g)
   787     {
   783     {
   788       return new PredMap(g);
   784       return new PredMap(g);
   789     }
   785     }
   790 
   786 
  1315     bool local_reached;
  1311     bool local_reached;
  1316 
  1312 
  1317     std::vector<typename Digraph::Arc> _stack;
  1313     std::vector<typename Digraph::Arc> _stack;
  1318     int _stack_head;
  1314     int _stack_head;
  1319 
  1315 
  1320     ///Creates the maps if necessary.
  1316     //Creates the maps if necessary.
  1321     ///\todo Better memory allocation (instead of new).
       
  1322     void create_maps() {
  1317     void create_maps() {
  1323       if(!_reached) {
  1318       if(!_reached) {
  1324         local_reached = true;
  1319         local_reached = true;
  1325         _reached = Traits::createReachedMap(*_digraph);
  1320         _reached = Traits::createReachedMap(*_digraph);
  1326       }
  1321       }