00001
00002
00003
00004
00005
00006
00007 #include "bary.h"
00008 #define STATIC
00009 #include "bary_macros.h"
00010
00011
00012 STATIC int compare_pos (const GNODE * a, const GNODE * b){ if (((*a)->position) > ((*b)->position)) return (1); if (((*a)->position) < ((*b)->position)) return (-1); return (0);}
00013
00014 STATIC void checkcrossing (int j)
00015 {
00016 calc_all_layers_crossings();
00017 assert((j==graph_crossings()));
00018 printf("Phase2_down: nr_crossings old: %d new: %d\n",nr_crossings,j);
00019 }
00020 GENERICBARY(predbary,indegree,pred,start)
00021 GENERICBARY(succbary,outdegree,succ,end)
00022 GENERICMEDIAN(predmedian,indegree,pred,start,+)
00023 GENERICMEDIAN(succmedian,outdegree,succ,end,-)
00024
00025
00026 STATIC int phase2_startlevel = 0;
00027 extern int maxdepth;
00028 int G_timelimit;
00029
00030
00031
00032
00033
00034
00035
00036
00037 PHASE(2,down,BARY_CASE(succ),BARY_CASE(pred),POST(2,up_down))
00038 PHASE(2,up,BARY_CASE(succ),BARY_CASE(succ),POST(2,down_up))
00039
00040
00041 RESORT_FUNCTION(down,'d',pred,i+1,i+1)
00042 RESORT_FUNCTION(up ,'u',succ,i ,i-1)