36 |
|
} |
37 |
|
} |
38 |
|
|
39 |
< |
static String sep() { return print? "\n" : " "; } |
39 |
> |
static String sep() { return print ? "\n" : " "; } |
40 |
|
|
41 |
|
static void allTests(int size, int trials) throws Exception { |
42 |
|
System.out.println("---------------------------------------------"); |
112 |
|
throw new Error("bad computation"); |
113 |
|
} |
114 |
|
|
115 |
< |
static void ctest(Collection<Integer> c, List<Integer> klist, int ksum, int size, int trials) |
115 |
> |
static void ctest(Collection<Integer> c, List<Integer> klist, int ksum, int size, int trials) |
116 |
|
throws Exception { |
117 |
|
String cn = c.getClass().getName(); |
118 |
|
if (cn.startsWith("java.util.concurrent.")) |
160 |
|
long tlast = System.nanoTime(); |
161 |
|
for (int i = 0; i < trials; ++i) { |
162 |
|
Integer psum = Integer.valueOf(checksum.get()); |
163 |
< |
for (Integer x : c) |
163 |
> |
for (Integer x : c) |
164 |
|
psum = SUM.apply(psum, x); |
165 |
|
checksum.getAndAdd(sum - psum); |
166 |
|
} |