nodeCount = agnnodes(g);
deglist_t dl = getList(g);
- while (counter < (nodeCount - 3)) {
+ while (counter < nodeCount - 3) {
currnode = deglist_is_empty(&dl) ? NULL : deglist_pop(&dl);
/* Remove all adjacent nodes since they have to be reinserted */
DISTONE(parent) = dist;
} else if (dist > DISTONE(parent)) {
if (LEAFONE(parent) != change) {
- if (!DISTTWO(parent) || (LEAFTWO(parent) != change))
+ if (!DISTTWO(parent) || LEAFTWO(parent) != change)
change = LEAFONE(parent);
LEAFTWO(parent) = LEAFONE(parent);
DISTTWO(parent) = DISTONE(parent);
eitem = dtnext(openEdgeList, eitem)) {
ep = eitem->edge;
if (EDGEORDER(ep) > EDGEORDER(e)) {
- if ((aghead(ep) != n) && (agtail(ep) != n))
+ if (aghead(ep) != n && agtail(ep) != n)
crossings++;
}
}
origCrossings = crossings;
list = reduce(list, subg, &crossings);
/* return if no crossings or no improvement */
- if ((origCrossings == crossings) || (crossings == 0))
+ if (origCrossings == crossings || crossings == 0)
return list;
}
return list;
if (N == 1)
radius = 0;
else
- radius = (N * (min_dist + largest_node)) / (2 * M_PI);
+ radius = N * (min_dist + largest_node) / (2 * M_PI);
for (item = longest_path->first; item; item = item->next) {
n = item->curr;
n = item->curr;
POSITION(n) = k;
PSI(n) = 0.0;
- theta = k * ((2.0 * M_PI) / N);
+ theta = k * (2.0 * M_PI / N);
ND_pos(n)[0] = radius * cos(theta);
ND_pos(n)[1] = radius * sin(theta);
if (block) { /* If block != NULL, it's not empty */
if (!BLOCK(u) && blockSize (block) > 1)
addNode(block, u);
- if (isRoot && (BLOCK(u) == block))
+ if (isRoot && BLOCK(u) == block)
insertBlock(&state->bl, block);
else
appendBlock(&state->bl, block);
SET_PARENT(parent);
CHILD(bp) = child;
next = bp->next; /* save next since list insertion destroys it */
- appendBlock(&(BLOCK(parent)->children), bp);
+ appendBlock(&BLOCK(parent)->children, bp);
}
initBlocklist(&state->bl); /* zero out list */
return root;
count = sizeNodelist(list);
if (count == 2) {
- return (theta - M_PI / 2.0);
+ return theta - M_PI / 2.0;
}
/* Find node in block connected to block's parent */
double rho = sn->rad0;
double r = sn->radius - rho;
double n_x = ND_pos(neighbor)[0];
- if (COALESCED(sn) && (-r < n_x)) {
+ if (COALESCED(sn) && -r < n_x) {
double R = LEN(x, y);
double n_y = ND_pos(neighbor)[1];
double phi = atan2(n_y, n_x + r);
- double l = r - rho / (cos(phi));
+ double l = r - rho / cos(phi);
- theta += M_PI / 2.0 - phi - asin((l / R) * (cos(phi)));
+ theta += M_PI / 2.0 - phi - asin(l / R * cos(phi));
} else { /* Origin still at center of this block */
double phi = atan2(ND_pos(neighbor)[1], ND_pos(neighbor)[0]);
theta += M_PI - phi - PSI(neighbor);
static void
setInfo (posinfo_t* p0, posinfo_t* p1, double delta)
{
- double t = (p0->diameter*p1->minRadius) + (p1->diameter*p0->minRadius);
+ double t = p0->diameter * p1->minRadius + p1->diameter * p0->minRadius;
t /= 2*delta*p0->minRadius*p1->minRadius;
midAngle = childAngle;
}
- if ((length > 1) && (pi->n == stp->neighbor)) {
+ if (length > 1 && pi->n == stp->neighbor) {
PSI(pi->n) = midAngle;
}
if (childCount > 0)
centerAngle = position(childCount, length, longest_path, sn, min_dist);
- if ((length == 1) && (BLK_PARENT(sn))) {
+ if (length == 1 && BLK_PARENT(sn)) {
sn->parent_pos = centerAngle;
if (sn->parent_pos < 0)
sn->parent_pos += 2 * M_PI;