Main Page | Alphabetical List | Class List | File List | Class Members | File Members

clean2.c

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 extern void __assert_fail (__const char *__assertion, __const char *__file,
00011                            unsigned int __line, __const char *__function)
00012   __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
00013 
00014 
00015 
00016 extern void __assert_perror_fail (int __errnum, __const char *__file,
00017                                   unsigned int __line,
00018                                   __const char *__function)
00019   __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
00020 
00021 
00022 
00023 
00024 
00025 extern void __assert (const char *__assertion, const char *__file, int __line)
00026   __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
00027 
00028 
00029 
00030 
00031 struct adjedge;
00032 
00033 struct gedge;
00034 
00035 struct gnlist;
00036 
00037 struct dllist;
00038 
00039 
00040 typedef struct adjedge
00041 {
00042 
00043   struct gedge *kante;
00044 
00045   struct adjedge *next;
00046 
00047   struct adjedge *internal_next;
00048 
00049 }
00050  *ADJEDGE;
00051 
00052 
00053 typedef struct gedge
00054 {
00055 
00056   struct gnode *start;
00057 
00058   long sxloc;
00059 
00060   long syloc;
00061 
00062   long btxloc;
00063 
00064   long btyloc;
00065 
00066   long bbxloc;
00067 
00068   long bbyloc;
00069 
00070   struct gnode *end;
00071 
00072   long exloc;
00073 
00074   long eyloc;
00075 
00076   struct
00077   {
00078 
00079     unsigned char eori:4;
00080 
00081     unsigned char eori2:4;
00082 
00083   }
00084   orientation;
00085 
00086   char linestyle;
00087 
00088   char thickness;
00089 
00090   char *label;
00091 
00092   int priority;
00093 
00094   int horder;
00095 
00096   short eclass;
00097 
00098   unsigned char color;
00099 
00100   char arrowstyle1;
00101 
00102   char arrowstyle2;
00103 
00104   char arrowsize1;
00105 
00106   unsigned char arrowcolor1;
00107 
00108   char arrowsize2;
00109 
00110   unsigned char arrowcolor2;
00111 
00112   unsigned char labelcolor;
00113 
00114   int anchor;
00115 
00116   char *url;
00117 
00118   char kantenart;
00119 
00120   char invisible;
00121 
00122   int weights;
00123 
00124   int weightp;
00125 
00126   struct gnode *labelnode;
00127 
00128   struct gedge *next;
00129 
00130   struct gedge *before;
00131 
00132   struct gedge *internal_next;
00133 
00134 }
00135  *GEDGE;
00136 
00137 
00138 typedef struct gnode
00139 {
00140 
00141   int refnum;
00142 
00143   char *title;
00144 
00145   char *label;
00146 
00147   char *info1;
00148 
00149   char *info2;
00150 
00151   char *info3;
00152 
00153   char *font;
00154 
00155   unsigned char color;
00156 
00157   unsigned char textcolor;
00158 
00159   unsigned char bordercolor;
00160 
00161   signed int width;
00162 
00163   signed int height;
00164 
00165   unsigned char borderwidth;
00166 
00167   int sxloc;
00168 
00169   int syloc;
00170 
00171   char folding;
00172 
00173   int shrink;
00174 
00175   int stretch;
00176 
00177   char textmode;
00178 
00179   char *url;
00180 
00181   char status;
00182 
00183   char shape;
00184 
00185   int level;
00186 
00187   int nhorder;
00188 
00189   struct gnlist *subgraph;
00190 
00191   struct gnode *root;
00192 
00193   struct gnode *regionrepl;
00194 
00195   struct gnlist *region;
00196 
00197   struct gnode *regroot;
00198 
00199   long xloc;
00200 
00201   long yloc;
00202 
00203   struct gnode *next;
00204 
00205   struct gnode *before;
00206 
00207   char in_nodelist;
00208 
00209   char invisible;
00210 
00211   char markiert;
00212 
00213   char revert;
00214 
00215   char anchordummy;
00216 
00217   int tiefe;
00218 
00219   int position;
00220 
00221   float bary;
00222 
00223   long weights;
00224 
00225   long weightp;
00226 
00227   long dfsnum;
00228 
00229   int indegree;
00230 
00231   int outdegree;
00232 
00233   struct dllist *Vpointer;
00234 
00235   struct adjedge *tmpadj;
00236 
00237   struct adjedge *pred;
00238 
00239   struct adjedge *succ;
00240 
00241   struct adjedge *savepred;
00242 
00243   struct adjedge *savesucc;
00244 
00245   struct gedge *predleft;
00246 
00247   struct gedge *predright;
00248 
00249   struct gedge *succleft;
00250 
00251   struct gedge *succright;
00252 
00253   struct connect *connection;
00254 
00255   struct gnode *internal_next;
00256 
00257 }
00258  *GNODE;
00259 
00260 
00261 typedef struct gnlist
00262 {
00263 
00264   struct gnode *node;
00265 
00266   struct gnlist *next;
00267 
00268   struct gnlist *internal_next;
00269 
00270 }
00271  *GNLIST;
00272 
00273 
00274 static int compare_pos (const GNODE * a, const GNODE * b);
00275 
00276 
00277 enum values_crossing_heuristics
00278 {
00279 
00280   CROSSING_BARY = 0,
00281   CROSSING_MEDIAN,
00282   CROSSING_BARYMEDIAN,
00283   CROSSING_MEDIANBARY
00284 }
00285  ;
00286 
00287 
00288 typedef struct depth_entry
00289 {
00290 
00291   int anz;
00292 
00293   int actx;
00294 
00295   int cross;
00296 
00297   GNODE refnode;
00298 
00299   struct gnlist *predlist;
00300 
00301   struct gnlist *succlist;
00302 
00303   char resort_necessary;
00304 
00305 }
00306 DEPTH;
00307 
00308 
00309 typedef struct dllist
00310 {
00311 
00312   struct gnode *node;
00313 
00314   int dlinfo;
00315 
00316   int dlx;
00317 
00318   struct dllist *pred;
00319 
00320   struct dllist *succ;
00321 
00322 }
00323  *DLLIST;
00324 
00325 
00326 
00327 int compare_bary (const GNODE * a, const GNODE * b);
00328 
00329 int compare_pos (const GNODE * a, const GNODE * b);
00330 
00331 
00332 void save_level (int i);
00333 
00334 
00335 
00336 
00337 extern int max_nodes_per_layer;
00338 
00339 extern DEPTH *layer;
00340 
00341 extern int nr_crossings;
00342 
00343 extern GNODE *save_array;
00344 
00345 extern int crossing_heuristics;
00346 
00347 extern GNODE *sort_array;
00348 
00349 extern int size_of_sortarray;
00350 
00351 extern DEPTH *tmp_layer;
00352 
00353 extern int size_of_tlayer;
00354 
00355 
00356 extern int maxdepth;
00357 
00358 
00359 
00360 
00361 extern int size_upper_list;
00362 
00363 extern int size_lower_list;
00364 
00365 extern DLLIST lower_list;
00366 
00367 extern DLLIST lower_list_end;
00368 
00369 extern DLLIST upper_list;
00370 
00371 extern DLLIST upper_list_end;
00372 
00373 extern int nr_tcrossings;
00374 
00375 
00376 
00377 extern int max_baryiterations;
00378 
00379 extern int min_baryiterations;
00380 
00381 extern int nr_bary_iterations;
00382 
00383 
00384 extern int maxdepth;
00385 
00386 extern int max_eprio;
00387 
00388 
00389 extern int max_horder_num;
00390 
00391 
00392 extern int phase2_startlevel;
00393 
00394 extern int skip_baryphase2;
00395 
00396 
00397 extern int G_timelimit;
00398 
00399 
00400 extern int maxr_lower_list;
00401 
00402 extern int maxr_upper_list;
00403 
00404 extern int maxr_sum;
00405 
00406 extern int upperxpos;
00407 
00408 extern int lowerxpos;
00409 
00410 extern int nr_bary_iterations;
00411 
00412 extern int max_baryiterations;
00413 
00414 extern int max_horder_num;
00415 
00416 extern int nr_bary_iterations;
00417 
00418 
00419 
00420 
00421 int
00422 compare_pos (const GNODE * a, const GNODE * b)
00423 {
00424   if (((*a)->position) > ((*b)->position))
00425     return (1);
00426   if (((*a)->position) < ((*b)->position))
00427     return (-1);
00428   return (0);
00429 }
00430 
00431 
00432 void
00433 checkcrossing (int j)
00434 {
00435 
00436   calc_all_layers_crossings ();
00437 
00438   ((void)
00439    (__builtin_expect (!!((j == graph_crossings ())), 1) ? 0
00440     : (__assert_fail
00441        ("(j==graph_crossings())", "clean.c", 17, __PRETTY_FUNCTION__), 0)));
00442 
00443   printf ("Phase2_down: nr_crossings old: %d new: %d\n", nr_crossings, j);
00444 
00445 }
00446 
00447 float
00448 predbary (GNODE node)
00449 {
00450   int Sum;
00451   ADJEDGE w;
00452   if ((node->indegree) == 0)
00453     return (0.0);
00454   Sum = 0;
00455   w = (node->pred);
00456   while (w)
00457     {
00458       Sum += (256.0 * ((w->kante->start)->position));
00459       Sum += (w->kante->anchor);
00460       w = w->next;
00461     }
00462   return (((float) Sum) / ((float) (256.0 * (node->indegree))));
00463 }
00464 
00465 float
00466 succbary (GNODE node)
00467 {
00468   int Sum;
00469   ADJEDGE w;
00470   if ((node->outdegree) == 0)
00471     return (0.0);
00472   Sum = 0;
00473   w = (node->succ);
00474   while (w)
00475     {
00476       Sum += (256.0 * ((w->kante->end)->position));
00477       Sum += (w->kante->anchor);
00478       w = w->next;
00479     }
00480   return (((float) Sum) / ((float) (256.0 * (node->outdegree))));
00481 }
00482 
00483 float
00484 predmedian (GNODE node)
00485 {
00486   int i, leftpart, rightpart;
00487   ADJEDGE w;
00488   ;
00489   ;
00490   switch (((node->indegree)))
00491     {
00492     case 0:
00493       return (0.0);
00494       break;
00495     case 1:
00496       return (((float) (node->pred->kante->start->position)) +
00497               ((float) (node->pred->kante->anchor)) / 256.0);
00498       break;
00499     case 2:
00500       break;
00501       return (((float) (node->pred->kante->start->position) +
00502                (node->pred->next->kante->start->position)) / 2.0);
00503     }
00504   i = 0;
00505   w = ((node)->pred);
00506   while (w)
00507     {
00508       save_array[i++] = (((((w)->kante))->start));
00509       w = ((w)->next);
00510     }
00511   if (i)
00512     qsort (save_array, i, sizeof (GNODE),
00513            (int (*)(const void *, const void *)) compare_pos);
00514   if (i % 2)
00515     return ((float) ((save_array[i / 2])->position));
00516   leftpart =
00517     ((save_array[i / 2 - 1])->position) - ((save_array[0])->position);
00518   rightpart =
00519     ((save_array[i - 1])->position) - ((save_array[i / 2])->position);
00520   return (((float)
00521            (((save_array[i / 2 - 1])->position) * rightpart +
00522             ((save_array[i / 2])->position) * leftpart)) /
00523           ((float) (leftpart + rightpart)));
00524 }
00525 
00526 float
00527 succmedian (GNODE node)
00528 {
00529   int i, leftpart, rightpart;
00530   ADJEDGE w;
00531   ;
00532   ;
00533   switch (((node->outdegree)))
00534     {
00535     case 0:
00536       return (0.0);
00537       break;
00538     case 1:
00539       return (((float) (node->succ->kante->end->position)) -
00540               ((float) (node->succ->kante->anchor)) / 256.0);
00541       break;
00542     case 2:
00543       break;
00544       return (((float) (node->succ->kante->end->position) +
00545                (node->succ->next->kante->end->position)) / 2.0);
00546     }
00547   i = 0;
00548   w = ((node)->succ);
00549   while (w)
00550     {
00551       save_array[i++] = (((((w)->kante))->end));
00552       w = ((w)->next);
00553     }
00554   if (i)
00555     qsort (save_array, i, sizeof (GNODE),
00556            (int (*)(const void *, const void *)) compare_pos);
00557   if (i % 2)
00558     return ((float) ((save_array[i / 2])->position));
00559   leftpart =
00560     ((save_array[i / 2 - 1])->position) - ((save_array[0])->position);
00561   rightpart =
00562     ((save_array[i - 1])->position) - ((save_array[i / 2])->position);
00563   return (((float)
00564            (((save_array[i / 2 - 1])->position) * rightpart +
00565             ((save_array[i / 2])->position) * leftpart)) /
00566           ((float) (leftpart + rightpart)));
00567 }
00568 
00569 
00570 
00571 int phase2_startlevel = 0;
00572 
00573 extern int maxdepth;
00574 
00575 int G_timelimit;
00576 
00577 void
00578 phase2_down ()
00579 {
00580   int i, j;
00581   int cross;
00582   gs_wait_message ('B');
00583   if (phase2_startlevel <= maxdepth)
00584     for (i = phase2_startlevel; i <= maxdepth; i++)
00585       {
00586         if (G_timelimit > 0)
00587           if (test_timelimit (60))
00588             {
00589               gs_wait_message ('t');
00590             }
00591         level_to_array (i, 'u');
00592         ;
00593         switch (crossing_heuristics)
00594           {
00595           case CROSSING_BARY:
00596             for (j = 0; j < ((layer[i]).anz); j++)
00597               ((sort_array[j])->bary) = (succbary (sort_array[j]));
00598             break;
00599           case CROSSING_MEDIAN:
00600             for (j = 0; j < ((layer[i]).anz); j++)
00601               ((sort_array[j])->bary) = (succmedian (sort_array[j]));
00602             break;
00603           case CROSSING_BARYMEDIAN:
00604             for (j = 0; j < ((layer[i]).anz); j++)
00605               ((sort_array[j])->bary) =
00606                 (succbary (sort_array[j]) +
00607                  succmedian (sort_array[j]) / 10000.0);
00608             break;
00609           case CROSSING_MEDIANBARY:
00610             for (j = 0; j < ((layer[i]).anz); j++)
00611               ((sort_array[j])->bary) =
00612                 (succmedian (sort_array[j]) +
00613                  succbary (sort_array[j]) / 10000.0);
00614             break;
00615           }
00616         if (((layer[i]).anz))
00617           qsort (sort_array, ((layer[i]).anz), sizeof (GNODE),
00618                  (int (*)(const void *, const void *)) compare_bary);
00619         if (cycle_sort_array (((layer[i]).anz)))
00620           {
00621             array_to_level (i);
00622             if (((layer[i]).resort_necessary))
00623               apply_horder (i);
00624             if (i > 0)
00625               ((tmp_layer[i - 1]).cross) = layer_crossing (i - 1);
00626             if (i <= maxdepth)
00627               ((tmp_layer[i]).cross) = layer_crossing (i);
00628             resort_up_down_layer (i);
00629             cross = graph_crossings ();
00630             if (cross < nr_crossings)
00631               {
00632                 phase2_startlevel = i + 1;
00633                 checkcrossing (cross);
00634                 return;
00635               }
00636           }
00637       }
00638   for (i = 0; (i < phase2_startlevel) && (i <= maxdepth); i++)
00639     {
00640       if (G_timelimit > 0)
00641         if (test_timelimit (60))
00642           {
00643             gs_wait_message ('t');
00644           }
00645       level_to_array (i, 'u');
00646       ;
00647       switch (crossing_heuristics)
00648         {
00649         case CROSSING_BARY:
00650           for (j = 0; j < ((layer[i]).anz); j++)
00651             ((sort_array[j])->bary) = (predbary (sort_array[j]));
00652           break;
00653         case CROSSING_MEDIAN:
00654           for (j = 0; j < ((layer[i]).anz); j++)
00655             ((sort_array[j])->bary) = (predmedian (sort_array[j]));
00656           break;
00657         case CROSSING_BARYMEDIAN:
00658           for (j = 0; j < ((layer[i]).anz); j++)
00659             ((sort_array[j])->bary) =
00660               (predbary (sort_array[j]) +
00661                predmedian (sort_array[j]) / 10000.0);
00662           break;
00663         case CROSSING_MEDIANBARY:
00664           for (j = 0; j < ((layer[i]).anz); j++)
00665             ((sort_array[j])->bary) =
00666               (predmedian (sort_array[j]) +
00667                predbary (sort_array[j]) / 10000.0);
00668           break;
00669         }
00670       if (((layer[i]).anz))
00671         qsort (sort_array, ((layer[i]).anz), sizeof (GNODE),
00672                (int (*)(const void *, const void *)) compare_bary);
00673       if (cycle_sort_array (((layer[i]).anz)))
00674         {
00675           array_to_level (i);
00676           if (((layer[i]).resort_necessary))
00677             apply_horder (i);
00678           if (i > 0)
00679             ((tmp_layer[i - 1]).cross) = layer_crossing (i - 1);
00680           if (i <= maxdepth)
00681             ((tmp_layer[i]).cross) = layer_crossing (i);
00682           resort_up_down_layer (i);
00683           cross = graph_crossings ();
00684           if (cross < nr_crossings)
00685             {
00686               phase2_startlevel = i + 1;
00687               checkcrossing (cross);
00688               return;
00689             }
00690         }
00691     }
00692 }
00693 
00694 void
00695 phase2_up ()
00696 {
00697   int i, j;
00698   int cross;
00699   gs_wait_message ('B');
00700   if (phase2_startlevel <= maxdepth)
00701     for (i = phase2_startlevel; i <= maxdepth; i++)
00702       {
00703         if (G_timelimit > 0)
00704           if (test_timelimit (60))
00705             {
00706               gs_wait_message ('t');
00707             }
00708         level_to_array (i, 'u');
00709         ;
00710         switch (crossing_heuristics)
00711           {
00712           case CROSSING_BARY:
00713             for (j = 0; j < ((layer[i]).anz); j++)
00714               ((sort_array[j])->bary) = (succbary (sort_array[j]));
00715             break;
00716           case CROSSING_MEDIAN:
00717             for (j = 0; j < ((layer[i]).anz); j++)
00718               ((sort_array[j])->bary) = (succmedian (sort_array[j]));
00719             break;
00720           case CROSSING_BARYMEDIAN:
00721             for (j = 0; j < ((layer[i]).anz); j++)
00722               ((sort_array[j])->bary) =
00723                 (succbary (sort_array[j]) +
00724                  succmedian (sort_array[j]) / 10000.0);
00725             break;
00726           case CROSSING_MEDIANBARY:
00727             for (j = 0; j < ((layer[i]).anz); j++)
00728               ((sort_array[j])->bary) =
00729                 (succmedian (sort_array[j]) +
00730                  succbary (sort_array[j]) / 10000.0);
00731             break;
00732           }
00733         if (((layer[i]).anz))
00734           qsort (sort_array, ((layer[i]).anz), sizeof (GNODE),
00735                  (int (*)(const void *, const void *)) compare_bary);
00736         if (cycle_sort_array (((layer[i]).anz)))
00737           {
00738             array_to_level (i);
00739             if (((layer[i]).resort_necessary))
00740               apply_horder (i);
00741             if (i > 0)
00742               ((tmp_layer[i - 1]).cross) = layer_crossing (i - 1);
00743             if (i <= maxdepth)
00744               ((tmp_layer[i]).cross) = layer_crossing (i);
00745             resort_down_up_layer (i);
00746             cross = graph_crossings ();
00747             if (cross < nr_crossings)
00748               {
00749                 phase2_startlevel = i + 1;
00750                 checkcrossing (cross);
00751                 return;
00752               }
00753           }
00754       }
00755   for (i = 0; (i < phase2_startlevel) && (i <= maxdepth); i++)
00756     {
00757       if (G_timelimit > 0)
00758         if (test_timelimit (60))
00759           {
00760             gs_wait_message ('t');
00761           }
00762       level_to_array (i, 'u');
00763       ;
00764       switch (crossing_heuristics)
00765         {
00766         case CROSSING_BARY:
00767           for (j = 0; j < ((layer[i]).anz); j++)
00768             ((sort_array[j])->bary) = (succbary (sort_array[j]));
00769           break;
00770         case CROSSING_MEDIAN:
00771           for (j = 0; j < ((layer[i]).anz); j++)
00772             ((sort_array[j])->bary) = (succmedian (sort_array[j]));
00773           break;
00774         case CROSSING_BARYMEDIAN:
00775           for (j = 0; j < ((layer[i]).anz); j++)
00776             ((sort_array[j])->bary) =
00777               (succbary (sort_array[j]) +
00778                succmedian (sort_array[j]) / 10000.0);
00779           break;
00780         case CROSSING_MEDIANBARY:
00781           for (j = 0; j < ((layer[i]).anz); j++)
00782             ((sort_array[j])->bary) =
00783               (succmedian (sort_array[j]) +
00784                succbary (sort_array[j]) / 10000.0);
00785           break;
00786         }
00787       if (((layer[i]).anz))
00788         qsort (sort_array, ((layer[i]).anz), sizeof (GNODE),
00789                (int (*)(const void *, const void *)) compare_bary);
00790       if (cycle_sort_array (((layer[i]).anz)))
00791         {
00792           array_to_level (i);
00793           if (((layer[i]).resort_necessary))
00794             apply_horder (i);
00795           if (i > 0)
00796             ((tmp_layer[i - 1]).cross) = layer_crossing (i - 1);
00797           if (i <= maxdepth)
00798             ((tmp_layer[i]).cross) = layer_crossing (i);
00799           resort_down_up_layer (i);
00800           cross = graph_crossings ();
00801           if (cross < nr_crossings)
00802             {
00803               phase2_startlevel = i + 1;
00804               checkcrossing (cross);
00805               return;
00806             }
00807         }
00808     }
00809 }
00810 
00811 
00812 
00813 int
00814 resort_down_layer (int i)
00815 {
00816   int c;
00817   int j;
00818   level_to_array (i + 1, 'd');
00819   switch (crossing_heuristics)
00820     {
00821     case CROSSING_BARY:
00822       for (j = 0; j < ((layer[i]).anz); j++)
00823         ((sort_array[j])->bary) = (predbary (sort_array[j]));
00824       break;
00825     case CROSSING_MEDIAN:
00826       for (j = 0; j < ((layer[i]).anz); j++)
00827         ((sort_array[j])->bary) = (predmedian (sort_array[j]));
00828       break;
00829     case CROSSING_BARYMEDIAN:
00830       for (j = 0; j < ((layer[i]).anz); j++)
00831         ((sort_array[j])->bary) =
00832           (predbary (sort_array[j]) + predmedian (sort_array[j]) / 10000.0);
00833       break;
00834     case CROSSING_MEDIANBARY:
00835       for (j = 0; j < ((layer[i]).anz); j++)
00836         ((sort_array[j])->bary) =
00837           (predmedian (sort_array[j]) + predbary (sort_array[j]) / 10000.0);
00838       break;
00839     }
00840   if (((layer[i]).anz))
00841     qsort (sort_array, ((layer[i]).anz), sizeof (GNODE),
00842            (int (*)(const void *, const void *)) compare_bary);
00843   save_level (i + 1);
00844   array_to_level (i + 1);
00845   if (((layer[i + 1]).resort_necessary))
00846     apply_horder (i + 1);
00847   c = layer_crossing (i);
00848   if (c <= ((tmp_layer[i]).cross))
00849     {
00850       ((tmp_layer[i]).cross) = c;
00851       if (i > 0)
00852         ((tmp_layer[i + 1]).cross) = layer_crossing (i + 1);
00853       return (1);
00854     }
00855   restore_level (i + 1);
00856   return (0);
00857 }
00858 
00859 int
00860 resort_up_layer (int i)
00861 {
00862   int c;
00863   int j;
00864   level_to_array (i, 'u');
00865   switch (crossing_heuristics)
00866     {
00867     case CROSSING_BARY:
00868       for (j = 0; j < ((layer[i]).anz); j++)
00869         ((sort_array[j])->bary) = (succbary (sort_array[j]));
00870       break;
00871     case CROSSING_MEDIAN:
00872       for (j = 0; j < ((layer[i]).anz); j++)
00873         ((sort_array[j])->bary) = (succmedian (sort_array[j]));
00874       break;
00875     case CROSSING_BARYMEDIAN:
00876       for (j = 0; j < ((layer[i]).anz); j++)
00877         ((sort_array[j])->bary) =
00878           (succbary (sort_array[j]) + succmedian (sort_array[j]) / 10000.0);
00879       break;
00880     case CROSSING_MEDIANBARY:
00881       for (j = 0; j < ((layer[i]).anz); j++)
00882         ((sort_array[j])->bary) =
00883           (succmedian (sort_array[j]) + succbary (sort_array[j]) / 10000.0);
00884       break;
00885     }
00886   if (((layer[i]).anz))
00887     qsort (sort_array, ((layer[i]).anz), sizeof (GNODE),
00888            (int (*)(const void *, const void *)) compare_bary);
00889   save_level (i);
00890   array_to_level (i);
00891   if (((layer[i]).resort_necessary))
00892     apply_horder (i);
00893   c = layer_crossing (i);
00894   if (c <= ((tmp_layer[i]).cross))
00895     {
00896       ((tmp_layer[i]).cross) = c;
00897       if (i > 0)
00898         ((tmp_layer[i - 1]).cross) = layer_crossing (i - 1);
00899       return (1);
00900     }
00901   restore_level (i);
00902   return (0);
00903 }

Generated on Sat Aug 6 11:49:18 2005 for VCGIntrospector by doxygen 1.3.6