src/lemon/graph_utils.h
changeset 1252 4fee8e9d9014
parent 1164 80bb73097736
child 1267 a93f94dbe3d3
equal deleted inserted replaced
8:08b8d21fcf49 9:60d86f1ca77f
    19 
    19 
    20 #include <iterator>
    20 #include <iterator>
    21 
    21 
    22 #include <lemon/invalid.h>
    22 #include <lemon/invalid.h>
    23 #include <lemon/utility.h>
    23 #include <lemon/utility.h>
       
    24 #include <lemon/map_utils.h>
    24 
    25 
    25 ///\ingroup gutils
    26 ///\ingroup gutils
    26 ///\file
    27 ///\file
    27 ///\brief Graph utilities.
    28 ///\brief Graph utilities.
    28 ///
    29 ///
   259      const EdgeBijection& getEdgeBijection() const {
   260      const EdgeBijection& getEdgeBijection() const {
   260        return edge_bijection;
   261        return edge_bijection;
   261      }
   262      }
   262      
   263      
   263    };
   264    };
   264 
   265   
   265 /// @}
   266   template <typename _Graph>
       
   267   class GraphNodeSet {
       
   268   public:
       
   269     
       
   270     typedef _Graph Graph;
       
   271 
       
   272     typedef typename Graph::Node Item;
       
   273     typedef typename Graph::NodeIt ItemIt;
       
   274 
       
   275     template <typename _Value>
       
   276     class Map : public Graph::template NodeMap<_Value> {
       
   277     public:
       
   278       typedef typename Graph::template NodeMap<_Value> Parent; 
       
   279       typedef typename Parent::Value Value;
       
   280 
       
   281       Map(const Graph& _graph) : Parent(_graph) {}
       
   282       Map(const Graph& _graph, const Value& _value) 
       
   283 	: Parent(_graph, _value) {}
       
   284     };
       
   285 
       
   286     typedef IdMap<Graph, Item> IdMap;
       
   287     
       
   288   private:
       
   289     Graph* graph;
       
   290   };
       
   291 
       
   292   template <typename _Graph>
       
   293   class GraphEdgeSet {
       
   294   public:
       
   295     
       
   296     typedef _Graph Graph;
       
   297 
       
   298     typedef typename Graph::Edge Item;
       
   299     typedef typename Graph::EdgeIt ItemIt;
       
   300 
       
   301     template <typename _Value>
       
   302     class Map : public Graph::template EdgeMap<_Value> {
       
   303     public:
       
   304       typedef typename Graph::template EdgeMap<_Value> Parent; 
       
   305       typedef typename Parent::Value Value;
       
   306 
       
   307       Map(const Graph& _graph) : Parent(_graph) {}
       
   308       Map(const Graph& _graph, const Value& _value) 
       
   309 	: Parent(_graph, _value) {}
       
   310     };
       
   311 
       
   312     typedef IdMap<Graph, Item> IdMap;
       
   313     
       
   314   private:
       
   315     Graph* graph;
       
   316   };
       
   317 
       
   318 
       
   319   /// @}
   266   
   320   
   267 } //END OF NAMESPACE LEMON
   321 } //END OF NAMESPACE LEMON
   268 
   322 
   269 #endif
   323 #endif