Go to the source code of this file.
Functions | |
STATIC int | resort_down_layer (int i) |
STATIC int | resort_up_layer (int i) |
|
Definition at line 2 of file resort_old.c. References apply_horder(), array_to_level(), compare_bary(), crossing_heuristics, GNODE, layer, layer_crossing(), level_to_array(), maxdepth, predbary(), predmedian(), restore_level(), save_level(), sort_array, STATIC, and tmp_layer. Referenced by phase1_down(), resort_down_up_layer(), and resort_up_down_layer().
00002 { 00003 int c; int j; 00004 level_to_array (i + 1, 'd'); 00005 switch (crossing_heuristics) { 00006 case 0: for (j = 0; j < ((layer[i + 1]).anz); j++) ((sort_array[j])->bary) = predbary (sort_array[j]); break; 00007 case 1: for (j = 0; j < ((layer[i + 1]).anz); j++) ((sort_array[j])->bary) = predmedian (sort_array[j]); break; 00008 case 2: for (j = 0; j < ((layer[i + 1]).anz); j++) ((sort_array[j])->bary) = predbary (sort_array[j]) + predmedian (sort_array[j])/10000.0; break; 00009 case 3: for (j = 0; j < ((layer[i + 1]).anz); j++) ((sort_array[j])->bary) = predmedian (sort_array[j]) +predbary (sort_array[j])/10000.0; break; 00010 } 00011 00012 if (((layer[i + 1]).anz)) qsort (sort_array, ((layer[i + 1]).anz), sizeof (GNODE), (int (*)(const void *, const void *)) compare_bary); 00013 save_level (i + 1); 00014 array_to_level (i + 1); 00015 if (((layer[i + 1]).resort_necessary)) apply_horder (i + 1); 00016 c = layer_crossing (i); 00017 if (c <= ((tmp_layer[i]).cross)) { 00018 ((tmp_layer[i]).cross) = c; 00019 if (i < maxdepth) ((tmp_layer[i + 1]).cross) = layer_crossing (i + 1); 00020 return (1); 00021 } 00022 restore_level (i + 1); 00023 return (0); 00024 } |
|
Definition at line 26 of file resort_old.c. References apply_horder(), array_to_level(), compare_bary(), crossing_heuristics, GNODE, layer, layer_crossing(), level_to_array(), restore_level(), save_level(), sort_array, STATIC, succbary(), succmedian(), and tmp_layer. Referenced by phase1_up(), resort_down_up_layer(), and resort_up_down_layer().
00026 { 00027 int c; int j; 00028 level_to_array (i, 'u'); 00029 switch (crossing_heuristics) { 00030 case 0: for (j = 0;j < ((layer[i]).anz);j++)((sort_array[j])->bary) = succbary (sort_array[j]); break; 00031 case 1: for (j = 0;j < ((layer[i]).anz);j++)((sort_array[j])->bary) = succmedian (sort_array[j]); break; 00032 case 2: for (j = 0;j < ((layer[i]).anz);j++)((sort_array[j])->bary) = succbary (sort_array[j]) + succmedian (sort_array[j]) / 10000.0; break; 00033 case 3: for (j = 0; j < ((layer[i]).anz); j++) ((sort_array[j])->bary) =succmedian(sort_array[j])+succbary(sort_array[j])/10000.0;break; 00034 } 00035 if (((layer[i]).anz)) qsort (sort_array, ((layer[i]).anz), sizeof (GNODE), (int (*)(const void *, const void *)) compare_bary); 00036 save_level (i); 00037 array_to_level (i); 00038 if (((layer[i]).resort_necessary)) apply_horder (i); 00039 c = layer_crossing (i); 00040 if (c <= ((tmp_layer[i]).cross)) { 00041 ((tmp_layer[i]).cross) = c; 00042 if (i > 0) ((tmp_layer[i - 1]).cross) = layer_crossing (i - 1); 00043 return (1); 00044 } 00045 restore_level (i); 00046 return (0); 00047 } |