lemon/list_graph.h
changeset 238 79643f6e8c52
parent 234 ad6b8c47bd56
child 239 7b7e3f20bcec
equal deleted inserted replaced
9:2e4f3eb2c74d 11:a0590c6b6d2e
   840 
   840 
   841       int id;
   841       int id;
   842       explicit Arc(int pid) { id = pid;}
   842       explicit Arc(int pid) { id = pid;}
   843 
   843 
   844     public:
   844     public:
   845       operator Edge() const { return edgeFromId(id / 2); }
   845       operator Edge() const { 
       
   846         return id != -1 ? edgeFromId(id / 2) : INVALID; 
       
   847       }
   846 
   848 
   847       Arc() {}
   849       Arc() {}
   848       Arc (Invalid) { id = -1; }
   850       Arc (Invalid) { id = -1; }
   849       bool operator==(const Arc& arc) const {return id == arc.id;}
   851       bool operator==(const Arc& arc) const {return id == arc.id;}
   850       bool operator!=(const Arc& arc) const {return id != arc.id;}
   852       bool operator!=(const Arc& arc) const {return id != arc.id;}