int nextiter;
int packiter = 0;
int nPasses = 0;
+
double start, finish, totalCLK;
void dot_layout(Agraph_t * g)
setEdgeType (g, ET_SPLINE);
-#ifdef ASPECT
- start = clock();
nextiter = -1;
-#endif
dot_init_node_edge(g);
printf("Target AR = ");
scanf("%lf", &targetAR);
+ do {
+ nPasses++;
+#endif
- do{
-
- nPasses++;
+ start = clock();
+ dot_rank(g);
+ packiter += curIterations;
-#endif
- dot_rank(g);
- packiter += curIterations;
+ dot_mincross(g);
+ /* dumpRanks (g); */
- dot_mincross(g);
- /* dumpRanks (g); */
+ dot_position(g);
- dot_position(g);
+ finish = clock();
+ totalCLK += finish - start;
#ifdef ASPECT
- char response[100];
- finish = clock();
- totalCLK += finish - start;
-
- printf("Continue: yes/no/enter # of iterations? (y/n/i)");
- scanf("%s",response);
- if (!strcmp(response, "n") || !strcmp(response, "N"))
- break;
- else if (!strcmp(response, "i") || !strcmp(response, "I"))
- {
- printf("Enter # of iterations: ");
- scanf("%d", &nextiter);
- }
-
- start = clock();
-
+ char response[100];
+ printf("Continue: yes/no/enter # of iterations? (y/n/i)");
+ scanf("%s",response);
+ if (!strcmp(response, "n") || !strcmp(response, "N"))
+ break;
+ else if (!strcmp(response, "i") || !strcmp(response, "I"))
+ {
+ printf("Enter # of iterations: ");
+ scanf("%d", &nextiter);
+ }
} while (nextiter);
#endif
-
- /* dumpRanks (g); */
dot_sameports(g);
+
dot_splines(g);
+
if (mapbool(agget(g, "compound")))
dot_compoundEdges(g);
+
dotneato_postprocess(g);
-#ifdef ASPECT
- printf("Packing iterations=%d\n# of Passes=%d\n", packiter, nPasses);
- printf("Total time = %0.3lf sec\n\n", totalCLK/CLOCKS_PER_SEC);
-#endif
+ if (Verbose) {
+ fprintf(stderr, "Packing iterations=%d\n# of Passes=%d\n", packiter, nPasses);
+ fprintf(stderr, "Total time = %0.3lf sec\n\n", totalCLK/CLOCKS_PER_SEC);
+ }
}
#ifdef ASPECT
double AR = (GD_bb(g).UR.x - GD_bb(g).LL.x)/(GD_bb(g).UR.y - GD_bb(g).LL.y);
- printf("AR=%0.4lf\t Area= %0.4lf\t", AR, (double)(GD_bb(g).UR.x - GD_bb(g).LL.x)*(GD_bb(g).UR.y - GD_bb(g).LL.y)/10000.0);
- printf("Dummy=%d\n", countDummyNodes(g));
+ if (Verbose) {
+ fprintf(stderr, "AR=%0.4lf\t Area= %0.4lf\t", AR, (double)(GD_bb(g).UR.x - GD_bb(g).LL.x)*(GD_bb(g).UR.y - GD_bb(g).LL.y)/10000.0);
+ fprintf(stderr, "Dummy=%d\n", countDummyNodes(g));
+ }
if (AR > 1.1*targetAR)
{
nextiter = (int)(targetAR * (double)(curIterations - prevIterations)/(AR));
else if (AR <= 0.8 * targetAR)
{
nextiter = -1;
- printf("Going to apply another expansion.\n");
+ if (Verbose)
+ fprintf(stderr, "Going to apply another expansion.\n");
+ }
+ else {
+ nextiter = 0;
}
- else nextiter = 0;
- printf("next#iter=%d\n", nextiter);
+ if (Verbose)
+ fprintf(stderr, "next#iter=%d\n", nextiter);
#endif
}