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 |
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 } |