COIN-OR::LEMON - Graph Library

Changeset 2076:10681ee9d8ae in lemon-0.x for lemon/full_graph.h


Ignore:
Timestamp:
05/12/06 11:51:45 (18 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2739
Message:

Extenders modified

UGraphBaseExtender => UndirGraphExtender?
BpUGraphBaseExtender merged into BpUGraphExtender

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/full_graph.h

    r2061 r2076  
    442442  };
    443443
    444   typedef UGraphExtender<UGraphBaseExtender<FullUGraphBase> >
     444  typedef UGraphExtender<UndirGraphExtender<FullUGraphBase> >
    445445  ExtendedFullUGraphBase;
    446446
     
    519519    };
    520520
    521     class Edge {
     521    class UEdge {
    522522      friend class FullBpUGraphBase;
    523523    protected:
    524524      int id;
    525525
    526       Edge(int _id) { id = _id;}
     526      UEdge(int _id) { id = _id;}
    527527    public:
    528       Edge() {}
    529       Edge (Invalid) { id = -1; }
    530       bool operator==(const Edge i) const {return id==i.id;}
    531       bool operator!=(const Edge i) const {return id!=i.id;}
    532       bool operator<(const Edge i) const {return id<i.id;}
     528      UEdge() {}
     529      UEdge (Invalid) { id = -1; }
     530      bool operator==(const UEdge i) const {return id==i.id;}
     531      bool operator!=(const UEdge i) const {return id!=i.id;}
     532      bool operator<(const UEdge i) const {return id<i.id;}
    533533    };
    534534
     
    569569    }
    570570 
    571     void first(Edge& edge) const {
     571    void first(UEdge& edge) const {
    572572      edge.id = _edgeNum - 1;
    573573    }
    574     void next(Edge& edge) const {
     574    void next(UEdge& edge) const {
    575575      --edge.id;
    576576    }
    577577
    578     void firstOut(Edge& edge, const Node& node) const {
     578    void firstFromANode(UEdge& edge, const Node& node) const {
    579579      LEMON_ASSERT((node.id & 1) == 0, NodeSetError());
    580580      edge.id = (node.id >> 1) * _bNodeNum;
    581581    }
    582     void nextOut(Edge& edge) const {
     582    void nextFromANode(UEdge& edge) const {
    583583      ++(edge.id);
    584584      if (edge.id % _bNodeNum == 0) edge.id = -1;
    585585    }
    586586
    587     void firstIn(Edge& edge, const Node& node) const {
     587    void firstFromBNode(UEdge& edge, const Node& node) const {
    588588      LEMON_ASSERT((node.id & 1) == 1, NodeSetError());
    589589      edge.id = (node.id >> 1);
    590590    }
    591     void nextIn(Edge& edge) const {
     591    void nextFromBNode(UEdge& edge) const {
    592592      edge.id += _bNodeNum;
    593593      if (edge.id >= _edgeNum) edge.id = -1;
     
    605605    }
    606606 
    607     static int id(const Edge& edge) {
     607    static int id(const UEdge& edge) {
    608608      return edge.id;
    609609    }
    610     static Edge edgeFromId(int id) {
    611       return Edge(id);
    612     }
    613     int maxEdgeId() const {
     610    static UEdge uEdgeFromId(int id) {
     611      return UEdge(id);
     612    }
     613    int maxUEdgeId() const {
    614614      return _edgeNum - 1;
    615615    }
     
    635635    }
    636636
    637     Node aNode(const Edge& edge) const {
     637    Node aNode(const UEdge& edge) const {
    638638      return Node((edge.id / _bNodeNum) << 1);
    639639    }
    640     Node bNode(const Edge& edge) const {
     640    Node bNode(const UEdge& edge) const {
    641641      return Node(((edge.id % _bNodeNum) << 1) + 1);
    642642    }
     
    664664
    665665    typedef True EdgeNumTag;
    666     int edgeNum() const { return _edgeNum; }
     666    int uEdgeNum() const { return _edgeNum; }
    667667
    668668  };
    669669
    670670
    671   typedef BpUGraphExtender< BpUGraphBaseExtender<
    672     FullBpUGraphBase> > ExtendedFullBpUGraphBase;
     671  typedef BpUGraphExtender<FullBpUGraphBase> ExtendedFullBpUGraphBase;
    673672
    674673
Note: See TracChangeset for help on using the changeset viewer.