Changeset 1267:a93f94dbe3d3 in lemon-0.x for src/lemon/graph_utils.h
- Timestamp:
- 03/26/05 00:31:57 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1694
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/graph_utils.h
r1192 r1267 22 22 #include <lemon/invalid.h> 23 23 #include <lemon/utility.h> 24 #include <lemon/map_utils.h>25 24 26 25 ///\ingroup gutils … … 35 34 namespace lemon { 36 35 37 /// \addtogroup gutils38 /// @{36 /// \addtogroup gutils 37 /// @{ 39 38 40 39 /// \brief Function to count the items in the graph. … … 161 160 template <typename Graph> 162 161 typename Graph::Edge findEdge(const Graph &g, 163 typename Graph::Node u, typename Graph::Node v,164 typename Graph::Edge prev = INVALID)162 typename Graph::Node u, typename Graph::Node v, 163 typename Graph::Edge prev = INVALID) 165 164 { 166 165 typename Graph::OutEdgeIt e(g,prev); … … 226 225 } 227 226 228 227 template < 229 228 typename _DestinationGraph, 230 229 typename _SourceGraph, … … 232 231 =typename _SourceGraph::template NodeMap<typename _DestinationGraph::Node>, 233 232 typename _EdgeBijection 234 = typename _SourceGraph::template EdgeMap<typename _DestinationGraph::Edge>235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 233 = typename _SourceGraph::template EdgeMap<typename _DestinationGraph::Edge> 234 > 235 class GraphCopy { 236 public: 237 238 typedef _DestinationGraph DestinationGraph; 239 typedef _SourceGraph SourceGraph; 240 241 typedef _NodeBijection NodeBijection; 242 typedef _EdgeBijection EdgeBijection; 243 244 protected: 245 246 NodeBijection node_bijection; 247 EdgeBijection edge_bijection; 248 249 public: 251 250 252 253 254 255 256 257 258 259 260 261 262 251 GraphCopy(DestinationGraph& _d, const SourceGraph& _s) { 252 copyGraph(_d, _s, node_bijection, edge_bijection); 253 } 254 255 const NodeBijection& getNodeBijection() const { 256 return node_bijection; 257 } 258 259 const EdgeBijection& getEdgeBijection() const { 260 return edge_bijection; 261 } 263 262 264 }; 263 }; 264 265 266 template <typename _Graph, typename _Item> 267 class ItemSetTraits { 268 }; 265 269 266 270 template <typename _Graph> 267 class GraphNodeSet{271 class ItemSetTraits<_Graph, typename _Graph::Node> { 268 272 public: 269 273 … … 284 288 }; 285 289 286 typedef IdMap<Graph, Item> IdMap;287 288 private:289 Graph* graph;290 290 }; 291 291 292 292 template <typename _Graph> 293 class GraphEdgeSet{293 class ItemSetTraits<_Graph, typename _Graph::Edge> { 294 294 public: 295 295 … … 310 310 }; 311 311 312 typedef IdMap<Graph, Item> IdMap; 313 314 private: 315 Graph* graph; 316 }; 317 312 }; 313 314 template <typename _Graph> 315 class ItemSetTraits<_Graph, typename _Graph::UndirEdge> { 316 public: 317 318 typedef _Graph Graph; 319 320 typedef typename Graph::UndirEdge Item; 321 typedef typename Graph::UndirEdgeIt ItemIt; 322 323 template <typename _Value> 324 class Map : public Graph::template UndirEdgeMap<_Value> { 325 public: 326 typedef typename Graph::template UndirEdgeMap<_Value> Parent; 327 typedef typename Parent::Value Value; 328 329 Map(const Graph& _graph) : Parent(_graph) {} 330 Map(const Graph& _graph, const Value& _value) 331 : Parent(_graph, _value) {} 332 }; 333 334 }; 318 335 319 336 /// @}
Note: See TracChangeset
for help on using the changeset viewer.