/** * Gets a list of ranges to be searched for a multi-dimensional range query * where min <= value <= max. In most cases, the ranges will be larger * than required in order to combine smaller ranges into one. Usually, about * double as many points will be included in the resulting range. * * @param min the minimum value * @param max the maximum value * @return the list of ranges (low, high pairs) */ private long[][] getMortonRanges(int[] min, int[] max) { int len = min.length; if (max.length != len) { throw new IllegalArgumentException(len + "=" + max.length); } for (int i = 0; i < len; i++) { if (min[i] > max[i]) { int temp = min[i]; min[i] = max[i]; max[i] = temp; } } int total = getSize(min, max, len); ArrayList<long[]> list = New.arrayList(); addMortonRanges(list, min, max, len, 0); combineEntries(list, total); return list.toArray(new long[0][]); }
/** * Gets a list of ranges to be searched for a multi-dimensional range query * where min <= value <= max. In most cases, the ranges will be larger * than required in order to combine smaller ranges into one. Usually, about * double as many points will be included in the resulting range. * * @param min the minimum value * @param max the maximum value * @return the list of ranges (low, high pairs) */ private long[][] getMortonRanges(int[] min, int[] max) { int len = min.length; if (max.length != len) { throw new IllegalArgumentException(len + "=" + max.length); } for (int i = 0; i < len; i++) { if (min[i] > max[i]) { int temp = min[i]; min[i] = max[i]; max[i] = temp; } } int total = getSize(min, max, len); ArrayList<long[]> list = New.arrayList(); addMortonRanges(list, min, max, len, 0); combineEntries(list, total); long[][] ranges = new long[list.size()][2]; list.toArray(ranges); return ranges; }
/** * Gets a list of ranges to be searched for a multi-dimensional range query * where min <= value <= max. In most cases, the ranges will be larger * than required in order to combine smaller ranges into one. Usually, about * double as many points will be included in the resulting range. * * @param min the minimum value * @param max the maximum value * @return the list of ranges (low, high pairs) */ private long[][] getMortonRanges(int[] min, int[] max) { int len = min.length; if (max.length != len) { throw new IllegalArgumentException(len + "=" + max.length); } for (int i = 0; i < len; i++) { if (min[i] > max[i]) { int temp = min[i]; min[i] = max[i]; max[i] = temp; } } int total = getSize(min, max, len); ArrayList<long[]> list = New.arrayList(); addMortonRanges(list, min, max, len, 0); combineEntries(list, total); long[][] ranges = new long[list.size()][2]; list.toArray(ranges); return ranges; }