23 for (i =
GD_rank(g)[r].n; i > pos; i--) {
60 if (
ND_in(v).size == 0) {
61 assert(
ND_out(v).size == 2);
66 bounds[
SLB] = bounds[
HLB] = ord;
68 bounds[
SRB] = bounds[
HRB] = ord;
70 else if ((l < lpos) && (r > rpos));
73 if ((l < lpos) || ((l == lpos) && (r < rpos)))
75 if ((r > rpos) || ((r == rpos) && (l > lpos)))
80 onleft = onright =
false;
81 for (i = 0; (f =
ND_out(v).list[i]); i++) {
91 if (onleft && !onright)
92 bounds[
HLB] = ord + 1;
93 if (onright && !onleft)
94 bounds[
HRB] = ord - 1;
101 int lnode, rnode, r, bounds[4], lpos, rpos, pos;
108 bounds[
HLB] = bounds[
SLB] = lnode - 1;
109 bounds[
HRB] = bounds[
SRB] = rnode + 1;
111 while (lnode <= rnode) {
117 if (bounds[
HRB] - bounds[
HLB] <= 1)
120 if (bounds[
HLB] <= bounds[
HRB])
121 pos = (bounds[
HLB] + bounds[
HRB] + 1) / 2;
123 pos = (bounds[
SLB] + bounds[
SRB] + 1) / 2;
150 if ((n =
GD_rank(g)[r - 1].v[0]))
177 if (
GD_rank(g)[r - 1].ht1 < h2)
179 if (
GD_rank(g)[r - 1].ht2 < h2)
227 for (i = lo + 1; i < hi; i++) {
268 for (
size_t j = 0; (e =
ND_flat_out(n).list[j]); j++) {
272 for (
size_t j = 0; j <
ND_other(n).size; j++) {
281 for (i = 0; (n =
GD_rank(g)[0].v[i]); i++) {
282 for (
size_t j = 0; (e =
ND_flat_in(n).list[j]); j++) {
311 for (
size_t j = 0; j <
ND_other(n).size; j++) {
Memory allocation wrappers that exit on failure.
static void * gv_recalloc(void *ptr, size_t old_nmemb, size_t new_nmemb, size_t size)
static void * gv_calloc(size_t nmemb, size_t size)
Agraph_t * dot_root(void *p)
Agedge_t * virtual_edge(Agnode_t *, Agnode_t *, Agedge_t *)
void checkLabelOrder(graph_t *g)
void rec_reset_vlists(Agraph_t *)
void rec_save_vlists(Agraph_t *)
Agnode_t * virtual_node(Agraph_t *)
static void flat_node(edge_t *e)
static int flat_limits(graph_t *g, edge_t *e)
int flat_edges(graph_t *g)
static void checkFlatAdjacent(edge_t *e)
static void abomination(graph_t *g)
static node_t * make_vn_slot(graph_t *g, int r, int pos)
static void findlr(node_t *u, node_t *v, int *lp, int *rp)
static void setbounds(node_t *v, int *bounds, int lpos, int rpos)
int rank(graph_t *g, int balance, int maxiter)