68 |
|
long now = System.nanoTime(); |
69 |
|
double total = (double)(now - start) / NPS; |
70 |
|
double elapsed = (double)(now - last) / NPS; |
71 |
< |
System.out.printf("Arrays.sort time: %7.3f total %9.3f\n", |
71 |
> |
System.out.printf("Arrays.sort time: %7.3f total %9.3f\n", |
72 |
|
elapsed, total); |
73 |
|
if (i == 0) |
74 |
|
checkSorted(a); |
90 |
|
// pool.invoke(new TaskChecker()); |
91 |
|
double total = (double)(now - start) / NPS; |
92 |
|
double elapsed = (double)(now - last) / NPS; |
93 |
< |
System.out.printf("Parallel sort time: %7.3f total %9.3f\n", |
93 |
> |
System.out.printf("Parallel sort time: %7.3f total %9.3f\n", |
94 |
|
elapsed, total); |
95 |
|
if (i == 0) |
96 |
|
checkSorted(a); |
202 |
|
Long al = a[l], ar; |
203 |
|
if (r >= rFence || |
204 |
|
al.longValue() <= (ar = a[r]).longValue()) { |
205 |
< |
++l; t = al; |
206 |
< |
} |
207 |
< |
else { |
208 |
< |
++r; t = ar; |
205 |
> |
++l; t = al; |
206 |
> |
} |
207 |
> |
else { |
208 |
> |
++r; t = ar; |
209 |
|
} |
210 |
|
} |
211 |
|
else if (r < rFence) |
212 |
|
t = a[r++]; |
213 |
< |
else |
213 |
> |
else |
214 |
|
break; |
215 |
|
w[k++] = t; |
216 |
|
} |
295 |
|
final Long[] src; |
296 |
|
final Long[] dst; |
297 |
|
final int lo, hi, size; |
298 |
< |
RandomRepacker(Long[] src, Long[] dst, |
298 |
> |
RandomRepacker(Long[] src, Long[] dst, |
299 |
|
int lo, int hi, int size) { |
300 |
|
this.src = src; this.dst = dst; |
301 |
|
this.lo = lo; this.hi = hi; this.size = size; |
302 |
|
} |
303 |
< |
|
303 |
> |
|
304 |
|
public final void compute() { |
305 |
|
Long[] s = src; |
306 |
|
Long[] d = dst; |