Changeset 802:bc0c74eeb151 in lemon-0.x for src/hugo/dijkstra.h
- Timestamp:
- 09/05/04 22:11:47 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1096
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.