lemon/edge_set.h
changeset 1991 d7442141d9ef
parent 1979 c2992fd74dad
child 1999 2ff283124dfc
equal deleted inserted replaced
6:912fdb70f9e6 7:688afdd3d1fe
    18 
    18 
    19 #ifndef LEMON_EDGE_SET_H
    19 #ifndef LEMON_EDGE_SET_H
    20 #define LEMON_EDGE_SET_H
    20 #define LEMON_EDGE_SET_H
    21 
    21 
    22 
    22 
       
    23 #include <lemon/bits/default_map.h>
    23 #include <lemon/bits/edge_set_extender.h>
    24 #include <lemon/bits/edge_set_extender.h>
    24 
    25 
    25 /// \ingroup graphs
    26 /// \ingroup graphs
    26 /// \file
    27 /// \file
    27 /// \brief EdgeSet classes.
    28 /// \brief EdgeSet classes.
    43     struct NodeT {
    44     struct NodeT {
    44       int first_out, first_in;
    45       int first_out, first_in;
    45       NodeT() : first_out(-1), first_in(-1) {}
    46       NodeT() : first_out(-1), first_in(-1) {}
    46     };
    47     };
    47 
    48 
    48     typedef typename Graph::template NodeMap<NodeT> NodesImplBase;
    49     typedef DefaultMap<Graph, Node, NodeT> NodesImplBase;
    49 
    50 
    50     NodesImplBase* nodes;
    51     NodesImplBase* nodes;
    51 
    52 
    52     struct EdgeT {
    53     struct EdgeT {
    53       Node source, target;
    54       Node source, target;
   194     int maxEdgeId() const { return edges.size() - 1; }
   195     int maxEdgeId() const { return edges.size() - 1; }
   195 
   196 
   196     Node source(const Edge& edge) const { return edges[edge.id].source;}
   197     Node source(const Edge& edge) const { return edges[edge.id].source;}
   197     Node target(const Edge& edge) const { return edges[edge.id].target;}
   198     Node target(const Edge& edge) const { return edges[edge.id].target;}
   198 
   199 
       
   200     typedef typename ItemSetTraits<Graph, Node>::ItemNotifier NodeNotifier;
       
   201 
       
   202     NodeNotifier& getNotifier(Node) const {
       
   203       return graph->getNotifier(Node());
       
   204     } 
       
   205 
   199     template <typename _Value>
   206     template <typename _Value>
   200     class NodeMap : public Graph::template NodeMap<_Value> {
   207     class NodeMap : public Graph::template NodeMap<_Value> {
   201     public:
   208     public:
   202       typedef typename _Graph::template NodeMap<_Value> Parent;
   209       typedef typename _Graph::template NodeMap<_Value> Parent;
   203       explicit NodeMap(const ListEdgeSetBase<Graph>& edgeset) 
   210       explicit NodeMap(const ListEdgeSetBase<Graph>& edgeset) 
   402     struct NodeT {
   409     struct NodeT {
   403       int first_out, first_in;
   410       int first_out, first_in;
   404       NodeT() : first_out(-1), first_in(-1) {}
   411       NodeT() : first_out(-1), first_in(-1) {}
   405     };
   412     };
   406 
   413 
   407     typedef typename Graph::template NodeMap<NodeT> NodesImplBase;
   414     typedef DefaultMap<Graph, Node, NodeT> NodesImplBase;
   408 
   415 
   409     NodesImplBase* nodes;
   416     NodesImplBase* nodes;
   410 
   417 
   411     struct EdgeT {
   418     struct EdgeT {
   412       Node source, target;
   419       Node source, target;
   503     int maxEdgeId() const { return edges.size() - 1; }
   510     int maxEdgeId() const { return edges.size() - 1; }
   504 
   511 
   505     Node source(const Edge& edge) const { return edges[edge.id].source;}
   512     Node source(const Edge& edge) const { return edges[edge.id].source;}
   506     Node target(const Edge& edge) const { return edges[edge.id].target;}
   513     Node target(const Edge& edge) const { return edges[edge.id].target;}
   507 
   514 
       
   515     typedef typename ItemSetTraits<Graph, Node>::ItemNotifier NodeNotifier;
       
   516 
       
   517     NodeNotifier& getNotifier(Node) const {
       
   518       return graph->getNotifier(Node());
       
   519     } 
       
   520 
   508     template <typename _Value>
   521     template <typename _Value>
   509     class NodeMap : public Graph::template NodeMap<_Value> {
   522     class NodeMap : public Graph::template NodeMap<_Value> {
   510     public:
   523     public:
   511       typedef typename _Graph::template NodeMap<_Value> Parent;
   524       typedef typename _Graph::template NodeMap<_Value> Parent;
   512       explicit NodeMap(const SmartEdgeSetBase<Graph>& edgeset) 
   525       explicit NodeMap(const SmartEdgeSetBase<Graph>& edgeset)