COIN-OR::LEMON - Graph Library

Changeset 1192:aa4483befa56 in lemon-0.x for src/lemon/graph_utils.h


Ignore:
Timestamp:
03/04/05 18:16:01 (15 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1604
Message:

Adding GraphEdgeSet? and GraphNodeSet? classes to graph_utils.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/graph_utils.h

    r1164 r1192  
    2222#include <lemon/invalid.h>
    2323#include <lemon/utility.h>
     24#include <lemon/map_utils.h>
    2425
    2526///\ingroup gutils
     
    262263     
    263264   };
    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  /// @}
    266320 
    267321} //END OF NAMESPACE LEMON
Note: See TracChangeset for help on using the changeset viewer.