- private static LinearProgramming.Simplex lp_h = new LinearProgramming.Simplex(100, 100, 300);
- private static LinearProgramming.Simplex lp = new LinearProgramming.Simplex(100, 100, 300);
- boolean[] breakpoints = new boolean[65535];
- int[] regions = new int[65535];
- int[] regions_v = new int[65535];
+ private static Simplex lp_h = new Simplex(65535, 65535, 65535);
+ private static Simplex lp = new Simplex(65535, 65535, 65535);
+
+ private static int[] regions = new int[65535];
+ private static int[] regions_v = new int[65535];
+ private static int numregions = 0;
+ private static int numregions_v = 0;
+ //#repeat col/row colspan/rowspan contentwidth/contentheight width/height HSHRINK/VSHRINK numregions/numregions_v \
+ // maxwidth/maxheight cols/rows minwidth/minheight lp_h/lp lp_h/lp easy_width/easy_height regions/regions_v \
+ // computeRegions/computeRegions_v
+ private void computeRegions() {
+ numregions = 0;
+ for(Box c = firstPackedChild(); c != null; c = c.nextPackedSibling()) {
+ regions[numregions++] = c.col;
+ regions[numregions++] = min(cols, c.col+c.colspan);
+ }
+ Vec.sortInts(regions, 0, numregions);
+ int j = 0;
+ int newnumregions = numregions;
+ for(int i=1; i<numregions; i++) {
+ if (regions[j] != regions[i]) j++;
+ else newnumregions--;
+ regions[j] = regions[i];
+ }
+ numregions = newnumregions;
+ if (regions[numregions-1] == cols) numregions--;
+ else regions[numregions] = cols;
+ }
+ //#end