lemon/smart_graph.h
changeset 270 58b0b3c0015e
parent 220 a5d8c039f218
child 280 e7f8647ce760
equal deleted inserted replaced
7:a6092ca51597 8:ce32cbdfb373
   463 
   463 
   464       int _id;
   464       int _id;
   465       explicit Arc(int id) { _id = id;}
   465       explicit Arc(int id) { _id = id;}
   466 
   466 
   467     public:
   467     public:
   468       operator Edge() const { return edgeFromId(_id / 2); }
   468       operator Edge() const { 
       
   469         return _id != -1 ? edgeFromId(_id / 2) : INVALID; 
       
   470       }
   469 
   471 
   470       Arc() {}
   472       Arc() {}
   471       Arc (Invalid) { _id = -1; }
   473       Arc (Invalid) { _id = -1; }
   472       bool operator==(const Arc& arc) const {return _id == arc._id;}
   474       bool operator==(const Arc& arc) const {return _id == arc._id;}
   473       bool operator!=(const Arc& arc) const {return _id != arc._id;}
   475       bool operator!=(const Arc& arc) const {return _id != arc._id;}