return allPackedHilbert(packed); ShortVLA vla = new ShortVLA(64); boolean on = false;
/** * Gets the positions that are "on" in the given packed array, without unpacking it, repeatedly goes through a * number of "on" cells equal to fraction and stores one of those cells as a Coord, and returns the accumulated * portion of positions as an array of Hilbert Curve indices. * <br> * For purposes of finding mostly cells with a similar distance to each other but without obvious patterns, a value * of 5, 6, or 7 for fraction works well. * @param packed a short[] returned by pack() or one of the sub-arrays in what is returned by packMulti(); must * not be null (this method does not check due to very tight performance constraints). * @param fraction the approximate fraction of "on" cells to use * @return a Hilbert Curve index array corresponding to a fraction of the "on" cells in packed. */ public static short[] fractionPackedHilbert(short[] packed, int fraction) { if(fraction <= 1) return allPackedHilbert(packed); ShortVLA vla = new ShortVLA(64); boolean on = false; int idx = 0, ctr = 0; for(int p = 0; p < packed.length; p++, on = !on) { if (on) { for (int i = idx; i < idx + (packed[p] & 0xffff); i++, ctr = (ctr + 1) % fraction) { if(ctr == 0) vla.add((short)i); } } idx += packed[p] & 0xffff; } return vla.toArray(); }
return allPackedHilbert(packed); if(eightWay) return apartPackedHilbert(packed, minDistance);
short[] s2 = allPackedHilbert(start); int ct = s2.length; ss.addAll(s2); vla.addAll(s2); edge.addAll(allPackedHilbert(intersectPacked(bounds, fringe(start, 1, 256, 256, false)))); ss.addAll(edge); if(edge.size <= 0)
short[] s2 = allPackedHilbert(start); ss.addAll(s2); vla.addAll(s2);
short[] s2 = allPackedHilbert(start); ss.addAll(s2); vla.addAll(s2);
short[] s2 = allPackedHilbert(start); for (int s = 0; s < s2.length; s++) { i = s2[s] & 0xffff;
short[] s2 = allPackedHilbert(start); if(reach.limit == null || reach.limit == AimLimit.FREE) { for (int s = 0; s < s2.length; s++) {