36 |
|
numbers[i] = Long.valueOf(i); |
37 |
|
|
38 |
|
int thr = ((n + 7) >>> 3) / ForkJoinPool.getCommonPoolParallelism(); |
39 |
< |
THRESHOLD = (thr <= 1 << 13)? 1 << 13 : thr; |
39 |
> |
THRESHOLD = (thr <= 1 << 13) ? 1 << 13 : thr; |
40 |
|
|
41 |
|
System.out.println("Threshold = " + THRESHOLD); |
42 |
|
|
122 |
|
|
123 |
|
static void checkSorted(Long[] a) { |
124 |
|
int n = a.length; |
125 |
< |
long x = ((Long)a[0]).longValue(), y; |
125 |
> |
long x = a[0].longValue(), y; |
126 |
|
for (int i = 0; i < n - 1; i++) { |
127 |
< |
if (x > (y = ((Long)a[i+1]).longValue())) |
127 |
> |
if (x > (y = a[i+1].longValue())) |
128 |
|
throw new Error("Unsorted at " + i + ": " + x + " / " + y); |
129 |
|
x = y; |
130 |
|
} |
153 |
|
} |
154 |
|
ThreadLocalRandom rng = ThreadLocalRandom.current(); |
155 |
|
Long dl = d[l]; |
156 |
< |
int m = (dl == null)? h : rng.nextInt(l, h); |
156 |
> |
int m = (dl == null) ? h : rng.nextInt(l, h); |
157 |
|
for (int i = l; i < m; ++i) |
158 |
|
d[i] = s[rng.nextInt(n)]; |
159 |
|
if (dl != null) { |
185 |
|
} |
186 |
|
int bound = h < n ? h : n - 1; |
187 |
|
int i = l; |
188 |
< |
long x = ((Long)a[i]).longValue(), y; |
188 |
> |
long x = a[i].longValue(), y; |
189 |
|
while (i < bound) { |
190 |
< |
if (x > (y = ((Long)a[++i]).longValue())) |
190 |
> |
if (x > (y = a[++i].longValue())) |
191 |
|
throw new Error("Unsorted " + x + " / " + y); |
192 |
|
x = y; |
193 |
|
} |