Changeset 802:bc0c74eeb151 in lemon0.x
 Timestamp:
 09/05/04 22:11:47 (20 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1096
 Location:
 src/hugo
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

src/hugo/bfs.h
r781 r802 35 35 ///The type of the underlying graph. 36 36 typedef GR Graph; 37 ///. 37 38 typedef typename Graph::Node Node; 39 ///. 38 40 typedef typename Graph::NodeIt NodeIt; 41 ///. 39 42 typedef typename Graph::Edge Edge; 43 ///. 40 44 typedef typename Graph::OutEdgeIt OutEdgeIt; 41 45 … … 50 54 51 55 private: 56 /// Pointer to the underlying graph. 52 57 const Graph *G; 58 ///Pointer to the map of predecessors edges. 53 59 PredMap *predecessor; 60 ///Indicates if \ref predecessor is locally allocated (\c true) or not. 54 61 bool local_predecessor; 62 ///Pointer to the map of predecessors nodes. 55 63 PredNodeMap *pred_node; 64 ///Indicates if \ref pred_node is locally allocated (\c true) or not. 56 65 bool local_pred_node; 66 ///Pointer to the map of distances. 57 67 DistMap *distance; 68 ///Indicates if \ref distance is locally allocated (\c true) or not. 58 69 bool local_distance; 59 70 60 // The source node of the last execution.71 ///The source node of the last execution. 61 72 Node source; 62 73 … … 80 91 81 92 public : 93 ///Constructor. 94 95 ///\param _G the graph the algorithm will run on. 82 96 Bfs(const Graph& _G) : 83 97 G(&_G), … … 87 101 { } 88 102 103 ///Destructor. 89 104 ~Bfs() 90 105 { … … 94 109 } 95 110 96 ///Sets the graph the algorithm will run on.97 98 ///Sets the graph the algorithm will run on.99 ///\return <tt> (*this) </tt>100 ///\bug What about maps?101 ///\todo It may be unnecessary102 Bfs &setGraph(const Graph &_G)103 {104 G = &_G;105 return *this;106 }107 111 ///Sets the map storing the predecessor edges. 108 112 … … 250 254 251 255 ///Returns \c true if \c v is reachable from the root. 252 ///\ warningThe root node is reported to be reached!256 ///\note The root node is reported to be reached! 253 257 /// 254 258 ///\pre \ref run() must be called before using this function. 
src/hugo/dfs.h
r781 r802 34 34 ///The type of the underlying graph. 35 35 typedef GR Graph; 36 /// . 36 37 typedef typename Graph::Node Node; 38 /// . 37 39 typedef typename Graph::NodeIt NodeIt; 40 /// . 38 41 typedef typename Graph::Edge Edge; 42 /// . 39 43 typedef typename Graph::OutEdgeIt OutEdgeIt; 40 44 … … 49 53 50 54 private: 55 /// Pointer to the underlying graph. 51 56 const Graph *G; 57 ///Pointer to the map of predecessors edges. 52 58 PredMap *predecessor; 59 ///Indicates if \ref predecessor is locally allocated (\c true) or not. 53 60 bool local_predecessor; 61 ///Pointer to the map of predecessors nodes. 54 62 PredNodeMap *pred_node; 63 ///Indicates if \ref pred_node is locally allocated (\c true) or not. 55 64 bool local_pred_node; 65 ///Pointer to the map of distances. 56 66 DistMap *distance; 67 ///Indicates if \ref distance is locally allocated (\c true) or not. 57 68 bool local_distance; 58 69 59 // The source node of the last execution.70 ///The source node of the last execution. 60 71 Node source; 61 72 … … 79 90 80 91 public : 92 ///Constructor. 93 94 ///\param _G the graph the algorithm will run on. 81 95 Dfs(const Graph& _G) : 82 96 G(&_G), … … 86 100 { } 87 101 102 ///Destructor. 88 103 ~Dfs() 89 104 { … … 93 108 } 94 109 95 ///Sets the graph the algorithm will run on.96 97 ///Sets the graph the algorithm will run on.98 ///\return <tt> (*this) </tt>99 ///\bug What about maps?100 ///\todo It may be unnecessary101 Dfs &setGraph(const Graph &_G)102 {103 G = &_G;104 return *this;105 }106 110 ///Sets the map storing the predecessor edges. 107 111 … … 254 258 255 259 ///Returns \c true if \c v is reachable from the root. 256 ///\ warningThe root node is reported to be reached!260 ///\note The root node is reported to be reached! 257 261 /// 258 262 ///\pre \ref run() must be called before using this function. 
src/hugo/dijkstra.h
r785 r802 56 56 ///The type of the underlying graph. 57 57 typedef GR Graph; 58 ///. 58 59 typedef typename Graph::Node Node; 60 ///. 59 61 typedef typename Graph::NodeIt NodeIt; 62 ///. 60 63 typedef typename Graph::Edge Edge; 64 ///. 61 65 typedef typename Graph::OutEdgeIt OutEdgeIt; 62 66 … … 75 79 76 80 private: 81 /// Pointer to the underlying graph. 77 82 const Graph *G; 83 /// Pointer to the length map 78 84 const LM *length; 79 // bool local_length;85 ///Pointer to the map of predecessors edges. 80 86 PredMap *predecessor; 87 ///Indicates if \ref predecessor is locally allocated (\c true) or not. 81 88 bool local_predecessor; 89 ///Pointer to the map of predecessors nodes. 82 90 PredNodeMap *pred_node; 91 ///Indicates if \ref pred_node is locally allocated (\c true) or not. 83 92 bool local_pred_node; 93 ///Pointer to the map of distances. 84 94 DistMap *distance; 95 ///Indicates if \ref distance is locally allocated (\c true) or not. 85 96 bool local_distance; 86 97 87 // The source node of the last execution.98 ///The source node of the last execution. 88 99 Node source; 89 100 … … 94 105 void init_maps() 95 106 { 96 // if(!length) {97 // local_length = true;98 // length = new LM(G);99 // }100 107 if(!predecessor) { 101 108 local_predecessor = true; … … 113 120 114 121 public : 115 122 ///Constructor. 123 124 ///\param _G the graph the algorithm will run on. 125 ///\param _length the length map used by the algorithm. 116 126 Dijkstra(const Graph& _G, const LM& _length) : 117 127 G(&_G), length(&_length), … … 121 131 { } 122 132 133 ///Destructor. 123 134 ~Dijkstra() 124 135 { 125 // if(local_length) delete length;126 136 if(local_predecessor) delete predecessor; 127 137 if(local_pred_node) delete pred_node; … … 129 139 } 130 140 131 ///Sets the graph the algorithm will run on.132 133 ///Sets the graph the algorithm will run on.134 ///\return <tt> (*this) </tt>135 ///\bug What about maps?136 ///\todo It may be unnecessary137 Dijkstra &setGraph(const Graph &_G)138 {139 G = &_G;140 return *this;141 }142 141 ///Sets the length map. 143 142 … … 146 145 Dijkstra &setLengthMap(const LM &m) 147 146 { 148 // if(local_length) {149 // delete length;150 // local_length=false;151 // }152 147 length = &m; 153 148 return *this; … … 318 313 319 314 ///Returns \c true if \c v is reachable from the root. 320 ///\ warning the root node is reported to be reached!315 ///\note The root node is reported to be reached! 321 316 ///\pre \ref run() must be called before using this function. 322 317 ///
Note: See TracChangeset
for help on using the changeset viewer.