Changeset 615:b6b31b75b522 in lemon-0.x for src/work/marci/bfs_dfs.h
- Timestamp:
- 05/11/04 21:50:21 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@800
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/bfs_dfs.h
r604 r615 3 3 #define HUGO_BFS_DFS_H 4 4 5 // ///\ingroup gwrappers6 /// \file7 /// \brief Bfs and dfs iterators.5 /// \ingroup galgs 6 /// \file 7 /// \brief Bfs and dfs iterators. 8 8 /// 9 /// This file contains bfs and dfs iterator classes.9 /// This file contains bfs and dfs iterator classes. 10 10 /// 11 // /// \author Marton Makai11 // /// \author Marton Makai 12 12 13 13 #include <queue> … … 22 22 /// \c reached_map 23 23 /// Reached have to work as read-write bool Node-map. 24 /// \ingroup galgs 24 25 template <typename Graph, /*typename OutEdgeIt,*/ 25 26 typename ReachedMap/*=typename Graph::NodeMap<bool>*/ > … … 106 107 return *this; 107 108 } 108 /// 109 /// Guess what? 109 110 bool finished() const { return bfs_queue.empty(); } 110 111 /// The conversion operator makes for converting the bfs-iterator … … 112 113 ///\bug Edge have to be in HUGO 0.2 113 114 operator OutEdgeIt() const { return actual_edge; } 114 /// 115 /// Guess what? 115 116 bool isBNodeNewlyReached() const { return b_node_newly_reached; } 116 /// 117 /// Guess what? 117 118 bool isANodeExamined() const { return !(graph->valid(actual_edge)); } 118 /// 119 /// Guess what? 119 120 Node aNode() const { return bfs_queue.front(); } 120 /// 121 /// Guess what? 121 122 Node bNode() const { return graph->bNode(actual_edge); } 122 /// 123 /// Guess what? 123 124 const ReachedMap& getReachedMap() const { return reached; } 124 /// 125 /// Guess what? 125 126 const std::queue<Node>& getBfsQueue() const { return bfs_queue; } 126 }; 127 }; 127 128 128 129 /// Bfs searches for the nodes wich are not marked in … … 130 131 /// Reached have to work as a read-write bool Node-map, 131 132 /// Pred is a write Edge Node-map and 132 /// Dist is a read-write int Node-map, have to be. 133 ///\todo In fact onsly simple operations requirement are needed for 134 /// Dist::Value. 133 /// Dist is a read-write Node-map of integral value, have to be. 134 /// \ingroup galgs 135 135 template <typename Graph, 136 136 typename ReachedMap=typename Graph::template NodeMap<bool>, … … 179 179 return *this; 180 180 } 181 /// 181 /// Guess what? 182 182 const PredMap& getPredMap() const { return pred; } 183 /// 183 /// Guess what? 184 184 const DistMap& getDistMap() const { return dist; } 185 185 }; … … 188 188 /// \c reached_map 189 189 /// Reached have to be a read-write bool Node-map. 190 /// \ingroup galgs 190 191 template <typename Graph, /*typename OutEdgeIt,*/ 191 192 typename ReachedMap/*=typename Graph::NodeMap<bool>*/ > … … 249 250 return *this; 250 251 } 251 /// 252 /// Guess what? 252 253 bool finished() const { return dfs_stack.empty(); } 253 /// 254 /// Guess what? 254 255 operator OutEdgeIt() const { return actual_edge; } 255 /// 256 /// Guess what? 256 257 bool isBNodeNewlyReached() const { return b_node_newly_reached; } 257 /// 258 /// Guess what? 258 259 bool isANodeExamined() const { return !(graph->valid(actual_edge)); } 259 /// 260 /// Guess what? 260 261 Node aNode() const { return actual_node; /*FIXME*/} 261 /// 262 /// Guess what? 262 263 Node bNode() const { return graph->bNode(actual_edge); } 263 /// 264 /// Guess what? 264 265 const ReachedMap& getReachedMap() const { return reached; } 265 /// 266 /// Guess what? 266 267 const std::stack<OutEdgeIt>& getDfsStack() const { return dfs_stack; } 267 268 }; … … 271 272 /// Reached is a read-write bool Node-map, 272 273 /// Pred is a write Node-map, have to be. 274 /// \ingroup galgs 273 275 template <typename Graph, 274 276 typename ReachedMap=typename Graph::template NodeMap<bool>, … … 313 315 return *this; 314 316 } 315 /// 317 /// Guess what? 316 318 const PredMap& getPredMap() const { return pred; } 317 319 };
Note: See TracChangeset
for help on using the changeset viewer.