lemon/full_graph.h
changeset 2076 10681ee9d8ae
parent 2061 7ab148f53d66
child 2111 ea1fa1bc3f6d
     1.1 --- a/lemon/full_graph.h	Tue May 09 14:28:02 2006 +0000
     1.2 +++ b/lemon/full_graph.h	Fri May 12 09:51:45 2006 +0000
     1.3 @@ -441,7 +441,7 @@
     1.4  
     1.5    };
     1.6  
     1.7 -  typedef UGraphExtender<UGraphBaseExtender<FullUGraphBase> > 
     1.8 +  typedef UGraphExtender<UndirGraphExtender<FullUGraphBase> > 
     1.9    ExtendedFullUGraphBase;
    1.10  
    1.11    /// \ingroup graphs
    1.12 @@ -518,18 +518,18 @@
    1.13        bool operator<(const Node i) const {return id<i.id;}
    1.14      };
    1.15  
    1.16 -    class Edge {
    1.17 +    class UEdge {
    1.18        friend class FullBpUGraphBase;
    1.19      protected:
    1.20        int id;
    1.21  
    1.22 -      Edge(int _id) { id = _id;}
    1.23 +      UEdge(int _id) { id = _id;}
    1.24      public:
    1.25 -      Edge() {}
    1.26 -      Edge (Invalid) { id = -1; }
    1.27 -      bool operator==(const Edge i) const {return id==i.id;}
    1.28 -      bool operator!=(const Edge i) const {return id!=i.id;}
    1.29 -      bool operator<(const Edge i) const {return id<i.id;}
    1.30 +      UEdge() {}
    1.31 +      UEdge (Invalid) { id = -1; }
    1.32 +      bool operator==(const UEdge i) const {return id==i.id;}
    1.33 +      bool operator!=(const UEdge i) const {return id!=i.id;}
    1.34 +      bool operator<(const UEdge i) const {return id<i.id;}
    1.35      };
    1.36  
    1.37      void construct(int aNodeNum, int bNodeNum) {
    1.38 @@ -568,27 +568,27 @@
    1.39        }
    1.40      }
    1.41    
    1.42 -    void first(Edge& edge) const {
    1.43 +    void first(UEdge& edge) const {
    1.44        edge.id = _edgeNum - 1;
    1.45      }
    1.46 -    void next(Edge& edge) const {
    1.47 +    void next(UEdge& edge) const {
    1.48        --edge.id;
    1.49      }
    1.50  
    1.51 -    void firstOut(Edge& edge, const Node& node) const {
    1.52 +    void firstFromANode(UEdge& edge, const Node& node) const {
    1.53        LEMON_ASSERT((node.id & 1) == 0, NodeSetError());
    1.54        edge.id = (node.id >> 1) * _bNodeNum;
    1.55      }
    1.56 -    void nextOut(Edge& edge) const {
    1.57 +    void nextFromANode(UEdge& edge) const {
    1.58        ++(edge.id);
    1.59        if (edge.id % _bNodeNum == 0) edge.id = -1;
    1.60      }
    1.61  
    1.62 -    void firstIn(Edge& edge, const Node& node) const {
    1.63 +    void firstFromBNode(UEdge& edge, const Node& node) const {
    1.64        LEMON_ASSERT((node.id & 1) == 1, NodeSetError());
    1.65        edge.id = (node.id >> 1);
    1.66      }
    1.67 -    void nextIn(Edge& edge) const {
    1.68 +    void nextFromBNode(UEdge& edge) const {
    1.69        edge.id += _bNodeNum;
    1.70        if (edge.id >= _edgeNum) edge.id = -1;
    1.71      }
    1.72 @@ -604,13 +604,13 @@
    1.73  	_aNodeNum * 2 - 2 : _bNodeNum * 2 - 1;
    1.74      }
    1.75    
    1.76 -    static int id(const Edge& edge) {
    1.77 +    static int id(const UEdge& edge) {
    1.78        return edge.id;
    1.79      }
    1.80 -    static Edge edgeFromId(int id) {
    1.81 -      return Edge(id);
    1.82 +    static UEdge uEdgeFromId(int id) {
    1.83 +      return UEdge(id);
    1.84      }
    1.85 -    int maxEdgeId() const {
    1.86 +    int maxUEdgeId() const {
    1.87        return _edgeNum - 1;
    1.88      }
    1.89    
    1.90 @@ -634,10 +634,10 @@
    1.91        return _bNodeNum;
    1.92      }
    1.93  
    1.94 -    Node aNode(const Edge& edge) const {
    1.95 +    Node aNode(const UEdge& edge) const {
    1.96        return Node((edge.id / _bNodeNum) << 1);
    1.97      }
    1.98 -    Node bNode(const Edge& edge) const {
    1.99 +    Node bNode(const UEdge& edge) const {
   1.100        return Node(((edge.id % _bNodeNum) << 1) + 1);
   1.101      }
   1.102  
   1.103 @@ -663,13 +663,12 @@
   1.104      int bNodeNum() const { return _bNodeNum; }
   1.105  
   1.106      typedef True EdgeNumTag;
   1.107 -    int edgeNum() const { return _edgeNum; }
   1.108 +    int uEdgeNum() const { return _edgeNum; }
   1.109  
   1.110    };
   1.111  
   1.112  
   1.113 -  typedef BpUGraphExtender< BpUGraphBaseExtender<
   1.114 -    FullBpUGraphBase> > ExtendedFullBpUGraphBase;
   1.115 +  typedef BpUGraphExtender<FullBpUGraphBase> ExtendedFullBpUGraphBase;
   1.116  
   1.117  
   1.118    /// \ingroup graphs