public E getFreeIncident() {
E ret = getFreeIncident(e, e);
if (ret != null) return ret;
- //ret = getFreeIncident(e.pair.next, e.pair.next);
- if (ret != null) return ret;
for(E e = this.e; e!=null; e=e.pair.next==this.e?null:e.pair.next)
System.out.println(e + " " + e.t);
throw new Error("unable to find free incident to " + this);
}
public boolean isBoundTo(Vertex p) {
- Vertex px = p;
- do {
- if (px==this) return true;
- px = px.bound_to;
- } while(px != p);
+ for(Vertex px = p; px!=null; px=(px.bound_to==p?null:px.bound_to))
+ if (px==this)
+ return true;
return false;
}
public void unbind() { bound_to = this; binding = Matrix.ONE; }