return FALSE;
if (ED_conc_opp_flag(f0))
return FALSE;
- return ((ND_rank(f0->tail) - ND_rank(f0->head))
- * (ND_rank(e0->tail) - ND_rank(e0->head)) > 0);
+ return ((ND_rank(agtail(f0)) - ND_rank(aghead(f0)))
+ * (ND_rank(agtail(e0)) - ND_rank(aghead(e0))) > 0);
}
static boolean downcandidate(node_t * v)
edge_t *e, *f;
e = ND_in(u).list[0];
f = ND_in(v).list[0];
- if (downcandidate(v) && (e->tail == f->tail)) {
+ if (downcandidate(v) && (agtail(e) == agtail(f))) {
return samedir(e, f)
&& (portcmp(ED_tail_port(e), ED_tail_port(f)) == 0);
}
edge_t *e, *f;
e = ND_out(u).list[0];
f = ND_out(v).list[0];
- if (upcandidate(v) && (e->head == f->head)) {
+ if (upcandidate(v) && (aghead(e) == aghead(f))) {
return samedir(e, f)
&& (portcmp(ED_head_port(e), ED_head_port(f)) == 0);
}
if (dir == DOWN) {
while ((e = ND_out(right).list[0])) {
for (k = 0; (f = ND_out(left).list[k]); k++)
- if (f->head == e->head)
+ if (aghead(f) == aghead(e))
break;
if (f == NULL)
- f = virtual_edge(left, e->head, e);
+ f = virtual_edge(left, aghead(e), e);
while ((e0 = ND_in(right).list[0])) {
merge_oneway(e0, f);
/*ED_weight(f) += ED_weight(e0); */
} else {
while ((e = ND_in(right).list[0])) {
for (k = 0; (f = ND_in(left).list[k]); k++)
- if (f->tail == e->tail)
+ if (agtail(f) == agtail(e))
break;
if (f == NULL)
- f = virtual_edge(e->tail, left, e);
+ f = virtual_edge(agtail(e), left, e);
while ((e0 = ND_out(right).list[0])) {
merge_oneway(e0, f);
delete_fast_edge(e0);
infuse(g, n);
for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
for (rep = e; ED_to_virt(rep); rep = ED_to_virt(rep));
- while (ND_rank(rep->head) < ND_rank(e->head)) {
- infuse(g, rep->head);
- rep = ND_out(rep->head).list[0];
+ while (ND_rank(aghead(rep)) < ND_rank(aghead(e))) {
+ infuse(g, aghead(rep));
+ rep = ND_out(aghead(rep)).list[0];
}
}
}
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
lead = GD_rankleader(g)[r];
- if (ND_rank(g->root)[r].v[ND_order(lead)] != lead)
+ if (GD_rank(agroot(g))[r].v[ND_order(lead)] != lead)
abort();
GD_rank(g)[r].v =
- ND_rank(g->root)[r].v + GD_rankleader(g)[r]->u.order;
+ GD_rank(agroot(g))[r].v + ND_order((GD_rankleader(g)[r]));
maxi = -1;
for (i = 0; i < GD_rank(g)[r].n; i++) {
if ((n = GD_rank(g)[r].v[i]) == NULL)
edge_t *e;
for (e = ND_in(n).list[0]; e && ED_to_orig(e);
e = ED_to_orig(e));
- if (e && (agcontains(g, e->tail))
- && agcontains(g, e->head))
+ if (e && (agcontains(g, agtail(e)))
+ && agcontains(g, aghead(e)))
maxi = i;
}
}
if (maxi == -1)
- agerr(AGWARN, "degenerate concentrated rank %s,%d\n", g->name,
+ agerr(AGWARN, "degenerate concentrated rank %s,%d\n", agnameof(g),
r);
GD_rank(g)[r].n = maxi + 1;
}