lemon/list_graph.h
changeset 2347 0aaa7ada5395
parent 2342 4dd3eb348641
child 2381 0248790c66ea
equal deleted inserted replaced
45:967cbebdd335 46:1a3b15663d86
   745     int first_free_edge;
   745     int first_free_edge;
   746     
   746     
   747   public:
   747   public:
   748     
   748     
   749     typedef ListUGraphBase Graph;
   749     typedef ListUGraphBase Graph;
       
   750 
       
   751     class Node;
       
   752     class Edge;
       
   753     class UEdge;
   750     
   754     
   751     class Node {
   755     class Node {
   752       friend class ListUGraphBase;
   756       friend class ListUGraphBase;
   753     protected:
   757     protected:
   754 
   758 
   763       bool operator<(const Node& node) const {return id < node.id;}
   767       bool operator<(const Node& node) const {return id < node.id;}
   764     };
   768     };
   765 
   769 
   766     class UEdge {
   770     class UEdge {
   767       friend class ListUGraphBase;
   771       friend class ListUGraphBase;
   768       friend class ListUGraphBase::Edge;
       
   769     protected:
   772     protected:
   770 
   773 
   771       int id;
   774       int id;
   772       explicit UEdge(int pid) { id = pid;}
   775       explicit UEdge(int pid) { id = pid;}
   773 
   776 
   785 
   788 
   786       int id;
   789       int id;
   787       explicit Edge(int pid) { id = pid;}
   790       explicit Edge(int pid) { id = pid;}
   788 
   791 
   789     public:
   792     public:
   790       operator UEdge() const { return UEdge(id / 2); }
   793       operator UEdge() const { return uEdgeFromId(id / 2); }
   791 
   794 
   792       Edge() {}
   795       Edge() {}
   793       Edge (Invalid) { id = -1; }
   796       Edge (Invalid) { id = -1; }
   794       bool operator==(const Edge& edge) const {return id == edge.id;}
   797       bool operator==(const Edge& edge) const {return id == edge.id;}
   795       bool operator!=(const Edge& edge) const {return id != edge.id;}
   798       bool operator!=(const Edge& edge) const {return id != edge.id;}